Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/proc-macro2/tests/test_size.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / proc-macro2 / tests / test_size.rs` 79 lines ยท 3805 bytes Raw Blame History 1 #![allow(unused_attributes)] 2 3 extern crate proc_macro; 4 5 use std::mem; 6 7 #[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] 8 #[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] 9 #[test] 10 fn test_proc_macro_size() { 11 assert_eq!(mem::size_of::(), 4); 12 assert_eq!(mem::size_of::>(), 4); 13 assert_eq!(mem::size_of::(), 20); 14 assert_eq!(mem::size_of::(), 12); 15 assert_eq!(mem::size_of::(), 8); 16 assert_eq!(mem::size_of::(), 16); 17 assert_eq!(mem::size_of::(), 4); 18 } 19 20 #[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] 21 #[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] 22 #[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")] 23 #[cfg_attr(span_locations, ignore = "span locations are on")] 24 #[test] 25 fn test_proc_macro2_fallback_size_without_locations() { 26 assert_eq!(mem::size_of::(), 0); 27 assert_eq!(mem::size_of::>(), 1); 28 assert_eq!(mem::size_of::(), 16); 29 assert_eq!(mem::size_of::(), 24); 30 assert_eq!(mem::size_of::(), 8); 31 assert_eq!(mem::size_of::(), 24); 32 assert_eq!(mem::size_of::(), 8); 33 } 34 35 #[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] 36 #[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] 37 #[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")] 38 #[cfg_attr(not(span_locations), ignore = "span locations are off")] 39 #[test] 40 fn test_proc_macro2_fallback_size_with_locations() { 41 assert_eq!(mem::size_of::(), 8); 42 assert_eq!(mem::size_of::>(), 12); 43 assert_eq!(mem::size_of::(), 24); 44 assert_eq!(mem::size_of::(), 32); 45 assert_eq!(mem::size_of::(), 16); 46 assert_eq!(mem::size_of::(), 32); 47 assert_eq!(mem::size_of::(), 8); 48 } 49 50 #[rustversion::attr(before(1.71), ignore = "requires Rust 1.71+")] 51 #[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] 52 #[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] 53 #[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")] 54 #[cfg_attr(span_locations, ignore = "span locations are on")] 55 #[test] 56 fn test_proc_macro2_wrapper_size_without_locations() { 57 assert_eq!(mem::size_of::(), 4); 58 assert_eq!(mem::size_of::>(), 8); 59 assert_eq!(mem::size_of::(), 24); 60 assert_eq!(mem::size_of::(), 24); 61 assert_eq!(mem::size_of::(), 12); 62 assert_eq!(mem::size_of::(), 24); 63 assert_eq!(mem::size_of::(), 32); 64 } 65 66 #[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] 67 #[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] 68 #[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")] 69 #[cfg_attr(not(span_locations), ignore = "span locations are off")] 70 #[test] 71 fn test_proc_macro2_wrapper_size_with_locations() { 72 assert_eq!(mem::size_of::(), 12); 73 assert_eq!(mem::size_of::>(), 12); 74 assert_eq!(mem::size_of::(), 32); 75 assert_eq!(mem::size_of::(), 32); 76 assert_eq!(mem::size_of::(), 20); 77 assert_eq!(mem::size_of::(), 32); 78 assert_eq!(mem::size_of::(), 32); 79 }