Skip to content

Commit

Permalink
Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc
Browse files Browse the repository at this point in the history
Make ZST checks in core/alloc more readable

There's a bunch of these checks because of special handing for ZSTs in various unsafe implementations of stuff.

This lets them be `T::IS_ZST` instead of `mem::size_of::<T>() == 0` every time, making them both more readable and more terse.

*Not* proposed for stabilization.  Would be `pub(crate)` except `alloc` wants to use it too.

(And while it doesn't matter now, if we ever get something like #85836 making it a const can help codegen be simpler.)
  • Loading branch information
bors committed Sep 25, 2022
2 parents f43a5a7 + 194a1a8 commit e93032f
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit e93032f

Please sign in to comment.