From 1d204fcf1da365878403b6d9725b764cbbb0ecd7 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Tue, 2 Dec 2025 20:10:40 +0100 Subject: [PATCH] Add unsafe to no_mangle incremental tests --- tests/incremental/hashes/function_interfaces.rs | 2 +- tests/incremental/hashes/inherent_impls.rs | 5 +++-- tests/incremental/hashes/statics.rs | 2 +- tests/incremental/hashes/trait_impls.rs | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/incremental/hashes/function_interfaces.rs b/tests/incremental/hashes/function_interfaces.rs index e58ee1a6d4e4..5b03f9ed6c67 100644 --- a/tests/incremental/hashes/function_interfaces.rs +++ b/tests/incremental/hashes/function_interfaces.rs @@ -279,7 +279,7 @@ pub fn no_mangle() {} #[rustc_clean(cfg = "cfail3")] #[rustc_clean(cfg = "cfail5")] #[rustc_clean(cfg = "cfail6")] -#[no_mangle] +#[unsafe(no_mangle)] pub fn no_mangle() {} // Linkage --------------------------------------------------------------------- diff --git a/tests/incremental/hashes/inherent_impls.rs b/tests/incremental/hashes/inherent_impls.rs index ebcab178f209..75c0939fbfcd 100644 --- a/tests/incremental/hashes/inherent_impls.rs +++ b/tests/incremental/hashes/inherent_impls.rs @@ -5,6 +5,7 @@ // and make sure that the hash has changed, then change nothing between rev2 and // rev3 and make sure that the hash has not changed. +//@ edition: 2024 //@ build-pass (FIXME(62277): could be check-pass?) //@ revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6 //@ compile-flags: -Z query-dep-graph -O @@ -649,7 +650,7 @@ impl Foo { //-------------------------- //-------------------------- //-------------------------- - //---------- + //------------------ pub fn add_no_mangle_to_method(&self) { } } @@ -663,7 +664,7 @@ impl Foo { #[rustc_clean(cfg="cfail3")] #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] - #[no_mangle] + #[unsafe(no_mangle)] pub fn add_no_mangle_to_method(&self) { } } diff --git a/tests/incremental/hashes/statics.rs b/tests/incremental/hashes/statics.rs index cd394ed866e9..94548eeef7fd 100644 --- a/tests/incremental/hashes/statics.rs +++ b/tests/incremental/hashes/statics.rs @@ -66,7 +66,7 @@ #[rustc_clean(cfg="cfail3")] #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] -#[no_mangle] +#[unsafe(no_mangle)] static STATIC_NO_MANGLE: u8 = 0; diff --git a/tests/incremental/hashes/trait_impls.rs b/tests/incremental/hashes/trait_impls.rs index 03ca672af131..d4ac69a8b55d 100644 --- a/tests/incremental/hashes/trait_impls.rs +++ b/tests/incremental/hashes/trait_impls.rs @@ -569,7 +569,7 @@ impl AddNoMangleToMethod for Foo { // ------------------------- // ------------------------- // ------------------------- - // --------- + // ----------------- fn add_no_mangle_to_method(&self) { } } @@ -583,7 +583,7 @@ impl AddNoMangleToMethod for Foo { #[rustc_clean(cfg="cfail3")] #[rustc_clean(cfg="cfail5")] #[rustc_clean(cfg="cfail6")] - #[no_mangle] + #[unsafe(no_mangle)] fn add_no_mangle_to_method(&self) { } }