rust/library/alloc/src
bors e58621a4a3 Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc
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.)
2022-09-25 01:20:11 +00:00
..
alloc Replace most uses of pointer::offset with add and sub 2022-08-21 02:21:41 +04:00
boxed Move error trait into core 2022-08-22 13:28:25 -07:00
collections Put back one of the uses for intra-doc mentions 2022-09-23 21:47:23 -07:00
ffi Move error trait into core 2022-08-22 13:28:25 -07:00
raw_vec Add a unit test for zero-sized types in RawVec. 2021-11-26 19:30:45 +11:00
rc Use Box::new() instead of box syntax in alloc tests 2022-05-29 00:41:14 +02:00
sync add some Miri-only tests 2022-08-18 18:07:39 -04:00
vec Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
alloc.rs Adjust cfgs 2022-08-12 16:28:15 -04:00
borrow.rs Intra-doc-link-ify reference to Clone::clone_from 2022-07-08 22:47:07 +02:00
boxed.rs Do not implement Unpin as const 2022-09-16 11:48:42 +08:00
fmt.rs remove useless cold 2022-05-29 20:40:56 +01:00
lib.rs Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc 2022-09-25 01:20:11 +00:00
macros.rs Extra documentation for new formatting feature 2022-08-21 15:28:27 -04:00
raw_vec.rs Make ZST checks in core/alloc more readable 2022-09-22 23:12:29 -07:00
rc.rs Fix a typo in docstring 2022-09-17 13:58:53 +09:00
slice.rs Auto merge of #102169 - scottmcm:constify-some-conditions, r=thomcc 2022-09-25 01:20:11 +00:00
str.rs Rollup merge of #93162 - camsteffen:std-prim-docs, r=Mark-Simulacrum 2022-08-22 11:45:40 +05:30
string.rs Auto merge of #99917 - yaahc:error-in-core-move, r=thomcc 2022-08-23 19:48:55 +00:00
sync.rs Move error trait into core 2022-08-22 13:28:25 -07:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00