aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / syn / tests / test_size.rs
| 1 | // Assumes proc-macro2's "span-locations" feature is off. |
| 2 | |
| 3 | use std::mem; |
| 4 | use syn::{Expr, Item, Lit, Pat, Type}; |
| 5 | |
| 6 | #[rustversion::attr(before(2022-11-24), ignore = "requires nightly-2022-11-24 or newer")] |
| 7 | #[rustversion::attr( |
| 8 | since(2022-11-24), |
| 9 | cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit") |
| 10 | )] |
| 11 | #[test] |
| 12 | fn test_expr_size() { |
| 13 | assert_eq!(mem::size_of::<Expr>(), 168); |
| 14 | } |
| 15 | |
| 16 | #[rustversion::attr(before(2022-09-09), ignore = "requires nightly-2022-09-09 or newer")] |
| 17 | #[rustversion::attr( |
| 18 | since(2022-09-09), |
| 19 | cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit") |
| 20 | )] |
| 21 | #[test] |
| 22 | fn test_item_size() { |
| 23 | assert_eq!(mem::size_of::<Item>(), 360); |
| 24 | } |
| 25 | |
| 26 | #[rustversion::attr(before(2023-04-29), ignore = "requires nightly-2023-04-29 or newer")] |
| 27 | #[rustversion::attr( |
| 28 | since(2023-04-29), |
| 29 | cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit") |
| 30 | )] |
| 31 | #[test] |
| 32 | fn test_type_size() { |
| 33 | assert_eq!(mem::size_of::<Type>(), 248); |
| 34 | } |
| 35 | |
| 36 | #[rustversion::attr(before(2023-04-29), ignore = "requires nightly-2023-04-29 or newer")] |
| 37 | #[rustversion::attr( |
| 38 | since(2023-04-29), |
| 39 | cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit") |
| 40 | )] |
| 41 | #[test] |
| 42 | fn test_pat_size() { |
| 43 | assert_eq!(mem::size_of::<Pat>(), 184); |
| 44 | } |
| 45 | |
| 46 | #[rustversion::attr(before(2023-12-20), ignore = "requires nightly-2023-12-20 or newer")] |
| 47 | #[rustversion::attr( |
| 48 | since(2023-12-20), |
| 49 | cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit") |
| 50 | )] |
| 51 | #[test] |
| 52 | fn test_lit_size() { |
| 53 | assert_eq!(mem::size_of::<Lit>(), 24); |
| 54 | } |