From 58ef10493f3227eab7b12dc84dd5e50db0dff051 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Fri, 2 Oct 2026 19:36:39 -0400 Subject: [PATCH 01/16] Distinguish `repr(C)` ZSTs from others in ABI computation Co-Authored-By: Ralf Jung --- compiler/rustc_abi/src/layout.rs | 13 ++ compiler/rustc_abi/src/layout/coroutine.rs | 1 + compiler/rustc_abi/src/layout/simple.rs | 6 + compiler/rustc_abi/src/lib.rs | 13 ++ compiler/rustc_target/src/callconv/powerpc.rs | 2 +- compiler/rustc_target/src/callconv/s390x.rs | 2 +- compiler/rustc_target/src/callconv/sparc64.rs | 2 +- .../rustc_target/src/callconv/x86_win64.rs | 26 ++-- tests/codegen-llvm/abi-win64-zst.rs | 124 ++++++++++++++++-- tests/ui/abi/c-zst.aarch64-darwin.stderr | 2 + tests/ui/abi/c-zst.powerpc-linux.stderr | 16 +-- tests/ui/abi/c-zst.s390x-linux.stderr | 16 +-- tests/ui/abi/c-zst.sparc-linux.stderr | 2 + tests/ui/abi/c-zst.sparc-none.stderr | 2 + tests/ui/abi/c-zst.sparc64-linux.stderr | 16 +-- tests/ui/abi/c-zst.x86_64-linux.stderr | 2 + .../ui/abi/c-zst.x86_64-pc-windows-gnu.stderr | 16 +-- tests/ui/abi/debug.generic.stderr | 24 ++++ tests/ui/abi/debug.loongarch64.stderr | 24 ++++ tests/ui/abi/debug.riscv64.stderr | 24 ++++ .../x86-64-sysv64-arg-ext.other.stderr | 12 ++ tests/ui/abi/pass-indirectly-attr.stderr | 4 + tests/ui/abi/sysv64-zst.stderr | 2 + .../rustc_dump_layout_debug.stderr | 1 + .../pass-by-value-abi.aarch64.stderr | 2 + .../c-variadic/pass-by-value-abi.win.stderr | 2 + .../pass-by-value-abi.x86_64.stderr | 6 + .../enum-discriminant/wrapping_niche.stderr | 2 + tests/ui/layout/debug.stderr | 16 +++ tests/ui/layout/hexagon-enum.stderr | 5 + ...-scalarpair-payload-might-be-uninit.stderr | 5 + .../issue-96185-overaligned-enum.stderr | 2 + tests/ui/layout/thumb-enum.stderr | 5 + .../layout/zero-sized-array-enum-niche.stderr | 4 + ...-variants.aarch64-unknown-linux-gnu.stderr | 3 + ...-c-dead-variants.armebv7r-none-eabi.stderr | 3 + ...-dead-variants.i686-pc-windows-msvc.stderr | 3 + ...d-variants.x86_64-unknown-linux-gnu.stderr | 3 + tests/ui/repr/repr-c-int-dead-variants.stderr | 3 + tests/ui/type/pattern_types/non_null.stderr | 3 + .../ui/type/pattern_types/or_patterns.stderr | 2 + .../type/pattern_types/range_patterns.stderr | 7 + 42 files changed, 348 insertions(+), 80 deletions(-) diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index fa03fb87d02d1..f2e3f8431c105 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -198,6 +198,7 @@ impl LayoutCalculator { size, max_repr_align: None, unadjusted_abi_align: element.align.abi, + repr_c: element.repr_c, randomization_seed: element.randomization_seed.wrapping_add(Hash64::new(count)), }) } @@ -501,6 +502,10 @@ impl LayoutCalculator { return Err(LayoutCalculatorError::EmptyUnion); }; + // We also need to check for a `repr(transparent)` wrapper around `repr(C)` + let repr_c = + repr.c() || (repr.transparent() && only_variant.iter().any(|field| field.repr_c)); + let combined_seed = only_variant .iter() .map(|v| v.randomization_seed) @@ -516,6 +521,7 @@ impl LayoutCalculator { size: size.align_to(align), max_repr_align, unadjusted_abi_align, + repr_c, randomization_seed: combined_seed, }) } @@ -747,6 +753,7 @@ impl LayoutCalculator { align: AbiAlign::new(align), max_repr_align, unadjusted_abi_align, + repr_c: repr.c(), randomization_seed: combined_seed, }; @@ -1055,6 +1062,7 @@ impl LayoutCalculator { size, max_repr_align, unadjusted_abi_align, + repr_c: repr.c(), randomization_seed: combined_seed, }; @@ -1409,6 +1417,9 @@ impl LayoutCalculator { unadjusted_abi_align }; + // We also need to check for a `repr(transparent)` wrapper around `repr(C)` + let repr_c = repr.c() || (repr.transparent() && fields.iter().any(|field| field.repr_c)); + let seed = field_seed.wrapping_add(repr.field_shuffle_seed); Ok(LayoutData { @@ -1421,6 +1432,7 @@ impl LayoutCalculator { size, max_repr_align, unadjusted_abi_align, + repr_c, randomization_seed: seed, }) } @@ -1519,6 +1531,7 @@ where align: AbiAlign::new(align), max_repr_align: None, unadjusted_abi_align: elt.align.abi, + repr_c: false, randomization_seed: elt.randomization_seed.wrapping_add(Hash64::new(count.as_u64())), }) } diff --git a/compiler/rustc_abi/src/layout/coroutine.rs b/compiler/rustc_abi/src/layout/coroutine.rs index c102fbb3e843c..66119ac2f0b5a 100644 --- a/compiler/rustc_abi/src/layout/coroutine.rs +++ b/compiler/rustc_abi/src/layout/coroutine.rs @@ -313,6 +313,7 @@ where align, max_repr_align: None, unadjusted_abi_align: align.abi, + repr_c: false, randomization_seed: Default::default(), }) } diff --git a/compiler/rustc_abi/src/layout/simple.rs b/compiler/rustc_abi/src/layout/simple.rs index 1fffb84ec21cb..da7260fe6160e 100644 --- a/compiler/rustc_abi/src/layout/simple.rs +++ b/compiler/rustc_abi/src/layout/simple.rs @@ -25,6 +25,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: dl.i8_align, + repr_c: false, randomization_seed: Hash64::new(0), } } @@ -42,6 +43,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: dl.i8_align, + repr_c: false, randomization_seed: Hash64::ZERO, } } @@ -84,6 +86,7 @@ impl LayoutData { align, max_repr_align: None, unadjusted_abi_align: align.abi, + repr_c: false, randomization_seed: Hash64::new(randomization_seed), } } @@ -117,6 +120,7 @@ impl LayoutData { size, max_repr_align: None, unadjusted_abi_align: align, + repr_c: false, randomization_seed: Hash64::new(combined_seed), } } @@ -143,6 +147,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: dl.i8_align, + repr_c: false, // Variant layouts never flow back into actual layout computations, // so dummy values are fine here. randomization_seed: Hash64::ZERO, @@ -169,6 +174,7 @@ impl LayoutData { align: parent.align, max_repr_align: parent.max_repr_align, unadjusted_abi_align: parent.unadjusted_abi_align, + repr_c: parent.repr_c, // Variant layouts never flow back into actual layout computations, // so dummy values are fine here. randomization_seed: Hash64::ZERO, diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 3804f4281a9bb..2ad042375bd13 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -2254,6 +2254,11 @@ pub struct LayoutData { /// alignment in some cases. pub unadjusted_abi_align: Align, + /// Whether this type is `repr(C)`, or a`repr(transparent)` wrapper around such. + /// Some C ABIs pass `repr(C)` ZSTs by pointer, but `repr(Rust)` ZSTs should always + /// be ignored. + pub repr_c: bool, + /// The randomization seed based on this type's own repr and its fields. /// /// Since randomization is toggled on a per-crate basis even crates that do not have randomization @@ -2293,6 +2298,12 @@ impl LayoutData { } } } + + /// Returns `true` if this is a `repr(C)` type, + /// or an array of such, or a `repr(transparent)` wrapper around such + pub fn is_repr_c(&self) -> bool { + self.repr_c + } } impl fmt::Debug for LayoutData @@ -2314,6 +2325,7 @@ where variants, max_repr_align, unadjusted_abi_align, + repr_c, randomization_seed, } = self; f.debug_struct("Layout") @@ -2326,6 +2338,7 @@ where .field("variants", variants) .field("max_repr_align", max_repr_align) .field("unadjusted_abi_align", unadjusted_abi_align) + .field("repr_c", repr_c) .field("randomization_seed", randomization_seed) .finish() } diff --git a/compiler/rustc_target/src/callconv/powerpc.rs b/compiler/rustc_target/src/callconv/powerpc.rs index 2b6a104e1221d..1748cbf24c28d 100644 --- a/compiler/rustc_target/src/callconv/powerpc.rs +++ b/compiler/rustc_target/src/callconv/powerpc.rs @@ -19,7 +19,7 @@ where // powerpc-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs. if cx.target_spec().os == Os::Linux && matches!(cx.target_spec().env, Env::Gnu | Env::Musl | Env::Uclibc) - && arg.layout.is_zst() + && arg.layout.is_repr_c() { arg.make_indirect_from_ignore(); } diff --git a/compiler/rustc_target/src/callconv/s390x.rs b/compiler/rustc_target/src/callconv/s390x.rs index 0d29bc658b56d..00589b8febc84 100644 --- a/compiler/rustc_target/src/callconv/s390x.rs +++ b/compiler/rustc_target/src/callconv/s390x.rs @@ -64,7 +64,7 @@ where // s390x-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs. if cx.target_spec().os == Os::Linux && matches!(cx.target_spec().env, Env::Gnu | Env::Musl | Env::Uclibc) - && arg.layout.is_zst() + && arg.layout.is_repr_c() { arg.make_indirect_from_ignore(); } diff --git a/compiler/rustc_target/src/callconv/sparc64.rs b/compiler/rustc_target/src/callconv/sparc64.rs index abef388ef2e12..baff100b4f8f1 100644 --- a/compiler/rustc_target/src/callconv/sparc64.rs +++ b/compiler/rustc_target/src/callconv/sparc64.rs @@ -219,7 +219,7 @@ where continue; } if arg.is_ignore() { - if passes_zsts && arg.layout.is_zst() { + if passes_zsts && arg.layout.is_repr_c() { arg.make_indirect_from_ignore(); double_word_count += 1; } diff --git a/compiler/rustc_target/src/callconv/x86_win64.rs b/compiler/rustc_target/src/callconv/x86_win64.rs index 8e6f50bc9e5c4..01352f09e71b4 100644 --- a/compiler/rustc_target/src/callconv/x86_win64.rs +++ b/compiler/rustc_target/src/callconv/x86_win64.rs @@ -44,18 +44,25 @@ where } }; - if !fn_abi.ret.is_ignore() { + // Windows ABIs do not talk about ZST since such types do not exist in MSVC. + // However, clang and gcc allow ZST in their windows-gnu targets, and pass them by pointer indirection. + // We follow that for `repr(C)` ZSTs (and `repr(transparent)` wrappers around them), + // but `repr(Rust)` ones are always ignored (ensuring that `()` matches C `void`). + + if fn_abi.ret.is_ignore() { + if fn_abi.ret.layout.is_repr_c() { + fn_abi.ret.make_indirect_from_ignore(); + } + } else { fixup(&mut fn_abi.ret, true); } for arg in fn_abi.args.iter_mut() { - if arg.is_ignore() && arg.layout.is_zst() { - // Windows ABIs do not talk about ZST since such types do not exist in MSVC. - // In that sense we can do whatever we want here, and maybe we should throw an error - // (but of course that would be a massive breaking change now). - // We try to match clang and gcc (which allow ZST is their windows-gnu targets), so we - // pass ZST via pointer indirection. - arg.make_indirect_from_ignore(); + if arg.is_ignore() { + if arg.layout.is_repr_c() { + arg.make_indirect_from_ignore(); + } + continue; } if arg.layout.pass_indirectly_in_non_rustic_abis(cx) { @@ -64,7 +71,4 @@ where } fixup(arg, false); } - // FIXME: We should likely also do something about ZST return types, similar to above. - // However, that's non-trivial due to `()`. - // See . } diff --git a/tests/codegen-llvm/abi-win64-zst.rs b/tests/codegen-llvm/abi-win64-zst.rs index e855b60ca4d26..bcb275a78bb82 100644 --- a/tests/codegen-llvm/abi-win64-zst.rs +++ b/tests/codegen-llvm/abi-win64-zst.rs @@ -21,33 +21,129 @@ extern crate minicore; use minicore::*; -// Make sure the argument is always passed when explicitly requesting a Windows ABI. +#[repr(C)] +struct CMaybeZst; + +#[repr(transparent)] +struct CMaybeZst2((), CMaybeZst, ()); + +// Make sure the argument is always passed when explicitly requesting a Windows ABI, +// and it is `repr(C)` - but not if it is `repr(Rust)`. // Our goal here is to match clang: . -// CHECK: define win64cc void @pass_zst_win64(ptr {{[^,]*}}) +// CHECK: define win64cc void @pass_rust_zst_win64() +#[no_mangle] +extern "win64" fn pass_rust_zst_win64(_: ()) {} + +// CHECK: define win64cc void @pass_c_maybezst_win64(ptr {{[^,]*}}) +#[no_mangle] +extern "win64" fn pass_c_maybezst_win64(_: CMaybeZst) {} + +// CHECK: define win64cc void @pass_c_maybezst_2_win64(ptr {{[^,]*}}) +#[no_mangle] +extern "win64" fn pass_c_maybezst_2_win64(_: CMaybeZst2) {} + +// CHECK: define x86_vectorcallcc void @pass_rust_zst_vectorcall() +#[no_mangle] +extern "vectorcall" fn pass_rust_zst_vectorcall(_: ()) {} + +// CHECK: define x86_vectorcallcc void @pass_c_maybezst_vectorcall(ptr {{[^,]*}}) #[no_mangle] -extern "win64" fn pass_zst_win64(_: ()) {} +extern "vectorcall" fn pass_c_maybezst_vectorcall(_: CMaybeZst) {} -// CHECK: define x86_vectorcallcc void @pass_zst_vectorcall(ptr {{[^,]*}}) +// CHECK: define x86_vectorcallcc void @pass_c_maybezst_2_vectorcall(ptr {{[^,]*}}) #[no_mangle] -extern "vectorcall" fn pass_zst_vectorcall(_: ()) {} +extern "vectorcall" fn pass_c_maybezst_2_vectorcall(_: CMaybeZst2) {} -// windows-gnu: define void @pass_zst_fastcall(ptr {{[^,]*}}) -// windows-msvc: define void @pass_zst_fastcall(ptr {{[^,]*}}) +// windows-gnu: define void @pass_rust_zst_fastcall() +// windows-msvc: define void @pass_rust_zst_fastcall() #[no_mangle] #[cfg(windows)] // "fastcall" is not valid on 64bit Linux -extern "fastcall" fn pass_zst_fastcall(_: ()) {} +extern "fastcall" fn pass_rust_zst_fastcall(_: ()) {} + +// windows-gnu: define void @pass_c_maybezst_fastcall(ptr {{[^,]*}}) +// windows-msvc: define void @pass_c_maybezst_fastcall(ptr {{[^,]*}}) +#[no_mangle] +#[cfg(windows)] // "fastcall" is not valid on 64bit Linux +extern "fastcall" fn pass_c_maybezst_fastcall(_: CMaybeZst) {} + +// windows-gnu: define void @pass_c_maybezst_2_fastcall(ptr {{[^,]*}}) +// windows-msvc: define void @pass_c_maybezst_2_fastcall(ptr {{[^,]*}}) +#[no_mangle] +#[cfg(windows)] // "fastcall" is not valid on 64bit Linux +extern "fastcall" fn pass_c_maybezst_2_fastcall(_: CMaybeZst2) {} // The sysv64 ABI ignores ZST. -// CHECK: define x86_64_sysvcc void @pass_zst_sysv64() +// CHECK: define x86_64_sysvcc void @pass_rust_zst_sysv64() +#[no_mangle] +extern "sysv64" fn pass_rust_zst_sysv64(_: ()) {} + +// CHECK: define x86_64_sysvcc void @pass_c_maybezst_sysv64() +#[no_mangle] +extern "sysv64" fn pass_c_maybezst_sysv64(_: CMaybeZst) {} + +// CHECK: define x86_64_sysvcc void @pass_c_maybezst_2_sysv64() #[no_mangle] -extern "sysv64" fn pass_zst_sysv64(_: ()) {} +extern "sysv64" fn pass_c_maybezst_2_sysv64(_: CMaybeZst2) {} // For `extern "C"` functions, ZST are ignored on Linux put passed on Windows. -// linux: define void @pass_zst_c() -// windows-msvc: define void @pass_zst_c(ptr {{[^,]*}}) -// windows-gnu: define void @pass_zst_c(ptr {{[^,]*}}) +// linux: define void @pass_rust_zst_c() +// windows-msvc: define void @pass_rust_zst_c() +// windows-gnu: define void @pass_rust_zst_c() +#[no_mangle] +extern "C" fn pass_rust_zst_c(_: ()) {} + +// linux: define void @pass_c_maybezst_c() +// windows-msvc: define void @pass_c_maybezst_c(ptr {{[^,]*}}) +// windows-gnu: define void @pass_c_maybezst_c(ptr {{[^,]*}}) +#[no_mangle] +extern "C" fn pass_c_maybezst_c(_: CMaybeZst) {} + +// linux: define void @pass_c_maybezst_2_c() +// windows-msvc: define void @pass_c_maybezst_2_c(ptr {{[^,]*}}) +// windows-gnu: define void @pass_c_maybezst_2_c(ptr {{[^,]*}}) +#[no_mangle] +extern "C" fn pass_c_maybezst_2_c(_: CMaybeZst2) {} + +// Now check `repr(C)` return types. +// Again, we seek to match clang: + +// CHECK: define win64cc void @ret_c_maybezst_win64(ptr {{[^,]*}}) +#[no_mangle] +extern "win64" fn ret_c_maybezst_win64() -> CMaybeZst { + CMaybeZst +} + +// CHECK: define x86_vectorcallcc void @ret_c_maybezst_vectorcall(ptr {{[^,]*}}) +#[no_mangle] +extern "vectorcall" fn ret_c_maybezst_vectorcall() -> CMaybeZst { + CMaybeZst +} + +// windows-gnu: define void @ret_c_maybezst_fastcall(ptr {{[^,]*}}) +// windows-msvc: define void @ret_c_maybezst_fastcall(ptr {{[^,]*}}) +#[no_mangle] +#[cfg(windows)] // "fastcall" is not valid on 64bit Linux +extern "fastcall" fn ret_c_maybezst_fastcall() -> CMaybeZst { + CMaybeZst +} + +// The sysv64 ABI ignores ZST. + +// CHECK: define x86_64_sysvcc void @ret_c_maybezst_sysv64() +#[no_mangle] +extern "sysv64" fn ret_c_maybezst_sysv64() -> CMaybeZst { + CMaybeZst +} + +// For `extern "C"` functions, ZST are ignored on Linux but returned via pointer on Windows. + +// linux: define void @ret_c_maybezst_c() +// windows-msvc: define void @ret_c_maybezst_c(ptr {{[^,]*}}) +// windows-gnu: define void @ret_c_maybezst_c(ptr {{[^,]*}}) #[no_mangle] -extern "C" fn pass_zst_c(_: ()) {} +extern "C" fn ret_c_maybezst_c() -> CMaybeZst { + CMaybeZst +} diff --git a/tests/ui/abi/c-zst.aarch64-darwin.stderr b/tests/ui/abi/c-zst.aarch64-darwin.stderr index 2ed9ffdf791f6..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.aarch64-darwin.stderr +++ b/tests/ui/abi/c-zst.aarch64-darwin.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, @@ -50,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.powerpc-linux.stderr b/tests/ui/abi/c-zst.powerpc-linux.stderr index e5cad2199491b..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.powerpc-linux.stderr +++ b/tests/ui/abi/c-zst.powerpc-linux.stderr @@ -22,22 +22,11 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, - mode: Indirect { - attrs: ArgAttributes { - regular: CapturesAddress | NoAlias | NonNull | NoUndef | NoFree, - arg_ext: None, - pointee_size: Size(0 bytes), - pointee_align: Some( - Align(1 bytes), - ), - }, - meta_attrs: None, - address_space: None, - mode: Pointer, - }, + mode: Ignore, }, ], ret: ArgAbi { @@ -62,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.s390x-linux.stderr b/tests/ui/abi/c-zst.s390x-linux.stderr index e5cad2199491b..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.s390x-linux.stderr +++ b/tests/ui/abi/c-zst.s390x-linux.stderr @@ -22,22 +22,11 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, - mode: Indirect { - attrs: ArgAttributes { - regular: CapturesAddress | NoAlias | NonNull | NoUndef | NoFree, - arg_ext: None, - pointee_size: Size(0 bytes), - pointee_align: Some( - Align(1 bytes), - ), - }, - meta_attrs: None, - address_space: None, - mode: Pointer, - }, + mode: Ignore, }, ], ret: ArgAbi { @@ -62,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.sparc-linux.stderr b/tests/ui/abi/c-zst.sparc-linux.stderr index e5cad2199491b..e8587cc5bd1f6 100644 --- a/tests/ui/abi/c-zst.sparc-linux.stderr +++ b/tests/ui/abi/c-zst.sparc-linux.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, @@ -62,6 +63,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.sparc-none.stderr b/tests/ui/abi/c-zst.sparc-none.stderr index e5cad2199491b..e8587cc5bd1f6 100644 --- a/tests/ui/abi/c-zst.sparc-none.stderr +++ b/tests/ui/abi/c-zst.sparc-none.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, @@ -62,6 +63,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.sparc64-linux.stderr b/tests/ui/abi/c-zst.sparc64-linux.stderr index e5cad2199491b..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.sparc64-linux.stderr +++ b/tests/ui/abi/c-zst.sparc64-linux.stderr @@ -22,22 +22,11 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, - mode: Indirect { - attrs: ArgAttributes { - regular: CapturesAddress | NoAlias | NonNull | NoUndef | NoFree, - arg_ext: None, - pointee_size: Size(0 bytes), - pointee_align: Some( - Align(1 bytes), - ), - }, - meta_attrs: None, - address_space: None, - mode: Pointer, - }, + mode: Ignore, }, ], ret: ArgAbi { @@ -62,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.x86_64-linux.stderr b/tests/ui/abi/c-zst.x86_64-linux.stderr index 2ed9ffdf791f6..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.x86_64-linux.stderr +++ b/tests/ui/abi/c-zst.x86_64-linux.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, @@ -50,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr index e5cad2199491b..9241ea32d9693 100644 --- a/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr +++ b/tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr @@ -22,22 +22,11 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, - mode: Indirect { - attrs: ArgAttributes { - regular: CapturesAddress | NoAlias | NonNull | NoUndef | NoFree, - arg_ext: None, - pointee_size: Size(0 bytes), - pointee_align: Some( - Align(1 bytes), - ), - }, - meta_attrs: None, - address_space: None, - mode: Pointer, - }, + mode: Ignore, }, ], ret: ArgAbi { @@ -62,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index 1793674fa462a..f81833d62b588 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -52,6 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -90,6 +91,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -139,6 +141,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -171,6 +174,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -214,6 +218,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -249,6 +254,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -292,6 +298,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -327,6 +334,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -358,6 +366,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -393,6 +402,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -433,6 +443,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -473,6 +484,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -507,6 +519,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -547,6 +560,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -584,6 +598,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -619,6 +634,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -650,6 +666,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -685,6 +702,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -722,6 +740,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -757,6 +776,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -788,6 +808,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -823,6 +844,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -880,6 +902,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -917,6 +940,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/debug.loongarch64.stderr b/tests/ui/abi/debug.loongarch64.stderr index 29ec7846101f1..111e2ab4f54f2 100644 --- a/tests/ui/abi/debug.loongarch64.stderr +++ b/tests/ui/abi/debug.loongarch64.stderr @@ -52,6 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -90,6 +91,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -139,6 +141,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -171,6 +174,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -214,6 +218,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -249,6 +254,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -292,6 +298,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -327,6 +334,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -358,6 +366,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -393,6 +402,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -433,6 +443,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -473,6 +484,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -507,6 +519,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -547,6 +560,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -584,6 +598,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -619,6 +634,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -650,6 +666,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -685,6 +702,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -722,6 +740,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -757,6 +776,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -788,6 +808,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -823,6 +844,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -880,6 +902,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -917,6 +940,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index 29ec7846101f1..111e2ab4f54f2 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -52,6 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -90,6 +91,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -139,6 +141,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -171,6 +174,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -214,6 +218,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -249,6 +254,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -292,6 +298,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -327,6 +334,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -358,6 +366,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -393,6 +402,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -433,6 +443,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -473,6 +484,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -507,6 +519,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -547,6 +560,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -584,6 +598,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -619,6 +634,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -650,6 +666,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -685,6 +702,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -722,6 +740,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -757,6 +776,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -788,6 +808,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -823,6 +844,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -880,6 +902,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, @@ -917,6 +940,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr index cbe389c42d40a..f8e8cbfae6af5 100644 --- a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.other.stderr @@ -19,6 +19,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: 71776123356184577, }, }, @@ -51,6 +52,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: 71776123356184577, }, }, @@ -96,6 +98,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: 71776127651151873, }, }, @@ -128,6 +131,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: 71776127651151873, }, }, @@ -173,6 +177,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 18446462603027808258, }, }, @@ -205,6 +210,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 18446462603027808258, }, }, @@ -250,6 +256,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 18446462607322775554, }, }, @@ -282,6 +289,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 18446462607322775554, }, }, @@ -327,6 +335,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: 18446462603027873795, }, }, @@ -359,6 +368,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: 18446462603027873795, }, }, @@ -404,6 +414,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: 18446462607322841091, }, }, @@ -436,6 +447,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: 18446462607322841091, }, }, diff --git a/tests/ui/abi/pass-indirectly-attr.stderr b/tests/ui/abi/pass-indirectly-attr.stderr index 5821e6279bb85..465b9dc90ae6b 100644 --- a/tests/ui/abi/pass-indirectly-attr.stderr +++ b/tests/ui/abi/pass-indirectly-attr.stderr @@ -35,6 +35,7 @@ error: fn_abi_of(extern_c) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -75,6 +76,7 @@ error: fn_abi_of(extern_c) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, @@ -118,6 +120,7 @@ error: fn_abi_of(extern_rust) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -166,6 +169,7 @@ error: fn_abi_of(extern_rust) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/sysv64-zst.stderr b/tests/ui/abi/sysv64-zst.stderr index 82d3793c35328..5fc85190db529 100644 --- a/tests/ui/abi/sysv64-zst.stderr +++ b/tests/ui/abi/sysv64-zst.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, @@ -50,6 +51,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, + repr_c: false, randomization_seed: 0, }, }, diff --git a/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr b/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr index 1918a3696a4e1..a4e7092a8857c 100644 --- a/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr +++ b/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr @@ -16,6 +16,7 @@ error: layout_of(Union) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/rustc_dump_layout_debug.rs:8:1 diff --git a/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr b/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr index c9e77ac941901..750ea469dd15f 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -62,6 +63,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/c-variadic/pass-by-value-abi.win.stderr b/tests/ui/c-variadic/pass-by-value-abi.win.stderr index d5da912a9b89a..8c425d0566509 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.win.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.win.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -57,6 +58,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr b/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr index 04320a5312361..73f53ae0ed735 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.x86_64.stderr @@ -22,6 +22,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -62,6 +63,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, @@ -101,6 +103,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -141,6 +144,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, @@ -182,6 +186,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, }, }, @@ -222,6 +227,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, }, }, diff --git a/tests/ui/enum-discriminant/wrapping_niche.stderr b/tests/ui/enum-discriminant/wrapping_niche.stderr index 603a56770c497..a057c8ee5e177 100644 --- a/tests/ui/enum-discriminant/wrapping_niche.stderr +++ b/tests/ui/enum-discriminant/wrapping_niche.stderr @@ -61,6 +61,7 @@ error: layout_of(UnsignedAroundZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 2648004449468912780, } --> $DIR/wrapping_niche.rs:8:1 @@ -131,6 +132,7 @@ error: layout_of(SignedAroundZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: 10738146848450213996, } --> $DIR/wrapping_niche.rs:17:1 diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index baaffa7c9de42..0618810d223f3 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -81,6 +81,7 @@ error: layout_of(E) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:8:1 @@ -117,6 +118,7 @@ error: layout_of(S) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:11:1 @@ -142,6 +144,7 @@ error: layout_of(U) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:14:1 @@ -216,6 +219,7 @@ error: layout_of(Result) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:17:1 @@ -239,6 +243,7 @@ error: layout_of(i32) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:20:1 @@ -264,6 +269,7 @@ error: layout_of(V) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:27:1 @@ -289,6 +295,7 @@ error: layout_of(W) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:33:1 @@ -314,6 +321,7 @@ error: layout_of(Y) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:39:1 @@ -339,6 +347,7 @@ error: layout_of(P1) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:46:1 @@ -364,6 +373,7 @@ error: layout_of(P2) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:50:1 @@ -389,6 +399,7 @@ error: layout_of(P3) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:58:1 @@ -414,6 +425,7 @@ error: layout_of(P4) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:62:1 @@ -439,6 +451,7 @@ error: layout_of(P5) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:66:1 @@ -464,6 +477,7 @@ error: layout_of(MaybeUninit) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:69:1 @@ -559,6 +573,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:93:1 @@ -633,6 +648,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/debug.rs:96:1 diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index d0d954029b8bf..6a4be0887698f 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -41,6 +41,7 @@ error: layout_of(A) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:19:1 @@ -91,6 +92,7 @@ error: layout_of(B) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:23:1 @@ -141,6 +143,7 @@ error: layout_of(C) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:27:1 @@ -191,6 +194,7 @@ error: layout_of(P) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:31:1 @@ -241,6 +245,7 @@ error: layout_of(T) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:37:1 diff --git a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr index 4e2e66ba53df4..42f407abd5ed2 100644 --- a/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr +++ b/tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr @@ -59,6 +59,7 @@ error: layout_of(MissingPayloadField) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:17:1 @@ -133,6 +134,7 @@ error: layout_of(CommonPayloadField) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:26:1 @@ -207,6 +209,7 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:34:1 @@ -297,6 +300,7 @@ error: layout_of(NicheFirst) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:42:1 @@ -387,6 +391,7 @@ error: layout_of(NicheSecond) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:51:1 diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index 00848642f045f..4cfb601a82292 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -53,6 +53,7 @@ error: layout_of(Aligned1) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96185-overaligned-enum.rs:9:1 @@ -115,6 +116,7 @@ error: layout_of(Aligned2) = Layout { Align(1 bytes), ), unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/issue-96185-overaligned-enum.rs:17:1 diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index 6e010a6bc658f..88e18c72168e6 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -41,6 +41,7 @@ error: layout_of(A) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:19:1 @@ -91,6 +92,7 @@ error: layout_of(B) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:23:1 @@ -141,6 +143,7 @@ error: layout_of(C) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:27:1 @@ -191,6 +194,7 @@ error: layout_of(P) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:31:1 @@ -241,6 +245,7 @@ error: layout_of(T) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:37:1 diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index 9022151911d37..b3b7fc7e0909d 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -65,6 +65,7 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:14:1 @@ -153,6 +154,7 @@ error: layout_of(MultipleAlignments) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:22:1 @@ -227,6 +229,7 @@ error: layout_of(Result<[u32; 0], Packed>>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:38:1 @@ -305,6 +308,7 @@ error: layout_of(Result<[u32; 0], Packed>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:45:1 diff --git a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr index 6bf346df58a49..20b6a373e06d5 100644 --- a/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr @@ -45,6 +45,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:44:1 @@ -119,6 +120,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:51:1 @@ -191,6 +193,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:63:1 diff --git a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr index 512efbb7e579d..9c04825c0dd94 100644 --- a/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr +++ b/tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr @@ -45,6 +45,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:44:1 @@ -119,6 +120,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:51:1 @@ -191,6 +193,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:63:1 diff --git a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr index 6bf346df58a49..20b6a373e06d5 100644 --- a/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr +++ b/tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr @@ -45,6 +45,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:44:1 @@ -119,6 +120,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:51:1 @@ -191,6 +193,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:63:1 diff --git a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr index 6bf346df58a49..20b6a373e06d5 100644 --- a/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr +++ b/tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr @@ -45,6 +45,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:44:1 @@ -119,6 +120,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:51:1 @@ -191,6 +193,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:63:1 diff --git a/tests/ui/repr/repr-c-int-dead-variants.stderr b/tests/ui/repr/repr-c-int-dead-variants.stderr index ed4e41182cc8c..11889120ac3d1 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.stderr +++ b/tests/ui/repr/repr-c-int-dead-variants.stderr @@ -45,6 +45,7 @@ error: layout_of(UnivariantU8) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:15:1 @@ -119,6 +120,7 @@ error: layout_of(TwoVariantsU8) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:22:1 @@ -191,6 +193,7 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), + repr_c: true, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:34:1 diff --git a/tests/ui/type/pattern_types/non_null.stderr b/tests/ui/type/pattern_types/non_null.stderr index d5e5beb6e5e40..cac076dfc56cf 100644 --- a/tests/ui/type/pattern_types/non_null.stderr +++ b/tests/ui/type/pattern_types/non_null.stderr @@ -27,6 +27,7 @@ error: layout_of(pattern_type!(*const T is !null)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/non_null.rs:11:1 @@ -95,6 +96,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/non_null.rs:14:1 @@ -133,6 +135,7 @@ error: layout_of(pattern_type!(*const [u8] is !null)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/non_null.rs:17:1 diff --git a/tests/ui/type/pattern_types/or_patterns.stderr b/tests/ui/type/pattern_types/or_patterns.stderr index 35ae6b384ea75..b29033446abae 100644 --- a/tests/ui/type/pattern_types/or_patterns.stderr +++ b/tests/ui/type/pattern_types/or_patterns.stderr @@ -68,6 +68,7 @@ error: layout_of(pattern_type!(i8 is (i8::MIN..=-1 | 1..))) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/or_patterns.rs:17:1 @@ -104,6 +105,7 @@ error: layout_of(pattern_type!(i8 is (i8::MIN..=-2 | 0..))) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/or_patterns.rs:21:1 diff --git a/tests/ui/type/pattern_types/range_patterns.stderr b/tests/ui/type/pattern_types/range_patterns.stderr index a12d3aeb6b35b..fd5f1ab323546 100644 --- a/tests/ui/type/pattern_types/range_patterns.stderr +++ b/tests/ui/type/pattern_types/range_patterns.stderr @@ -27,6 +27,7 @@ error: layout_of(NonZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:11:1 @@ -63,6 +64,7 @@ error: layout_of(pattern_type!(u32 is 1..)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:13:1 @@ -131,6 +133,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:15:1 @@ -199,6 +202,7 @@ error: layout_of(Option>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:17:1 @@ -235,6 +239,7 @@ error: layout_of(NonZeroU32New) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:19:1 @@ -299,6 +304,7 @@ error: layout_of(pattern_type!(i8 is -10..=10)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:32:1 @@ -335,6 +341,7 @@ error: layout_of(pattern_type!(i8 is i8::MIN..=0)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), + repr_c: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:35:1 From a9b9130e6958ce8b4cff5a0ee6866a699c9171cb Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Sat, 3 Oct 2026 10:20:05 -0400 Subject: [PATCH 02/16] Fix comment --- compiler/rustc_abi/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 2ad042375bd13..7f955023f0403 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -2254,7 +2254,9 @@ pub struct LayoutData { /// alignment in some cases. pub unadjusted_abi_align: Align, - /// Whether this type is `repr(C)`, or a`repr(transparent)` wrapper around such. + /// Whether this type is `repr(C)`, or a`repr(transparent)` wrapper around such, + /// or an array of such. + /// This matters because we must follow the C ABI for these types. /// Some C ABIs pass `repr(C)` ZSTs by pointer, but `repr(Rust)` ZSTs should always /// be ignored. pub repr_c: bool, From 9c51f25bd7c76ba4465c28faf104947722f6298d Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Sat, 3 Oct 2026 10:40:21 -0400 Subject: [PATCH 03/16] fix typo --- compiler/rustc_abi/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 7f955023f0403..36e8f3c07c42f 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -2254,7 +2254,7 @@ pub struct LayoutData { /// alignment in some cases. pub unadjusted_abi_align: Align, - /// Whether this type is `repr(C)`, or a`repr(transparent)` wrapper around such, + /// Whether this type is `repr(C)`, or a `repr(transparent)` wrapper around such, /// or an array of such. /// This matters because we must follow the C ABI for these types. /// Some C ABIs pass `repr(C)` ZSTs by pointer, but `repr(Rust)` ZSTs should always From 9ce47def2fdd2e380cb52a9379acc31e55bf2264 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 6 Oct 2026 11:27:31 +0200 Subject: [PATCH 04/16] explicitly check for fresh vars in canonicalize --- .../rustc_next_trait_solver/src/canonical/canonicalizer.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs index 75c7513758cd0..ea19d36f5d0cf 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs @@ -13,12 +13,17 @@ use thin_vec::ThinVec; use crate::delegate::SolverDelegate; /// Does this have infer/placeholder/param, free regions or ReErased? +// We're explicitly checking for fresh types and consts to trigger an +// assert if they ever leak into the trait solver. They should never +// exist with the new solver. const NEEDS_CANONICAL: TypeFlags = TypeFlags::from_bits( TypeFlags::HAS_INFER.bits() | TypeFlags::HAS_PLACEHOLDER.bits() | TypeFlags::HAS_PARAM.bits() | TypeFlags::HAS_FREE_REGIONS.bits() - | TypeFlags::HAS_RE_ERASED.bits(), + | TypeFlags::HAS_RE_ERASED.bits() + | TypeFlags::HAS_TY_FRESH.bits() + | TypeFlags::HAS_CT_FRESH.bits(), ) .unwrap(); From 7c69454685b76baf318e969ad6a13077292981ec Mon Sep 17 00:00:00 2001 From: Max Dexheimer Date: Tue, 6 Oct 2026 13:40:59 +0200 Subject: [PATCH 05/16] Don't add rustc to env in nix dev shell --- src/tools/nix-dev-shell/x/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tools/nix-dev-shell/x/default.nix b/src/tools/nix-dev-shell/x/default.nix index 915158080e421..db42d57249ede 100644 --- a/src/tools/nix-dev-shell/x/default.nix +++ b/src/tools/nix-dev-shell/x/default.nix @@ -29,13 +29,12 @@ stdenv.mkDerivation (self: { dontUnpack = true; nativeBuildInputs = [ - rustc makeBinaryWrapper ]; env.PYTHON = python3.interpreter; buildPhase = '' - rustc -Copt-level=3 --crate-name x $src --out-dir $unwrapped/bin + ${rustc}/bin/rustc -Copt-level=3 --crate-name x $src --out-dir $unwrapped/bin ''; installPhase = From 381a3bd27b2e56f77f0ab202940fee52b5918395 Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Mon, 5 Oct 2026 23:06:03 -0400 Subject: [PATCH 06/16] Add a test case --- ...packed.non_scalar_field_of_packed.GVN.diff | 19 +++++++++++++ .../mir-opt/gvn_non_scalar_field_of_packed.rs | 28 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff create mode 100644 tests/mir-opt/gvn_non_scalar_field_of_packed.rs diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff new file mode 100644 index 0000000000000..f218154c58a26 --- /dev/null +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff @@ -0,0 +1,19 @@ +- // MIR for `non_scalar_field_of_packed` before GVN ++ // MIR for `non_scalar_field_of_packed` after GVN + + fn non_scalar_field_of_packed() -> (u32, u32) { + let mut _0: (u32, u32); + let mut _1: Outer; + + bb0: { + StorageLive(_1); + _1 = const C; +- _0 = copy ((_1.1: Packed).1: (u32, u32)); ++ _0 = const ConstValue(Indirect { alloc_id: ALLOC0, offset: Size(5 bytes) }: (u32, u32)); + StorageDead(_1); + return; + } + } ++ ++ ALLOC0 (size: 16, align: 4) { .. } + diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.rs b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs new file mode 100644 index 0000000000000..9ccd8e0292bbe --- /dev/null +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs @@ -0,0 +1,28 @@ +//@ test-mir-pass: GVN +//@ compile-flags: -Zdump-mir-exclude-alloc-bytes -Zverbose-internals + +// This is a regression test for https://github.com/rust-lang/rust/issues/163782 + +#![crate_type = "lib"] + +#[repr(C, packed)] +#[derive(Clone, Copy)] +pub struct Packed { + pub a: u8, + pub b: (u32, u32), +} + +#[derive(Clone, Copy)] +pub struct Outer { + pub x: u32, + pub p: Packed, +} + +const C: Outer = Outer { x: 7, p: Packed { a: 1, b: (2, 3) } }; + +// EMIT_MIR gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff +pub fn non_scalar_field_of_packed() -> (u32, u32) { + // CHECK-LABEL: fn non_scalar_field_of_packed( + // CHECK: _0 = const ConstValue(Indirect { alloc_id: {{.*}}, offset: Size(5 bytes) }: (u32, u32)); + C.p.b +} From f5733a766d504a7ef6a51aa22e23477f09b1611d Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Mon, 5 Oct 2026 23:31:27 -0400 Subject: [PATCH 07/16] Fix by checking offset is a multiple of align --- compiler/rustc_mir_transform/src/gvn.rs | 2 ++ ...scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff | 4 ++-- tests/mir-opt/gvn_non_scalar_field_of_packed.rs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index b5fa022a527e5..e1b1f6f9ff68c 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -1950,6 +1950,8 @@ fn op_to_prop_const<'tcx>( // Transmuting a constant is just an offset in the allocation. If the alignment of the // allocation is not enough, fallback to copying into a properly aligned value. && alloc.inner().align >= op.layout.align.abi + // If this is a packed field the offset must also be sufficiently aligned. + && offset.bytes().is_multiple_of(op.layout.align.abi.bytes()) { return Some(ConstValue::Indirect { alloc_id, offset }); } diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff index f218154c58a26..aff552d2a6020 100644 --- a/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff @@ -9,11 +9,11 @@ StorageLive(_1); _1 = const C; - _0 = copy ((_1.1: Packed).1: (u32, u32)); -+ _0 = const ConstValue(Indirect { alloc_id: ALLOC0, offset: Size(5 bytes) }: (u32, u32)); ++ _0 = const ConstValue(Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: (u32, u32)); StorageDead(_1); return; } } + -+ ALLOC0 (size: 16, align: 4) { .. } ++ ALLOC0 (size: 8, align: 4) { .. } diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.rs b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs index 9ccd8e0292bbe..52773f93e834e 100644 --- a/tests/mir-opt/gvn_non_scalar_field_of_packed.rs +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs @@ -23,6 +23,6 @@ const C: Outer = Outer { x: 7, p: Packed { a: 1, b: (2, 3) } }; // EMIT_MIR gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff pub fn non_scalar_field_of_packed() -> (u32, u32) { // CHECK-LABEL: fn non_scalar_field_of_packed( - // CHECK: _0 = const ConstValue(Indirect { alloc_id: {{.*}}, offset: Size(5 bytes) }: (u32, u32)); + // CHECK: _0 = const ConstValue(Indirect { alloc_id: {{.*}}, offset: Size(0 bytes) }: (u32, u32)); C.p.b } From cb35723178749197c3d0dd19e77c53ceda661f07 Mon Sep 17 00:00:00 2001 From: aerooneqq Date: Tue, 6 Oct 2026 18:05:09 +0300 Subject: [PATCH 08/16] Remove `NonOwner` variant from `AstOwner` --- .../src/delegation/resolution.rs | 8 +++---- compiler/rustc_ast_lowering/src/lib.rs | 21 ++++++++++--------- compiler/rustc_middle/src/arena.rs | 4 ++-- compiler/rustc_middle/src/middle/resolve.rs | 2 -- compiler/rustc_middle/src/queries.rs | 12 +++++------ 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/delegation/resolution.rs b/compiler/rustc_ast_lowering/src/delegation/resolution.rs index 7678418c47e56..8e35b05d7e870 100644 --- a/compiler/rustc_ast_lowering/src/delegation/resolution.rs +++ b/compiler/rustc_ast_lowering/src/delegation/resolution.rs @@ -4,7 +4,6 @@ use ast::visit::Visitor; use hir::def::DefKind; use rustc_ast::{self as ast, AssocItemKind, Delegation, DelegationSource, Item, ItemKind, NodeId}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; -use rustc_data_structures::steal::Steal; use rustc_hir as hir; use rustc_middle::middle::resolve::{ self as mid_res, AstOwner, DelegationInherentFnKind, TypeRelativeDelegationRes, @@ -53,9 +52,10 @@ pub(crate) fn resolve_type_relative_delegations( // Also record resolutions for cases when signature is resolved but call path is not. mid_res::DelegationResolution::Partial | mid_res::DelegationResolution::PartialCall(_) => { - let Some(r_and_owner) = ast_index.get(def_id).map(Steal::borrow) else { - unreachable!("ast index must contain delegations"); - }; + let r_and_owner = ast_index[def_id] + .as_ref() + .expect("ast index must contain delegations") + .borrow(); let (r, owner) = &*r_and_owner; diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index b6d1017665ec6..a99db03007b51 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -587,7 +587,7 @@ enum TryBlockScope { fn index_ast<'tcx>( tcx: TyCtxt<'tcx>, (): (), -) -> &'tcx IndexSlice>, AstOwner)>> { +) -> &'tcx IndexSlice>, AstOwner)>>> { // Queries that borrow `resolver_for_lowering`. tcx.ensure_done().output_filenames(()); tcx.ensure_done().early_lint_checks(()); @@ -610,20 +610,19 @@ fn index_ast<'tcx>( let index = indexer.index; let resolver = Arc::new(resolver); return tcx.arena.alloc_index_slice_from_iter::( - index.into_iter().map(|owner| Steal::new((Arc::clone(&resolver), owner))), + index.into_iter().map(|owner| owner.map(|o| Steal::new((Arc::clone(&resolver), o)))), ); struct Indexer<'s, 'hir> { owners: &'s NodeMap>, - index: IndexVec, + index: IndexVec>, next_node_id: NodeId, } impl Indexer<'_, '_> { fn insert(&mut self, id: NodeId, node: AstOwner) { let def_id = self.owners[&id].def_id; - self.index.ensure_contains_elem(def_id, || AstOwner::NonOwner); - self.index[def_id] = node; + self.index.insert(def_id, node); } fn make_dummy( @@ -705,7 +704,7 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { tcx.ensure_done().resolve_type_relative_delegations(()); let ast_index = tcx.index_ast(()); - let resolver_and_node = ast_index.get(def_id).map(Steal::steal); + let resolver_and_node = ast_index.get(def_id); let fallback_to_ancestor = || { // The item did not exist in the AST, it was created while lowering another item. @@ -732,10 +731,13 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { }) }; - let Some((resolver, node)) = resolver_and_node else { + let Some(Some(r_and_node)) = resolver_and_node else { // `ast_index` does not contain all definitions, only up-to the highest // `LocalDefId` which has a non-trivial `AstOwner`. Gracefully handle // other definitions, in particular those nested inside this highest definition. + // OR + // The item existed in the AST, but is not a HIR owner. + // Fetch the correct information from its parent. return fallback_to_ancestor(); }; @@ -750,6 +752,8 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { hir::MaybeOwner::Owner(lctx.curr_owner.into_owner_info(tcx, item)) } + let (resolver, node) = r_and_node.steal(); + let item = match &node { // The item existed in the AST. AstOwner::Crate(c) => with_lctx(tcx, &*resolver, CRATE_NODE_ID, |lctx| { @@ -770,9 +774,6 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { AstOwner::ForeignItem(item) => with_lctx(tcx, &*resolver, item.id, |lctx| { hir::OwnerNode::ForeignItem(lctx.lower_foreign_item(item)) }), - // The item existed in the AST, but is not a HIR owner. - // Fetch the correct information from its parent. - AstOwner::NonOwner => fallback_to_ancestor(), }; tcx.sess.time("drop_ast", || mem::drop(node)); diff --git a/compiler/rustc_middle/src/arena.rs b/compiler/rustc_middle/src/arena.rs index a423b6bdca5b2..d2e6c4bbe2466 100644 --- a/compiler/rustc_middle/src/arena.rs +++ b/compiler/rustc_middle/src/arena.rs @@ -43,10 +43,10 @@ rustc_arena::declare_arena! { rustc_middle::middle::resolve::ResolverAstLowering<'tcx> >, index_ast: - rustc_data_structures::steal::Steal<( + Option>, rustc_middle::middle::resolve::AstOwner - )>, + )>>, crate_alone: rustc_data_structures::steal::Steal, crate_for_resolver: rustc_data_structures::steal::Steal<(rustc_ast::Crate, rustc_ast::AttrVec)>, resolutions: rustc_middle::middle::resolve::ResolverGlobalCtxt, diff --git a/compiler/rustc_middle/src/middle/resolve.rs b/compiler/rustc_middle/src/middle/resolve.rs index bafb45469a56e..013edbf24739a 100644 --- a/compiler/rustc_middle/src/middle/resolve.rs +++ b/compiler/rustc_middle/src/middle/resolve.rs @@ -332,8 +332,6 @@ pub type DocLinkResMap = FxIndexMap<(Symbol, Namespace), Option>>; /// is as good a place as any for it. #[derive(Debug)] pub enum AstOwner { - /// This definition does not correspond to a HIR owner. - NonOwner, Crate(Box), Item(Box), TraitItem(Box), diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index d9d618519446d..d0429df43d1dd 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -206,13 +206,11 @@ rustc_queries! { desc { "getting the resolver for lowering" } } - query index_ast(_: ()) -> &'tcx IndexSlice>, - AstOwner, - )>> { + // There is only a single `ResolverAstLowering` for all owners. + // We want to drop it once the whole HIR has been lowered. + // We rely on reference counting to know when all definitions have been stolen. + // None if the `LocalDefId` is not an owner. + query index_ast(_: ()) -> &'tcx IndexSlice>, AstOwner)>>> { eval_always no_hash desc { "getting the AST for lowering" } From 308801eed57a996f9183fc184e3ad7e2a6fbcb5e Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Tue, 6 Oct 2026 10:56:17 -0700 Subject: [PATCH 09/16] Panic on `StableHash` of a `Path` with `GenericArgs` The `StableHash` implementation for `Path` is used for attributes, which never have generic args. However, nothing *prevents* using `StableHash` for an arbitrary `Path` that might have generic args. Add a check for this and panic. Credit to Nick Nethercote for catching this. --- compiler/rustc_ast/src/ast.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 6a86e9af71826..5ef3941f4ec16 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -124,6 +124,11 @@ impl StableHash for Path { self.segments.len().stable_hash(hcx, hasher); for segment in &self.segments { segment.ident.stable_hash(hcx, hasher); + if segment.args.is_some() { + // This should never happen, because Path::stable_hash is only used for attributes, + // which never have generic args. Check that to make sure, though. + panic!("Paths with generic args should not appear in incremental state"); + } } } } From 3d0abf0d38c084cf4cc8d6a5d60b5d4c00f68bc9 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 6 Oct 2026 15:45:26 -0400 Subject: [PATCH 10/16] Remove needless closure in bootstrap --- src/bootstrap/src/core/builder/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index f8b4ebb5841c7..7adb17d051aa0 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1120,10 +1120,9 @@ impl<'a> Builder<'a> { Subcommand::Run { .. } => (Kind::Run, &paths[..]), Subcommand::Clean { .. } => (Kind::Clean, &paths[..]), Subcommand::Format { .. } => (Kind::Format, &[][..]), - Subcommand::Setup { profile: ref path } => ( - Kind::Setup, - path.as_ref().map_or([].as_slice(), |path| std::slice::from_ref(path)), - ), + Subcommand::Setup { profile: ref path } => { + (Kind::Setup, path.as_ref().map_or([].as_slice(), std::slice::from_ref)) + } Subcommand::Vendor { .. } => (Kind::Vendor, &paths[..]), Subcommand::Perf { .. } => (Kind::Perf, &paths[..]), }; From 879c65ae67d0c608daf5874d32cc7ed2c31eb180 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 28 Aug 2026 20:42:51 +0000 Subject: [PATCH 11/16] Clean up Reference annotations that drifted The Reference warns when a `//@ reference:` annotation points to a rule that isn't in the Reference. Some of these had accumulated. Let's clean them up. --- tests/coverage/attr/impl.cov-map | 12 +++--- tests/coverage/attr/impl.coverage | 1 - tests/coverage/attr/impl.rs | 1 - tests/coverage/attr/module.cov-map | 12 +++--- tests/coverage/attr/module.coverage | 1 - tests/coverage/attr/module.rs | 1 - tests/coverage/attr/nested.cov-map | 8 ++-- tests/coverage/attr/nested.coverage | 1 - tests/coverage/attr/nested.rs | 1 - tests/coverage/attr/off-on-sandwich.cov-map | 12 +++--- tests/coverage/attr/off-on-sandwich.coverage | 1 - tests/coverage/attr/off-on-sandwich.rs | 1 - .../coverage/attr/trait-impl-inherit.cov-map | 4 +- .../coverage/attr/trait-impl-inherit.coverage | 1 - tests/coverage/attr/trait-impl-inherit.rs | 1 - tests/coverage/iffy/no_cov_crate.cov-map | 28 +++++++------- tests/coverage/iffy/no_cov_crate.coverage | 2 - tests/coverage/iffy/no_cov_crate.rs | 2 - tests/ui/asm/invalid-const-operand.rs | 2 +- tests/ui/asm/invalid-sym-operand.rs | 2 +- tests/ui/asm/label-operand.rs | 2 +- tests/ui/asm/non-const.rs | 2 +- tests/ui/asm/noreturn.rs | 2 +- tests/ui/asm/tainting-on-error.rs | 2 +- tests/ui/cfg/cfg-false-use-item.rs | 2 +- tests/ui/cfg/cfgs-on-items.rs | 6 +-- tests/ui/cfg/true-false.rs | 2 +- tests/ui/const-generics/argument_order.rs | 2 +- .../generic_arg_infer/paren_infer.rs | 3 +- tests/ui/coverage-attr/allowed-positions.rs | 1 - .../ui/coverage-attr/allowed-positions.stderr | 36 +++++++++--------- .../ui/coverage-attr/bad-attr-ice.feat.stderr | 2 +- .../coverage-attr/bad-attr-ice.nofeat.stderr | 4 +- tests/ui/coverage-attr/bad-attr-ice.rs | 1 - tests/ui/coverage-attr/bad-syntax.rs | 2 - tests/ui/coverage-attr/bad-syntax.stderr | 26 ++++++------- tests/ui/coverage-attr/name-value.rs | 1 - tests/ui/coverage-attr/name-value.stderr | 38 +++++++++---------- tests/ui/coverage-attr/subword.rs | 1 - tests/ui/coverage-attr/subword.stderr | 8 ++-- tests/ui/coverage-attr/word-only.rs | 1 - tests/ui/coverage-attr/word-only.stderr | 38 +++++++++---------- .../ui/layout/aggregate-lang/struct-align.rs | 1 - .../layout/aggregate-lang/struct-offsets.rs | 1 - tests/ui/layout/aggregate-lang/struct-size.rs | 1 - tests/ui/layout/aggregate-lang/union-align.rs | 1 - .../ui/layout/aggregate-lang/union-offsets.rs | 1 - tests/ui/layout/aggregate-lang/union-size.rs | 1 - ...temporary-lifetime-extension-tuple-ctor.rs | 2 +- tests/ui/macros/macro-shadowing.rs | 1 - tests/ui/macros/macro-shadowing.stderr | 8 ++-- tests/ui/proc-macro/modules-in-input.rs | 2 +- tests/ui/union/union-inherent-method.rs | 2 +- 53 files changed, 135 insertions(+), 162 deletions(-) diff --git a/tests/coverage/attr/impl.cov-map b/tests/coverage/attr/impl.cov-map index 0562c291e6c17..b1dea8fb3da45 100644 --- a/tests/coverage/attr/impl.cov-map +++ b/tests/coverage/attr/impl.cov-map @@ -1,30 +1,30 @@ Function name: ::off_on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 0f, 05, 00, 10, 00, 00, 12, 00, 13] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 0e, 05, 00, 10, 00, 00, 12, 00, 13] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 15, 5) to (start + 0, 16) +- Code(Zero) at (prev + 14, 5) to (start + 0, 16) - Code(Zero) at (prev + 0, 18) to (start + 0, 19) Highest counter ID seen: (none) Function name: ::on_inherit (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 17, 05, 00, 14, 00, 00, 16, 00, 17] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 16, 05, 00, 14, 00, 00, 16, 00, 17] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 23, 5) to (start + 0, 20) +- Code(Zero) at (prev + 22, 5) to (start + 0, 20) - Code(Zero) at (prev + 0, 22) to (start + 0, 23) Highest counter ID seen: (none) Function name: ::on_on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 1a, 05, 00, 0f, 00, 00, 11, 00, 12] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 19, 05, 00, 0f, 00, 00, 11, 00, 12] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 26, 5) to (start + 0, 15) +- Code(Zero) at (prev + 25, 5) to (start + 0, 15) - Code(Zero) at (prev + 0, 17) to (start + 0, 18) Highest counter ID seen: (none) diff --git a/tests/coverage/attr/impl.coverage b/tests/coverage/attr/impl.coverage index 670c1c36a96d6..560429fb5fe5d 100644 --- a/tests/coverage/attr/impl.coverage +++ b/tests/coverage/attr/impl.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks, LL| |// and is inherited by any enclosed functions. diff --git a/tests/coverage/attr/impl.rs b/tests/coverage/attr/impl.rs index c720a4cd6b206..d4d784a3502b9 100644 --- a/tests/coverage/attr/impl.rs +++ b/tests/coverage/attr/impl.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks, // and is inherited by any enclosed functions. diff --git a/tests/coverage/attr/module.cov-map b/tests/coverage/attr/module.cov-map index 88f4915bfe8f7..7464ad022d4c2 100644 --- a/tests/coverage/attr/module.cov-map +++ b/tests/coverage/attr/module.cov-map @@ -1,30 +1,30 @@ Function name: module::off::on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 0d, 05, 00, 0c, 00, 00, 0e, 00, 0f] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 0c, 05, 00, 0c, 00, 00, 0e, 00, 0f] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 13, 5) to (start + 0, 12) +- Code(Zero) at (prev + 12, 5) to (start + 0, 12) - Code(Zero) at (prev + 0, 14) to (start + 0, 15) Highest counter ID seen: (none) Function name: module::on::inherit (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 15, 05, 00, 11, 00, 00, 13, 00, 14] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 14, 05, 00, 11, 00, 00, 13, 00, 14] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 21, 5) to (start + 0, 17) +- Code(Zero) at (prev + 20, 5) to (start + 0, 17) - Code(Zero) at (prev + 0, 19) to (start + 0, 20) Highest counter ID seen: (none) Function name: module::on::on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 18, 05, 00, 0c, 00, 00, 0e, 00, 0f] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 17, 05, 00, 0c, 00, 00, 0e, 00, 0f] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 24, 5) to (start + 0, 12) +- Code(Zero) at (prev + 23, 5) to (start + 0, 12) - Code(Zero) at (prev + 0, 14) to (start + 0, 15) Highest counter ID seen: (none) diff --git a/tests/coverage/attr/module.coverage b/tests/coverage/attr/module.coverage index bba021b9b4766..c1b9f0e35c0b1 100644 --- a/tests/coverage/attr/module.coverage +++ b/tests/coverage/attr/module.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Checks that `#[coverage(..)]` can be applied to modules, and is inherited LL| |// by any enclosed functions. diff --git a/tests/coverage/attr/module.rs b/tests/coverage/attr/module.rs index 1d17ac7d503e4..4bfb1e7729b7d 100644 --- a/tests/coverage/attr/module.rs +++ b/tests/coverage/attr/module.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Checks that `#[coverage(..)]` can be applied to modules, and is inherited // by any enclosed functions. diff --git a/tests/coverage/attr/nested.cov-map b/tests/coverage/attr/nested.cov-map index ae8af35e507de..7afa65a1f3be5 100644 --- a/tests/coverage/attr/nested.cov-map +++ b/tests/coverage/attr/nested.cov-map @@ -1,21 +1,21 @@ Function name: nested::closure_expr -Raw bytes (19): 0x[01, 01, 00, 03, 01, 40, 01, 00, 12, 01, 0b, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 3f, 01, 00, 12, 01, 0b, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 64, 1) to (start + 0, 18) +- Code(Counter(0)) at (prev + 63, 1) to (start + 0, 18) - Code(Counter(0)) at (prev + 11, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: nested::closure_tail -Raw bytes (19): 0x[01, 01, 00, 03, 01, 4f, 01, 00, 12, 01, 11, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 4e, 01, 00, 12, 01, 11, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 79, 1) to (start + 0, 18) +- Code(Counter(0)) at (prev + 78, 1) to (start + 0, 18) - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/attr/nested.coverage b/tests/coverage/attr/nested.coverage index a0bf05a423534..1c5fbcb671e15 100644 --- a/tests/coverage/attr/nested.coverage +++ b/tests/coverage/attr/nested.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute, stmt_expr_attributes)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Demonstrates the interaction between #[coverage(off)] and various kinds of LL| |// nested function. diff --git a/tests/coverage/attr/nested.rs b/tests/coverage/attr/nested.rs index 042fcc5319aee..8213e29b6fcd9 100644 --- a/tests/coverage/attr/nested.rs +++ b/tests/coverage/attr/nested.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute, stmt_expr_attributes)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Demonstrates the interaction between #[coverage(off)] and various kinds of // nested function. diff --git a/tests/coverage/attr/off-on-sandwich.cov-map b/tests/coverage/attr/off-on-sandwich.cov-map index ef31c56fcaa2f..61daef8d15452 100644 --- a/tests/coverage/attr/off-on-sandwich.cov-map +++ b/tests/coverage/attr/off-on-sandwich.cov-map @@ -1,34 +1,34 @@ Function name: off_on_sandwich::dense_a::dense_b -Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 11, 01, 01, 09, 00, 12, 01, 01, 09, 00, 12, 01, 05, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 05, 00, 11, 01, 01, 09, 00, 12, 01, 01, 09, 00, 12, 01, 05, 05, 00, 06] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 15, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) - Code(Counter(0)) at (prev + 5, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c -Raw bytes (24): 0x[01, 01, 00, 04, 01, 22, 09, 00, 16, 01, 01, 0d, 00, 17, 01, 01, 0d, 00, 17, 01, 09, 09, 00, 0a] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 09, 00, 16, 01, 01, 0d, 00, 17, 01, 01, 0d, 00, 17, 01, 09, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 34, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 33, 9) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) - Code(Counter(0)) at (prev + 9, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c::sparse_d -Raw bytes (24): 0x[01, 01, 00, 04, 01, 25, 0d, 00, 1a, 01, 01, 11, 00, 1b, 01, 01, 11, 00, 1b, 01, 05, 0d, 00, 0e] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 24, 0d, 00, 1a, 01, 01, 11, 00, 1b, 01, 01, 11, 00, 1b, 01, 05, 0d, 00, 0e] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 37, 13) to (start + 0, 26) +- Code(Counter(0)) at (prev + 36, 13) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) - Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) - Code(Counter(0)) at (prev + 5, 13) to (start + 0, 14) diff --git a/tests/coverage/attr/off-on-sandwich.coverage b/tests/coverage/attr/off-on-sandwich.coverage index 4fbc388490306..675697906ee76 100644 --- a/tests/coverage/attr/off-on-sandwich.coverage +++ b/tests/coverage/attr/off-on-sandwich.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]` LL| |// in nested functions. diff --git a/tests/coverage/attr/off-on-sandwich.rs b/tests/coverage/attr/off-on-sandwich.rs index 3d914c99b625e..261634e00296a 100644 --- a/tests/coverage/attr/off-on-sandwich.rs +++ b/tests/coverage/attr/off-on-sandwich.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]` // in nested functions. diff --git a/tests/coverage/attr/trait-impl-inherit.cov-map b/tests/coverage/attr/trait-impl-inherit.cov-map index bf10083dd2909..14c65777b170b 100644 --- a/tests/coverage/attr/trait-impl-inherit.cov-map +++ b/tests/coverage/attr/trait-impl-inherit.cov-map @@ -1,10 +1,10 @@ Function name: ::f -Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/trait-impl-inherit.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 16) +- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) diff --git a/tests/coverage/attr/trait-impl-inherit.coverage b/tests/coverage/attr/trait-impl-inherit.coverage index b92d82aefbc8c..a1431ce98340a 100644 --- a/tests/coverage/attr/trait-impl-inherit.coverage +++ b/tests/coverage/attr/trait-impl-inherit.coverage @@ -2,7 +2,6 @@ LL| |// Checks that `#[coverage(..)]` in a trait method is not inherited in an LL| |// implementation. LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.trait-impl-inherit LL| | LL| |trait T { LL| | #[coverage(off)] diff --git a/tests/coverage/attr/trait-impl-inherit.rs b/tests/coverage/attr/trait-impl-inherit.rs index 951fecce90a18..a36f9d0fcbc3d 100644 --- a/tests/coverage/attr/trait-impl-inherit.rs +++ b/tests/coverage/attr/trait-impl-inherit.rs @@ -2,7 +2,6 @@ // Checks that `#[coverage(..)]` in a trait method is not inherited in an // implementation. //@ edition: 2021 -//@ reference: attributes.coverage.trait-impl-inherit trait T { #[coverage(off)] diff --git a/tests/coverage/iffy/no_cov_crate.cov-map b/tests/coverage/iffy/no_cov_crate.cov-map index e447cac4d8da9..235da4a05bba3 100644 --- a/tests/coverage/iffy/no_cov_crate.cov-map +++ b/tests/coverage/iffy/no_cov_crate.cov-map @@ -1,46 +1,46 @@ Function name: no_cov_crate::add_coverage_1 -Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 14, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 20) +- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_2 -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 18, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 26, 1) to (start + 0, 20) +- Code(Counter(0)) at (prev + 24, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_not_called (unused) -Raw bytes (24): 0x[01, 01, 00, 04, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 1d, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Zero) at (prev + 31, 1) to (start + 0, 29) +- Code(Zero) at (prev + 29, 1) to (start + 0, 29) - Code(Zero) at (prev + 1, 5) to (start + 0, 13) - Code(Zero) at (prev + 0, 14) to (start + 0, 38) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: (none) Function name: no_cov_crate::main -Raw bytes (54): 0x[01, 01, 00, 0a, 01, 4f, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 15, 01, 01, 05, 00, 15, 01, 02, 05, 00, 2b, 01, 01, 05, 00, 1f, 01, 01, 05, 00, 2c, 01, 01, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 4d, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 15, 01, 01, 05, 00, 15, 01, 02, 05, 00, 2b, 01, 01, 05, 00, 1f, 01, 01, 05, 00, 2c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 10 -- Code(Counter(0)) at (prev + 79, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 77, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) @@ -53,12 +53,12 @@ Number of file 0 mappings: 10 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer -Raw bytes (29): 0x[01, 01, 00, 05, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 23, 01, 0a, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 31, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 23, 01, 0a, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 51, 5) to (start + 0, 32) +- Code(Counter(0)) at (prev + 49, 5) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 35) @@ -66,12 +66,12 @@ Number of file 0 mappings: 5 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer_both_covered -Raw bytes (29): 0x[01, 01, 00, 05, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 17, 01, 09, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 3f, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 17, 01, 09, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 65, 5) to (start + 0, 45) +- Code(Counter(0)) at (prev + 63, 5) to (start + 0, 45) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 23) @@ -79,13 +79,13 @@ Number of file 0 mappings: 5 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer_both_covered::inner -Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 45, 09, 00, 20, 01, 01, 10, 00, 17, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 2e, 02, 02, 11, 00, 19, 02, 00, 1a, 00, 32, 01, 02, 09, 00, 0a] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 43, 09, 00, 20, 01, 01, 10, 00, 17, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 2e, 02, 02, 11, 00, 19, 02, 00, 1a, 00, 32, 01, 02, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 7 -- Code(Counter(0)) at (prev + 69, 9) to (start + 0, 32) +- Code(Counter(0)) at (prev + 67, 9) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 23) - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) - Code(Counter(1)) at (prev + 0, 26) to (start + 0, 46) diff --git a/tests/coverage/iffy/no_cov_crate.coverage b/tests/coverage/iffy/no_cov_crate.coverage index 70143c0629a35..ff945ca5f6187 100644 --- a/tests/coverage/iffy/no_cov_crate.coverage +++ b/tests/coverage/iffy/no_cov_crate.coverage @@ -1,7 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |// Enables `coverage(off)` on the entire crate - LL| |//@ reference: attributes.coverage.intro - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |#[coverage(off)] LL| |fn do_not_add_coverage_1() { diff --git a/tests/coverage/iffy/no_cov_crate.rs b/tests/coverage/iffy/no_cov_crate.rs index 72fd6317a1707..88b80b9d41037 100644 --- a/tests/coverage/iffy/no_cov_crate.rs +++ b/tests/coverage/iffy/no_cov_crate.rs @@ -1,7 +1,5 @@ #![feature(coverage_attribute)] // Enables `coverage(off)` on the entire crate -//@ reference: attributes.coverage.intro -//@ reference: attributes.coverage.nesting #[coverage(off)] fn do_not_add_coverage_1() { diff --git a/tests/ui/asm/invalid-const-operand.rs b/tests/ui/asm/invalid-const-operand.rs index 083d4f4e18480..a496687011320 100644 --- a/tests/ui/asm/invalid-const-operand.rs +++ b/tests/ui/asm/invalid-const-operand.rs @@ -2,7 +2,7 @@ //@ needs-asm-support //@ ignore-nvptx64 //@ ignore-spirv -//@ reference: asm.operand-type.supported-operands.const +//@ reference: asm.operand-type.supported-operands-const #![feature(asm_const_ptr)] diff --git a/tests/ui/asm/invalid-sym-operand.rs b/tests/ui/asm/invalid-sym-operand.rs index 48df1918daf0f..4340a5c0a86e4 100644 --- a/tests/ui/asm/invalid-sym-operand.rs +++ b/tests/ui/asm/invalid-sym-operand.rs @@ -1,7 +1,7 @@ //@ needs-asm-support //@ ignore-nvptx64 //@ ignore-spirv -//@ reference: asm.operand-type.supported-operands.sym +//@ reference: asm.operand-type.supported-operands-sym use std::arch::{asm, global_asm}; diff --git a/tests/ui/asm/label-operand.rs b/tests/ui/asm/label-operand.rs index f1be5d7d85609..9f5f6e08b22be 100644 --- a/tests/ui/asm/label-operand.rs +++ b/tests/ui/asm/label-operand.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: asm.operand-type.supported-operands.label +//@ reference: asm.operand-type.supported-operands-label //@ revisions: aarch64 arm arm64ec riscv32 riscv64 x86 x86_64 //@ needs-asm-support //@[aarch64] only-aarch64 diff --git a/tests/ui/asm/non-const.rs b/tests/ui/asm/non-const.rs index 2ee4b9c1d70af..f574a8742eea8 100644 --- a/tests/ui/asm/non-const.rs +++ b/tests/ui/asm/non-const.rs @@ -1,5 +1,5 @@ //@ needs-asm-support -//@ reference: asm.operand-type.supported-operands.const +//@ reference: asm.operand-type.supported-operands-const use std::arch::global_asm; diff --git a/tests/ui/asm/noreturn.rs b/tests/ui/asm/noreturn.rs index 59794275d02bd..b93e7f8c12454 100644 --- a/tests/ui/asm/noreturn.rs +++ b/tests/ui/asm/noreturn.rs @@ -1,6 +1,6 @@ //@ needs-asm-support //@ check-pass -//@ reference: asm.options.supported-options.noreturn +//@ reference: asm.options.supported-options-noreturn #![crate_type = "rlib"] diff --git a/tests/ui/asm/tainting-on-error.rs b/tests/ui/asm/tainting-on-error.rs index aa9f33de3753c..30ddde36a651e 100644 --- a/tests/ui/asm/tainting-on-error.rs +++ b/tests/ui/asm/tainting-on-error.rs @@ -1,5 +1,5 @@ //@ needs-asm-support -//@ reference: asm.operand-type.supported-operands.sym +//@ reference: asm.operand-type.supported-operands-sym use std::arch::asm; diff --git a/tests/ui/cfg/cfg-false-use-item.rs b/tests/ui/cfg/cfg-false-use-item.rs index d907e17a0c11d..35b40e3e6a0db 100644 --- a/tests/ui/cfg/cfg-false-use-item.rs +++ b/tests/ui/cfg/cfg-false-use-item.rs @@ -1,8 +1,8 @@ //! Test that use items with cfg(false) are properly filtered out //@ run-pass -//@ reference: cfg.predicate.literal //@ reference: cfg.attr.effect +//@ reference: cfg.predicate-literal pub fn main() { // Make sure that this view item is filtered out because otherwise it would diff --git a/tests/ui/cfg/cfgs-on-items.rs b/tests/ui/cfg/cfgs-on-items.rs index 56f87350fea2c..2a4e16bf75142 100644 --- a/tests/ui/cfg/cfgs-on-items.rs +++ b/tests/ui/cfg/cfgs-on-items.rs @@ -1,8 +1,8 @@ //@ run-pass //@ compile-flags: --cfg fooA --cfg fooB --check-cfg=cfg(fooA,fooB,fooC,bar) -//@ reference: cfg.predicate.all -//@ reference: cfg.predicate.any -//@ reference: cfg.predicate.not +//@ reference: cfg.predicate-all +//@ reference: cfg.predicate-any +//@ reference: cfg.predicate-not // fooA AND !bar #[cfg(all(fooA, not(bar)))] diff --git a/tests/ui/cfg/true-false.rs b/tests/ui/cfg/true-false.rs index b8e0e8968c83e..24f5c35cb90fa 100644 --- a/tests/ui/cfg/true-false.rs +++ b/tests/ui/cfg/true-false.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: cfg.predicate.literal +//@ reference: cfg.predicate-literal #![feature(link_cfg)] diff --git a/tests/ui/const-generics/argument_order.rs b/tests/ui/const-generics/argument_order.rs index f8980c9b54d75..20be10c77cac2 100644 --- a/tests/ui/const-generics/argument_order.rs +++ b/tests/ui/const-generics/argument_order.rs @@ -1,4 +1,4 @@ -//@ reference: items.generics.syntax.decl-order +//@ reference: items.generics.decl-order struct Good { arr: [u8; { N }], diff --git a/tests/ui/const-generics/generic_arg_infer/paren_infer.rs b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs index 869683b705669..1f6158b0559bc 100644 --- a/tests/ui/const-generics/generic_arg_infer/paren_infer.rs +++ b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs @@ -1,5 +1,6 @@ //@ check-pass -//@ reference: items.generics.const.inferred +//@ reference: expr.array.length-restriction +//@ reference: paths.expr.complex-const-params struct Foo; diff --git a/tests/ui/coverage-attr/allowed-positions.rs b/tests/ui/coverage-attr/allowed-positions.rs index cfbc7f5e6c0c7..8168b46a87375 100644 --- a/tests/ui/coverage-attr/allowed-positions.rs +++ b/tests/ui/coverage-attr/allowed-positions.rs @@ -1,6 +1,5 @@ //! Tests where the `#[coverage(..)]` attribute can and cannot be used. -//@ reference: attributes.coverage.allowed-positions #![feature(coverage_attribute)] #![feature(extern_types)] diff --git a/tests/ui/coverage-attr/allowed-positions.stderr b/tests/ui/coverage-attr/allowed-positions.stderr index e3e1e67bf7375..3e585d26e3e40 100644 --- a/tests/ui/coverage-attr/allowed-positions.stderr +++ b/tests/ui/coverage-attr/allowed-positions.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/allowed-positions.rs:106:25 + --> $DIR/allowed-positions.rs:105:25 | LL | let _closure_expr = #[coverage(off)] || (); | ^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | let _closure_expr = #[coverage(off)] || (); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: the `coverage` attribute cannot be used on type aliases - --> $DIR/allowed-positions.rs:14:3 + --> $DIR/allowed-positions.rs:13:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -17,7 +17,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on traits - --> $DIR/allowed-positions.rs:17:3 + --> $DIR/allowed-positions.rs:16:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -25,7 +25,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated consts - --> $DIR/allowed-positions.rs:19:7 + --> $DIR/allowed-positions.rs:18:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -33,7 +33,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:22:7 + --> $DIR/allowed-positions.rs:21:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -41,7 +41,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:25:7 + --> $DIR/allowed-positions.rs:24:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -49,7 +49,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:31:7 + --> $DIR/allowed-positions.rs:30:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -57,7 +57,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:39:7 + --> $DIR/allowed-positions.rs:38:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -65,7 +65,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:56:7 + --> $DIR/allowed-positions.rs:55:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -73,7 +73,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on structs - --> $DIR/allowed-positions.rs:61:3 + --> $DIR/allowed-positions.rs:60:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -81,7 +81,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on struct fields - --> $DIR/allowed-positions.rs:63:7 + --> $DIR/allowed-positions.rs:62:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -89,7 +89,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign statics - --> $DIR/allowed-positions.rs:76:7 + --> $DIR/allowed-positions.rs:75:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -97,7 +97,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign types - --> $DIR/allowed-positions.rs:79:7 + --> $DIR/allowed-positions.rs:78:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -105,7 +105,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign functions - --> $DIR/allowed-positions.rs:82:7 + --> $DIR/allowed-positions.rs:81:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -113,7 +113,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:88:7 + --> $DIR/allowed-positions.rs:87:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -121,7 +121,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:94:7 + --> $DIR/allowed-positions.rs:93:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -129,7 +129,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on match arms - --> $DIR/allowed-positions.rs:110:11 + --> $DIR/allowed-positions.rs:109:11 | LL | #[coverage(off)] | ^^^^^^^^ @@ -137,7 +137,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on expressions - --> $DIR/allowed-positions.rs:114:7 + --> $DIR/allowed-positions.rs:113:7 | LL | #[coverage(off)] | ^^^^^^^^ diff --git a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr index f3b5cbf22282f..71f832c319773 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr index 4b0330fee8ca3..be429beb1824d 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr @@ -1,5 +1,5 @@ error[E0658]: the `coverage` attribute is an experimental feature - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ @@ -9,7 +9,7 @@ LL | #[coverage] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/coverage-attr/bad-attr-ice.rs b/tests/ui/coverage-attr/bad-attr-ice.rs index 2626f47037dbd..3c1d3424f3d9f 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.rs +++ b/tests/ui/coverage-attr/bad-attr-ice.rs @@ -2,7 +2,6 @@ //@ revisions: feat nofeat //@ compile-flags: -Cinstrument-coverage //@ needs-profiler-runtime -//@ reference: attributes.coverage.syntax // Malformed `coverage` attributes should not cause an ICE when built // with `-Cinstrument-coverage`. diff --git a/tests/ui/coverage-attr/bad-syntax.rs b/tests/ui/coverage-attr/bad-syntax.rs index ef7b41db3440e..ea29fd6ae63a3 100644 --- a/tests/ui/coverage-attr/bad-syntax.rs +++ b/tests/ui/coverage-attr/bad-syntax.rs @@ -1,7 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax -//@ reference: attributes.coverage.duplicates // Tests the error messages produced (or not produced) by various unusual // uses of the `#[coverage(..)]` attribute. diff --git a/tests/ui/coverage-attr/bad-syntax.stderr b/tests/ui/coverage-attr/bad-syntax.stderr index ee082951d101b..8269228444262 100644 --- a/tests/ui/coverage-attr/bad-syntax.stderr +++ b/tests/ui/coverage-attr/bad-syntax.stderr @@ -1,29 +1,29 @@ error: multiple `coverage` attributes - --> $DIR/bad-syntax.rs:10:1 + --> $DIR/bad-syntax.rs:8:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/bad-syntax.rs:9:1 + --> $DIR/bad-syntax.rs:7:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ error: multiple `coverage` attributes - --> $DIR/bad-syntax.rs:14:1 + --> $DIR/bad-syntax.rs:12:1 | LL | #[coverage(on)] | ^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/bad-syntax.rs:13:1 + --> $DIR/bad-syntax.rs:11:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:17:3 + --> $DIR/bad-syntax.rs:15:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -36,7 +36,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:20:3 + --> $DIR/bad-syntax.rs:18:3 | LL | #[coverage = true] | ^^^^^^^^^------ @@ -53,7 +53,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:23:3 + --> $DIR/bad-syntax.rs:21:3 | LL | #[coverage()] | ^^^^^^^^-- @@ -68,7 +68,7 @@ LL | #[coverage(on)] | ++ error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:26:3 + --> $DIR/bad-syntax.rs:24:3 | LL | #[coverage(off, off)] | ^^^^^^^^---------- @@ -85,7 +85,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:29:3 + --> $DIR/bad-syntax.rs:27:3 | LL | #[coverage(off, on)] | ^^^^^^^^--------- @@ -102,7 +102,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:32:3 + --> $DIR/bad-syntax.rs:30:3 | LL | #[coverage(bogus)] | ^^^^^^^^^-----^ @@ -119,7 +119,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:35:3 + --> $DIR/bad-syntax.rs:33:3 | LL | #[coverage(bogus, off)] | ^^^^^^^^------------ @@ -136,7 +136,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:38:3 + --> $DIR/bad-syntax.rs:36:3 | LL | #[coverage(off, bogus)] | ^^^^^^^^------------ @@ -153,7 +153,7 @@ LL + #[coverage(on)] | error: expected identifier, found `,` - --> $DIR/bad-syntax.rs:44:12 + --> $DIR/bad-syntax.rs:42:12 | LL | #[coverage(,off)] | ^ expected identifier diff --git a/tests/ui/coverage-attr/name-value.rs b/tests/ui/coverage-attr/name-value.rs index 6e81ab8961672..e2d133f762ac1 100644 --- a/tests/ui/coverage-attr/name-value.rs +++ b/tests/ui/coverage-attr/name-value.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Demonstrates the diagnostics produced when using the syntax // `#[coverage = "off"]`, which should not be allowed. diff --git a/tests/ui/coverage-attr/name-value.stderr b/tests/ui/coverage-attr/name-value.stderr index 7eff78dd80d26..e5cdcf83e0a48 100644 --- a/tests/ui/coverage-attr/name-value.stderr +++ b/tests/ui/coverage-attr/name-value.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:12:3 + --> $DIR/name-value.rs:11:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -16,7 +16,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:17:8 + --> $DIR/name-value.rs:16:8 | LL | #![coverage = "off"] | ^^^^^^^^^------- @@ -33,7 +33,7 @@ LL + #![coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:21:3 + --> $DIR/name-value.rs:20:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -50,7 +50,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on structs - --> $DIR/name-value.rs:21:3 + --> $DIR/name-value.rs:20:3 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -58,7 +58,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:26:3 + --> $DIR/name-value.rs:25:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -75,7 +75,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:29:7 + --> $DIR/name-value.rs:28:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -92,7 +92,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:29:7 + --> $DIR/name-value.rs:28:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -100,7 +100,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:35:3 + --> $DIR/name-value.rs:34:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -117,7 +117,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on traits - --> $DIR/name-value.rs:35:3 + --> $DIR/name-value.rs:34:3 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -125,7 +125,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:39:7 + --> $DIR/name-value.rs:38:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -142,7 +142,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:39:7 + --> $DIR/name-value.rs:38:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -150,7 +150,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:44:7 + --> $DIR/name-value.rs:43:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -167,7 +167,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated types - --> $DIR/name-value.rs:44:7 + --> $DIR/name-value.rs:43:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -175,7 +175,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:50:3 + --> $DIR/name-value.rs:49:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -192,7 +192,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:53:7 + --> $DIR/name-value.rs:52:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -209,7 +209,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:53:7 + --> $DIR/name-value.rs:52:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -217,7 +217,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:58:7 + --> $DIR/name-value.rs:57:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -234,7 +234,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated types - --> $DIR/name-value.rs:58:7 + --> $DIR/name-value.rs:57:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -242,7 +242,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:64:3 + --> $DIR/name-value.rs:63:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- diff --git a/tests/ui/coverage-attr/subword.rs b/tests/ui/coverage-attr/subword.rs index 84a5132ac4ac3..16582240b6908 100644 --- a/tests/ui/coverage-attr/subword.rs +++ b/tests/ui/coverage-attr/subword.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Check that yes/no in `#[coverage(yes)]` and `#[coverage(no)]` must be bare // words, not part of a more complicated substructure. diff --git a/tests/ui/coverage-attr/subword.stderr b/tests/ui/coverage-attr/subword.stderr index 401c1cec958e4..e03c38398b298 100644 --- a/tests/ui/coverage-attr/subword.stderr +++ b/tests/ui/coverage-attr/subword.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:8:3 + --> $DIR/subword.rs:7:3 | LL | #[coverage(yes(milord))] | ^^^^^^^^^-----------^ @@ -16,7 +16,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:11:3 + --> $DIR/subword.rs:10:3 | LL | #[coverage(no(milord))] | ^^^^^^^^^----------^ @@ -33,7 +33,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:14:3 + --> $DIR/subword.rs:13:3 | LL | #[coverage(yes = "milord")] | ^^^^^^^^^--------------^ @@ -50,7 +50,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:17:3 + --> $DIR/subword.rs:16:3 | LL | #[coverage(no = "milord")] | ^^^^^^^^^-------------^ diff --git a/tests/ui/coverage-attr/word-only.rs b/tests/ui/coverage-attr/word-only.rs index e47279f74ca9b..2cdd5f9da7137 100644 --- a/tests/ui/coverage-attr/word-only.rs +++ b/tests/ui/coverage-attr/word-only.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Demonstrates the diagnostics produced when using the syntax `#[coverage]`, // which should not be allowed. diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index 4946cefc51fc2..fdf8506ae30a0 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:12:3 + --> $DIR/word-only.rs:11:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -12,7 +12,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:17:8 + --> $DIR/word-only.rs:16:8 | LL | #![coverage] | ^^^^^^^^ expected this to be a list @@ -25,7 +25,7 @@ LL | #![coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:21:3 + --> $DIR/word-only.rs:20:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -38,7 +38,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on structs - --> $DIR/word-only.rs:21:3 + --> $DIR/word-only.rs:20:3 | LL | #[coverage] | ^^^^^^^^ @@ -46,7 +46,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:26:3 + --> $DIR/word-only.rs:25:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -59,7 +59,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:29:7 + --> $DIR/word-only.rs:28:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -72,7 +72,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:29:7 + --> $DIR/word-only.rs:28:7 | LL | #[coverage] | ^^^^^^^^ @@ -80,7 +80,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:35:3 + --> $DIR/word-only.rs:34:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -93,7 +93,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on traits - --> $DIR/word-only.rs:35:3 + --> $DIR/word-only.rs:34:3 | LL | #[coverage] | ^^^^^^^^ @@ -101,7 +101,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:39:7 + --> $DIR/word-only.rs:38:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -114,7 +114,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:39:7 + --> $DIR/word-only.rs:38:7 | LL | #[coverage] | ^^^^^^^^ @@ -122,7 +122,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:44:7 + --> $DIR/word-only.rs:43:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -135,7 +135,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated types - --> $DIR/word-only.rs:44:7 + --> $DIR/word-only.rs:43:7 | LL | #[coverage] | ^^^^^^^^ @@ -143,7 +143,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:50:3 + --> $DIR/word-only.rs:49:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -156,7 +156,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:53:7 + --> $DIR/word-only.rs:52:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -169,7 +169,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:53:7 + --> $DIR/word-only.rs:52:7 | LL | #[coverage] | ^^^^^^^^ @@ -177,7 +177,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:58:7 + --> $DIR/word-only.rs:57:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -190,7 +190,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated types - --> $DIR/word-only.rs:58:7 + --> $DIR/word-only.rs:57:7 | LL | #[coverage] | ^^^^^^^^ @@ -198,7 +198,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:64:3 + --> $DIR/word-only.rs:63:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/layout/aggregate-lang/struct-align.rs b/tests/ui/layout/aggregate-lang/struct-align.rs index f3b88a6d85d3e..0864bdc6bfce0 100644 --- a/tests/ui/layout/aggregate-lang/struct-align.rs +++ b/tests/ui/layout/aggregate-lang/struct-align.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/struct-offsets.rs b/tests/ui/layout/aggregate-lang/struct-offsets.rs index ca199bdfeb104..894ac67db2d4c 100644 --- a/tests/ui/layout/aggregate-lang/struct-offsets.rs +++ b/tests/ui/layout/aggregate-lang/struct-offsets.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-offsets //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/struct-size.rs b/tests/ui/layout/aggregate-lang/struct-size.rs index f9fb605c32486..43430b85e1bf0 100644 --- a/tests/ui/layout/aggregate-lang/struct-size.rs +++ b/tests/ui/layout/aggregate-lang/struct-size.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[allow(dead_code)] diff --git a/tests/ui/layout/aggregate-lang/union-align.rs b/tests/ui/layout/aggregate-lang/union-align.rs index 03825f1df2137..fd0b33e5f9018 100644 --- a/tests/ui/layout/aggregate-lang/union-align.rs +++ b/tests/ui/layout/aggregate-lang/union-align.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/union-offsets.rs b/tests/ui/layout/aggregate-lang/union-offsets.rs index 29ab0a9ce5490..b9b6b8e357dd8 100644 --- a/tests/ui/layout/aggregate-lang/union-offsets.rs +++ b/tests/ui/layout/aggregate-lang/union-offsets.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-offsets //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/union-size.rs b/tests/ui/layout/aggregate-lang/union-size.rs index 6d1b51b172db1..4189846571bf6 100644 --- a/tests/ui/layout/aggregate-lang/union-size.rs +++ b/tests/ui/layout/aggregate-lang/union-size.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[allow(dead_code)] diff --git a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs index 7de786dff3b77..2427c75f3e00e 100644 --- a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs +++ b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs @@ -1,4 +1,4 @@ -//@ reference: destructors.scope.lifetime-extension.exprs +//@ reference: destructors.scope.lifetime-extension.exprs.extending fn temp() -> String { String::from("Hello") diff --git a/tests/ui/macros/macro-shadowing.rs b/tests/ui/macros/macro-shadowing.rs index 87ed7c8d8fb09..b5d74f09df978 100644 --- a/tests/ui/macros/macro-shadowing.rs +++ b/tests/ui/macros/macro-shadowing.rs @@ -1,5 +1,4 @@ //@ aux-build:two_macros.rs -//@ reference: macro.decl.scope.textual.shadow //@ reference: names.resolution.expansion.macros.ambiguity.more-expanded-vs-outer #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-shadowing.stderr b/tests/ui/macros/macro-shadowing.stderr index 96992aee649a4..2b4de7aacba3f 100644 --- a/tests/ui/macros/macro-shadowing.stderr +++ b/tests/ui/macros/macro-shadowing.stderr @@ -1,5 +1,5 @@ error: `macro_two` is already in scope - --> $DIR/macro-shadowing.rs:14:5 + --> $DIR/macro-shadowing.rs:13:5 | LL | macro_rules! m1 { () => { ... @@ -12,7 +12,7 @@ LL | m1!(); = note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560) error[E0659]: `foo` is ambiguous - --> $DIR/macro-shadowing.rs:19:1 + --> $DIR/macro-shadowing.rs:18:1 | LL | macro_rules! m1 { () => { ... @@ -21,7 +21,7 @@ LL | foo!(); | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `foo` could refer to the macro defined here - --> $DIR/macro-shadowing.rs:12:5 + --> $DIR/macro-shadowing.rs:11:5 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | macro_rules! foo { () => {} } LL | m1!(); | ----- in this macro invocation note: `foo` could also refer to the macro defined here - --> $DIR/macro-shadowing.rs:7:1 + --> $DIR/macro-shadowing.rs:6:1 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/proc-macro/modules-in-input.rs b/tests/ui/proc-macro/modules-in-input.rs index 50b4dc9e40f44..5f14d96b3b51e 100644 --- a/tests/ui/proc-macro/modules-in-input.rs +++ b/tests/ui/proc-macro/modules-in-input.rs @@ -1,6 +1,6 @@ //@ check-pass //@ proc-macro: expect-modules.rs -//@ reference: macro.invocation.attr.mod +//@ reference: macro.proc.attribute.outline-mod // Verifies how module items are represented in proc macro input. diff --git a/tests/ui/union/union-inherent-method.rs b/tests/ui/union/union-inherent-method.rs index 86a62ff18cd3d..b3b0fec8c1f37 100644 --- a/tests/ui/union/union-inherent-method.rs +++ b/tests/ui/union/union-inherent-method.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: items.impl.inherent.associated-items.allowed-items +//@ reference: items.impl.inherent.allowed-items union U { a: u8, From 95811cf083e02206bdb7b5f0e60ecaa012809ab8 Mon Sep 17 00:00:00 2001 From: Jules Bertholet Date: Tue, 6 Oct 2026 16:39:21 -0400 Subject: [PATCH 12/16] Rename a test file --- tests/codegen-llvm/{abi-win64-zst.rs => abi-x86_64-win-zst.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/codegen-llvm/{abi-win64-zst.rs => abi-x86_64-win-zst.rs} (100%) diff --git a/tests/codegen-llvm/abi-win64-zst.rs b/tests/codegen-llvm/abi-x86_64-win-zst.rs similarity index 100% rename from tests/codegen-llvm/abi-win64-zst.rs rename to tests/codegen-llvm/abi-x86_64-win-zst.rs From 9a6d547f7ecfd6cb9482125e6c8a977a34d9c397 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Tue, 6 Oct 2026 19:13:19 -0400 Subject: [PATCH 13/16] Update Enzyme submodule --- src/tools/enzyme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/enzyme b/src/tools/enzyme index fa6e20ebd80f0..ede97b5c7b8d1 160000 --- a/src/tools/enzyme +++ b/src/tools/enzyme @@ -1 +1 @@ -Subproject commit fa6e20ebd80f0e28219abaf174d95baf1513ce92 +Subproject commit ede97b5c7b8d1ddacd5383601798a67aaac2077c From e5ebfd82829fe4ff15d830b9f281e1499e323fd6 Mon Sep 17 00:00:00 2001 From: Jakub Chlanda Date: Fri, 2 Oct 2026 10:16:05 +0000 Subject: [PATCH 14/16] [PAC] Stop hard coding key and discriminator, consult schema instead This fixes the remaining call sites that were still hard coding values for the key and discriminator. Instead, consult the session to get these values through the schema. This follows the same pattern already used by `get_fn_addr`. No new tests were added, as the existing tests cover this change. --- compiler/rustc_codegen_llvm/src/builder.rs | 12 ++++++------ compiler/rustc_codegen_llvm/src/consts.rs | 13 ++++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index dc89414940620..dc52e1605cd80 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -2193,9 +2193,8 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> { llfn: &'ll Value, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, ) -> Option> { - if self.sess().pointer_authentication_functions().is_none() { - return None; - } + let schema = self.sess().pointer_authentication_functions()?; + // Pointer authentication support is currently limited to extern "C" calls; filter out other // ABIs. if fn_abi?.conv != CanonAbi::C { @@ -2213,11 +2212,12 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> { // bundles. // Once this is resolved, we should analyze each call and skip direct calls. See the // discussion in the rust-lang issue: - let key: u32 = 0; - let discriminator: u64 = 0; Some(llvm::OperandBundleBox::new( "ptrauth", - &[self.const_u32(key), self.const_u64(discriminator)], + &[ + self.const_u32(schema.key as u32), + self.const_u64(schema.constant_discriminator as u64), + ], )) } diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index ec58c3cb6ad7a..6513cc0542ea5 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -212,7 +212,7 @@ fn check_and_apply_linkage<'ll, 'tcx>( let fn_sig = sig.with(*header); let fn_abi = cx.fn_abi_of_fn_ptr(fn_sig, ty::List::empty()); // Decide if the initializer needs to be signed - if cx.sess().pointer_authentication() + if cx.sess().pointer_authentication_functions().is_some() && matches!(fn_sig.abi(), ExternAbi::C { .. } | ExternAbi::System { .. }) { should_sign = true; @@ -249,13 +249,16 @@ fn check_and_apply_linkage<'ll, 'tcx>( // Sign the function pointer that is used to initialize the global let initializer = if should_sign { - let key: u32 = 0; - let discriminator: u64 = 0; + let schema = cx + .tcx + .sess + .pointer_authentication_functions() + .expect("pointer authentication functions must be available when signing"); const_ptr_auth( cx.const_bitcast(g1, llty), - key, - discriminator, + schema.key as u32, + schema.constant_discriminator as u64, None, /* address_diversity */ ) } else { From 5040ebcd887e1e9314fafbb427058f003fc58995 Mon Sep 17 00:00:00 2001 From: khyperia <953151+khyperia@users.noreply.github.com> Date: Wed, 7 Oct 2026 09:08:53 +0200 Subject: [PATCH 15/16] abby DSL: implement ambiguity --- compiler/rustc_ast/src/ast.rs | 3 ++ compiler/rustc_ast_lowering/src/item.rs | 3 ++ compiler/rustc_hir/src/hir.rs | 1 + compiler/rustc_hir/src/intravisit.rs | 1 + compiler/rustc_hir_analysis/src/collect.rs | 3 ++ compiler/rustc_parse/src/parser/item.rs | 5 ++ compiler/rustc_span/src/symbol.rs | 1 + .../test-infra-fails-properly.rs | 32 +++++++++++ .../test-infra-fails-properly.stderr | 53 ++++++++++++++++++- 9 files changed, 101 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 6a86e9af71826..00d08147a3eb7 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -4100,6 +4100,9 @@ pub enum TestBinderConstraint { Or { items: ThinVec, }, + Ambiguity { + span: Span, + }, Lifetime { #[visitable(extra = LifetimeCtxt::Bound)] lhs: Lifetime, diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 32229aeea0f9f..53ee437240a30 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -2083,6 +2083,9 @@ impl<'hir> LoweringContext<'_, 'hir> { items.iter().map(|item| self.lower_test_binder_constraint(item)), ), }, + TestBinderConstraint::Ambiguity { span } => { + hir::TestBinderConstraint::Ambiguity { span: self.lower_span(*span) } + } TestBinderConstraint::Lifetime { lhs, rhs } => { let lhs = self.lower_lifetime(lhs, LifetimeSource::Other, lhs.ident.into()); let rhs = self.lower_lifetime(rhs, LifetimeSource::OutlivesBound, rhs.ident.into()); diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 4f4ed83be06a3..ceb7f38c2a416 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -4556,6 +4556,7 @@ pub struct TestBinderExists<'hir> { pub enum TestBinderConstraint<'hir> { And { items: &'hir [TestBinderConstraint<'hir>] }, Or { items: &'hir [TestBinderConstraint<'hir>] }, + Ambiguity { span: Span }, Lifetime { lhs: &'hir Lifetime, rhs: &'hir Lifetime }, PlaceholderOutlives { lhs: &'hir Ty<'hir>, rhs: &'hir Lifetime }, AliasOutlives { bound_type_constraint: &'hir TestBinderBoundTypeConstraint<'hir> }, diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index ad96fe492e6e7..b404d1708b85b 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -1644,6 +1644,7 @@ pub fn walk_test_binder_constraint<'v, V: Visitor<'v>>( TestBinderConstraint::Or { items } => { walk_list!(visitor, visit_test_binder_constraint, *items) } + TestBinderConstraint::Ambiguity { span: _ } => {} TestBinderConstraint::Lifetime { lhs, rhs } => { try_visit!(visitor.visit_lifetime(lhs)); try_visit!(visitor.visit_lifetime(rhs)); diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 1cd1fc356ca7d..51a45eb53aa27 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -448,6 +448,9 @@ impl<'tcx> ItemCtxt<'tcx> { .map(|item| self.lower_test_binder_constraint(item)) .reduce(SolverRegionConstraint::build_or) .unwrap_or(SolverRegionConstraint::new_false()), + rustc_hir::TestBinderConstraint::Ambiguity { span } => { + SolverRegionConstraint::new_ambig(*span) + } hir::TestBinderConstraint::Lifetime { lhs, rhs } => { let span = lhs.ident.span.to(rhs.ident.span); let lhs = self.lowerer().lower_lifetime(lhs, RegionInferReason::RegionPredicate); diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 9fb16bc3fbf27..04041c3110f00 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -2791,6 +2791,11 @@ impl<'a> Parser<'a> { .0; Ok(TestBinderConstraint::Or { items }) } + Some((Ident { name: sym::ambiguity, .. }, IdentKind::Normal)) => { + let span = self.token.span; + self.bump(); + Ok(TestBinderConstraint::Ambiguity { span }) + } _ if self.check_keyword(exp!(For)) => { let bound_type_constraint = self.parse_test_binder_bound_type_constraint()?; Ok(TestBinderConstraint::AliasOutlives { bound_type_constraint }) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index fa59c1c54ee89..dfcc8be029afe 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -427,6 +427,7 @@ symbols! { altivec, alu32, always, + ambiguity, amdgpu, amdgpu_dispatch_ptr, analysis, diff --git a/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs b/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs index 042deefcbb6e5..6e57c780658da 100644 --- a/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs +++ b/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs @@ -74,4 +74,36 @@ core::test_binder_constraints! { } } +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + } expect { + ambiguity + //~^ ERROR forall expect clause failed + } + } +} + +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + //~^ ERROR forall expect clause failed + //~| ERROR unable to satisfy constraints involving placeholders due to unknown implied bounds + ambiguity + } expect { + } + } +} + +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + //~^ ERROR unable to satisfy constraints involving placeholders due to unknown implied bounds + ambiguity + } expect { + ambiguity + } + } +} + fn main() {} diff --git a/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr b/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr index ab025b0e0b9d6..2236a5d95ca89 100644 --- a/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr +++ b/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr @@ -78,6 +78,57 @@ error: bound type test binder constraint must be alias (it's a AliasTyOutlivesVi LL | for<> T: 'a | ^ -error: aborting due to 9 previous errors +error: forall expect clause failed + --> $DIR/test-infra-fails-properly.rs:81:13 + | +LL | ambiguity + | ^^^^^^^^^ + | + = note: expected: And( + [ + Ambiguity( + $DIR/test-infra-fails-properly.rs:81:13: 81:22 (#0), + ), + ], + ) + = note: actual: And( + [], + ) + +error: forall expect clause failed + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + | +note: constraint from here + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + = note: expected: And( + [], + ) + = note: actual: And( + [ + Ambiguity( + $DIR/test-infra-fails-properly.rs:89:9: 89:15 (#0), + ), + ], + ) + +error: unable to satisfy constraints involving placeholders due to unknown implied bounds + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + +error: unable to satisfy constraints involving placeholders due to unknown implied bounds + --> $DIR/test-infra-fails-properly.rs:100:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + +error: aborting due to 13 previous errors For more information about this error, try `rustc --explain E0658`. From 23be578d1e41afc1f604b768dcfcf6cf4d84f9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 7 Oct 2026 10:55:31 +0200 Subject: [PATCH 16/16] Submodule update of rustc-perf --- src/tools/rustc-perf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rustc-perf b/src/tools/rustc-perf index 94df17b4a0fba..208d929efe770 160000 --- a/src/tools/rustc-perf +++ b/src/tools/rustc-perf @@ -1 +1 @@ -Subproject commit 94df17b4a0fbafae5e534b6a754a6a6ee7d51708 +Subproject commit 208d929efe770996eb02cd3d2712623ea48b7646