diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-07 08:59:43 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-11-08 09:16:00 +0100 |
| commit | e3010e84dbf2e06424c91c5a3d4206c1911813bd (patch) | |
| tree | e79c95932b5c88f5313d5eb5e45b3c3c41ed7b9f /tests/ui/structs-enums | |
| parent | 78bb5ee79e0261e8e47476b631da02acc1cb03ef (diff) | |
| download | rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.tar.gz rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.zip | |
remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead
Diffstat (limited to 'tests/ui/structs-enums')
| -rw-r--r-- | tests/ui/structs-enums/rec-align-u32.rs | 15 | ||||
| -rw-r--r-- | tests/ui/structs-enums/rec-align-u64.rs | 15 |
2 files changed, 8 insertions, 22 deletions
diff --git a/tests/ui/structs-enums/rec-align-u32.rs b/tests/ui/structs-enums/rec-align-u32.rs index 9cd2a988871..44879189739 100644 --- a/tests/ui/structs-enums/rec-align-u32.rs +++ b/tests/ui/structs-enums/rec-align-u32.rs @@ -3,17 +3,10 @@ #![allow(unused_unsafe)] // Issue #2303 -#![feature(intrinsics, rustc_attrs)] +#![feature(core_intrinsics, rustc_attrs)] use std::mem; - -mod rusti { - extern "rust-intrinsic" { - pub fn pref_align_of<T>() -> usize; - #[rustc_safe_intrinsic] - pub fn min_align_of<T>() -> usize; - } -} +use std::intrinsics; // This is the type with the questionable alignment #[derive(Debug)] @@ -41,12 +34,12 @@ pub fn main() { // Send it through the shape code let y = format!("{:?}", x); - println!("align inner = {:?}", rusti::min_align_of::<Inner>()); + println!("align inner = {:?}", intrinsics::min_align_of::<Inner>()); println!("size outer = {:?}", mem::size_of::<Outer>()); println!("y = {:?}", y); // per clang/gcc the alignment of `inner` is 4 on x86. - assert_eq!(rusti::min_align_of::<Inner>(), m::align()); + assert_eq!(intrinsics::min_align_of::<Inner>(), m::align()); // per clang/gcc the size of `outer` should be 12 // because `inner`s alignment was 4. diff --git a/tests/ui/structs-enums/rec-align-u64.rs b/tests/ui/structs-enums/rec-align-u64.rs index 313ce6d578d..8b501ea5509 100644 --- a/tests/ui/structs-enums/rec-align-u64.rs +++ b/tests/ui/structs-enums/rec-align-u64.rs @@ -4,17 +4,10 @@ // Issue #2303 -#![feature(intrinsics, rustc_attrs)] +#![feature(core_intrinsics, rustc_attrs)] use std::mem; - -mod rusti { - extern "rust-intrinsic" { - pub fn pref_align_of<T>() -> usize; - #[rustc_safe_intrinsic] - pub fn min_align_of<T>() -> usize; - } -} +use std::intrinsics; // This is the type with the questionable alignment #[derive(Debug)] @@ -90,12 +83,12 @@ pub fn main() { let y = format!("{:?}", x); - println!("align inner = {:?}", rusti::min_align_of::<Inner>()); + println!("align inner = {:?}", intrinsics::min_align_of::<Inner>()); println!("size outer = {:?}", mem::size_of::<Outer>()); println!("y = {:?}", y); // per clang/gcc the alignment of `Inner` is 4 on x86. - assert_eq!(rusti::min_align_of::<Inner>(), m::m::align()); + assert_eq!(intrinsics::min_align_of::<Inner>(), m::m::align()); // per clang/gcc the size of `Outer` should be 12 // because `Inner`s alignment was 4. |
