|
1 | | -use std::alloc::GlobalCoAllocMeta; |
2 | 1 | use std::cell::RefCell; |
3 | 2 | use std::default::Default; |
4 | 3 | use std::hash::Hash; |
5 | | -use std::mem; |
6 | 4 | use std::path::PathBuf; |
7 | 5 | use std::rc::Rc; |
8 | 6 | use std::sync::Arc; |
@@ -2399,16 +2397,19 @@ impl SubstParam { |
2399 | 2397 | mod size_asserts { |
2400 | 2398 | use super::*; |
2401 | 2399 | use rustc_data_structures::static_assert_size; |
| 2400 | + #[allow(dead_code)] |
| 2401 | + const GLOBAL_CO_ALLOC_META_SIZE: usize = |
| 2402 | + std::mem::size_of::<<std::alloc::Global as std::alloc::Allocator>::CoAllocMeta>(); |
2402 | 2403 | // tidy-alphabetical-start |
2403 | 2404 | static_assert_size!(Crate, 64); // frequently moved by-value |
2404 | 2405 | static_assert_size!(DocFragment, 32); |
2405 | | - static_assert_size!(GenericArg, 32 + mem::size_of::<GlobalCoAllocMeta>()); |
| 2406 | + static_assert_size!(GenericArg, 32 + GLOBAL_CO_ALLOC_META_SIZE); |
2406 | 2407 | static_assert_size!(GenericArgs, 32); |
2407 | | - static_assert_size!(GenericParamDef, 56 + mem::size_of::<GlobalCoAllocMeta>()); |
| 2408 | + static_assert_size!(GenericParamDef, 56 + GLOBAL_CO_ALLOC_META_SIZE); |
2408 | 2409 | static_assert_size!(Generics, 16); |
2409 | 2410 | static_assert_size!(Item, 56); |
2410 | | - static_assert_size!(ItemKind, 64 + mem::size_of::<GlobalCoAllocMeta>()); |
| 2411 | + static_assert_size!(ItemKind, 64 + GLOBAL_CO_ALLOC_META_SIZE); |
2411 | 2412 | static_assert_size!(PathSegment, 40); |
2412 | | - static_assert_size!(Type, 32 + mem::size_of::<GlobalCoAllocMeta>()); |
| 2413 | + static_assert_size!(Type, 32 + GLOBAL_CO_ALLOC_META_SIZE); |
2413 | 2414 | // tidy-alphabetical-end |
2414 | 2415 | } |
0 commit comments