diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index cf03f434fbce4..10c7b25809815 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -199,7 +199,7 @@ impl LayoutCalculator { size, max_repr_align: None, unadjusted_abi_align: element.align, - repr_c: element.repr_c, + trivial_abi: element.trivial_abi && count_if_sized.is_some(), randomization_seed: element.randomization_seed.wrapping_add(Hash64::new(count)), }) } @@ -511,8 +511,10 @@ impl LayoutCalculator { }; // 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 trivial_abi = size == Size::ZERO + && align == Align::ONE + && !repr.c() + && (!repr.transparent() || only_variant.iter().all(|field| field.trivial_abi)); let combined_seed = only_variant .iter() @@ -529,7 +531,7 @@ impl LayoutCalculator { size: size.align_to(align), max_repr_align, unadjusted_abi_align, - repr_c, + trivial_abi, randomization_seed: combined_seed, }) } @@ -916,7 +918,11 @@ impl LayoutCalculator { }; // 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 trivial_abi = sized + && size == Size::ZERO + && align == Align::ONE + && !repr.c() + && (!repr.transparent() || fields.iter().all(|field| field.trivial_abi)); let seed = field_seed.wrapping_add(repr.field_shuffle_seed); @@ -930,7 +936,7 @@ impl LayoutCalculator { size, max_repr_align, unadjusted_abi_align, - repr_c, + trivial_abi, randomization_seed: seed, }) } @@ -1029,7 +1035,7 @@ where align, max_repr_align: None, unadjusted_abi_align: elt.align, - repr_c: false, + trivial_abi: 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 d44c53c56cc3b..007be848c0d54 100644 --- a/compiler/rustc_abi/src/layout/coroutine.rs +++ b/compiler/rustc_abi/src/layout/coroutine.rs @@ -26,8 +26,8 @@ use rustc_index::{Idx, IndexSlice, IndexVec}; use tracing::{debug, trace}; use crate::{ - BackendRepr, FieldsShape, HasDataLayout, Integer, LayoutData, Primitive, ReprOptions, Scalar, - StructKind, TagEncoding, VariantLayout, Variants, WrappingRange, + Align, BackendRepr, FieldsShape, HasDataLayout, Integer, LayoutData, Primitive, ReprOptions, + Scalar, Size, StructKind, TagEncoding, VariantLayout, Variants, WrappingRange, }; /// This option controls how coroutine saved locals are packed @@ -333,7 +333,7 @@ where align, max_repr_align: None, unadjusted_abi_align: align, - repr_c: false, + trivial_abi: size == Size::ZERO && align == Align::ONE, randomization_seed: Default::default(), }) } diff --git a/compiler/rustc_abi/src/layout/enum_layout.rs b/compiler/rustc_abi/src/layout/enum_layout.rs index 0ab7de05f80f2..30ed0b2f5191a 100644 --- a/compiler/rustc_abi/src/layout/enum_layout.rs +++ b/compiler/rustc_abi/src/layout/enum_layout.rs @@ -465,7 +465,7 @@ where size, max_repr_align, unadjusted_abi_align, - repr_c: repr.c(), + trivial_abi: size == Size::ZERO && align == Align::ONE && !repr.c(), randomization_seed: combined_seed, }) } @@ -656,7 +656,7 @@ where align, max_repr_align, unadjusted_abi_align, - repr_c: repr.c(), + trivial_abi: size == Size::ZERO && align == Align::ONE && !repr.c(), randomization_seed: combined_seed, }; diff --git a/compiler/rustc_abi/src/layout/simple.rs b/compiler/rustc_abi/src/layout/simple.rs index dff1f9ee44980..908df004d62c1 100644 --- a/compiler/rustc_abi/src/layout/simple.rs +++ b/compiler/rustc_abi/src/layout/simple.rs @@ -24,7 +24,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: Align::ONE, - repr_c: false, + trivial_abi: sized, randomization_seed: Hash64::new(0), } } @@ -41,7 +41,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: Align::ONE, - repr_c: false, + trivial_abi: true, randomization_seed: Hash64::ZERO, } } @@ -84,7 +84,7 @@ impl LayoutData { align, max_repr_align: None, unadjusted_abi_align: align, - repr_c: false, + trivial_abi: false, randomization_seed: Hash64::new(randomization_seed), } } @@ -118,7 +118,7 @@ impl LayoutData { size, max_repr_align: None, unadjusted_abi_align: align, - repr_c: false, + trivial_abi: false, randomization_seed: Hash64::new(combined_seed), } } @@ -144,7 +144,7 @@ impl LayoutData { size: Size::ZERO, max_repr_align: None, unadjusted_abi_align: Align::ONE, - repr_c: false, + trivial_abi: true, // Variant layouts never flow back into actual layout computations, // so dummy values are fine here. randomization_seed: Hash64::ZERO, @@ -171,7 +171,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, + trivial_abi: parent.trivial_abi, // 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 b6944a72c0f89..c56f7d47772f3 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -2264,12 +2264,14 @@ 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, - /// 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, + /// Whether this type is a 1-ZST that is not `repr(C)`, or a `repr(transparent)` wrapper around + /// such, or an array of such. + /// This matters because we must follow the C ABI for non-trivial ZSTs. + /// Some C ABIs pass `repr(C)` ZSTs by pointer, but `repr(Rust)` ZSTs should always be ignored. + /// This is `true` iff a type has trivial ABI as described in the [function ABI docs]. + /// + /// [function ABI docs]: https://doc.rust-lang.org/nightly/std/primitive.fn.html#abi-compatibility + pub trivial_abi: bool, /// The randomization seed based on this type's own repr and its fields. /// @@ -2311,10 +2313,10 @@ 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 + /// Returns `true` if this is a 1-ZST that is not `repr(C)`, + /// or an array of such, or a `repr(transparent)` wrapper around such. + pub fn has_trivial_abi(&self) -> bool { + self.trivial_abi } } @@ -2337,7 +2339,7 @@ where variants, max_repr_align, unadjusted_abi_align, - repr_c, + trivial_abi, randomization_seed, } = self; f.debug_struct("Layout") @@ -2350,7 +2352,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("trivial_abi", trivial_abi) .field("randomization_seed", randomization_seed) .finish() } @@ -2463,6 +2465,9 @@ impl LayoutData { size, align, backend_repr, + // `trivial_abi` is not directly checked by codegen, but something went very wrong if it + // does not match, so we check it anyway. + trivial_abi, // We assume aggregates are passed via `Cast` or `Indirect*` so their details either // do not matter or they are checked by `PassMode::eq_abi`. fields: _, @@ -2470,12 +2475,11 @@ impl LayoutData { // Inhabitedness and niches are not ABI-relevant. largest_niche: _, uninhabited: _, - // max_repr_align, unadjusted_abi_align, repr_c are not read directly by codegen + // max_repr_align and unadjusted_abi_align are not read directly by codegen // backends. They are only used to compute `PassMode`. So we can ignore them here, any // differences they may cause are picked up by the `PassMode` check. max_repr_align: _, unadjusted_abi_align: _, - repr_c: _, // The seed does not affect the ABI. randomization_seed: _, } = self; @@ -2487,6 +2491,7 @@ impl LayoutData { && backend_repr.eq_up_to_validity(&other.backend_repr) // `is_bool` checks validity and is ABI-relevant, so we need to consider it. && backend_repr.is_bool() == other.backend_repr.is_bool() + && *trivial_abi == other.trivial_abi } } diff --git a/compiler/rustc_const_eval/src/interpret/call.rs b/compiler/rustc_const_eval/src/interpret/call.rs index 5984448fcabdb..2c728cd69c7f1 100644 --- a/compiler/rustc_const_eval/src/interpret/call.rs +++ b/compiler/rustc_const_eval/src/interpret/call.rs @@ -71,51 +71,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { }) } - /// Returns whether the given type has trivial ABI. - fn has_trivial_abi(&self, layout: TyAndLayout<'tcx>) -> InterpResult<'tcx, bool> { - if !layout.is_1zst() { - return interp_ok(false); - } - match *layout.ty.kind() { - // Trivially trivial-ABI types (because Rust makes no promises about their ABI). - ty::Tuple(..) - | ty::Never - | ty::FnDef(..) - | ty::Closure(..) - | ty::Coroutine(..) - | ty::CoroutineClosure(..) => interp_ok(true), - - ty::Array(elem, _len) => { - // 0-length arrays are in general *not* okay, but arrays of trivial-ABI types are. - self.has_trivial_abi(self.layout_of(elem)?) - } - ty::Adt(adt_def, _args) => { - if adt_def.repr().transparent() { - // All fields must have trivial ABI. - (0..layout.fields.count()).try_fold(true, |acc, idx| { - interp_ok(acc && self.has_trivial_abi(layout.field(self, idx))?) - }) - } else if adt_def.repr().c() { - interp_ok(false) - } else { - // Can't be SIMD or Scalable (since this is a 1-ZST); only Rust is left. - assert!(adt_def.repr().rust()); - interp_ok(true) - } - } - // Types that are considered transparent in `unfold_transparent` should also act - // like transparent types here. - ty::Pat(base, _) => self.has_trivial_abi(self.layout_of(base)?), - ty::UnsafeBinder(bound_ty) => { - let ty = self.tcx.instantiate_bound_regions_with_erased(bound_ty.into()); - self.has_trivial_abi(self.layout_of(ty)?) - } - - ty::Alias(..) => panic!("non-normalized type"), - _ => interp_ok(false), - } - } - /// Find the wrapped inner type of a transparent wrapper by going for the unique /// non-trivial-ABI field. /// @@ -132,7 +87,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { let mut found = None; for idx in 0..layout.fields.count() { let field = layout.field(self, idx); - if self.has_trivial_abi(field)? { + if field.has_trivial_abi() { continue; } // Found a non-trivial ABI field! @@ -302,7 +257,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { return interp_ok(true); } // Handle trivial-ABI types. - if self.has_trivial_abi(caller)? && self.has_trivial_abi(callee)? { + if caller.has_trivial_abi() && callee.has_trivial_abi() { return interp_ok(true); } // Unfold newtypes and NPO optimizations. diff --git a/compiler/rustc_target/src/callconv/powerpc.rs b/compiler/rustc_target/src/callconv/powerpc.rs index 6ccc40719c5bb..ee7a0baca9f27 100644 --- a/compiler/rustc_target/src/callconv/powerpc.rs +++ b/compiler/rustc_target/src/callconv/powerpc.rs @@ -46,7 +46,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_repr_c() + && !arg.layout.has_trivial_abi() { *gprs_in_use += 1; arg.make_indirect_from_ignore(); diff --git a/compiler/rustc_target/src/callconv/s390x.rs b/compiler/rustc_target/src/callconv/s390x.rs index ae0657ce54fbc..6a3f724175bcd 100644 --- a/compiler/rustc_target/src/callconv/s390x.rs +++ b/compiler/rustc_target/src/callconv/s390x.rs @@ -65,7 +65,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_repr_c() + && !arg.layout.has_trivial_abi() { arg.make_indirect_from_ignore(); } diff --git a/compiler/rustc_target/src/callconv/sparc.rs b/compiler/rustc_target/src/callconv/sparc.rs index daefd5e10d92b..1a45046c62e7c 100644 --- a/compiler/rustc_target/src/callconv/sparc.rs +++ b/compiler/rustc_target/src/callconv/sparc.rs @@ -78,7 +78,7 @@ where for arg in fn_abi.args.iter_mut() { if arg.is_ignore() { - if arg.layout.is_zst() && arg.layout.is_repr_c() { + if !arg.layout.has_trivial_abi() { arg.make_indirect_from_ignore(); } continue; diff --git a/compiler/rustc_target/src/callconv/sparc64.rs b/compiler/rustc_target/src/callconv/sparc64.rs index 0ef57cf54e449..1e5b5f8c6104d 100644 --- a/compiler/rustc_target/src/callconv/sparc64.rs +++ b/compiler/rustc_target/src/callconv/sparc64.rs @@ -221,7 +221,7 @@ where continue; } if arg.is_ignore() { - if passes_zsts && arg.layout.is_repr_c() { + if passes_zsts && !arg.layout.has_trivial_abi() { 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 01352f09e71b4..c006454e8df17 100644 --- a/compiler/rustc_target/src/callconv/x86_win64.rs +++ b/compiler/rustc_target/src/callconv/x86_win64.rs @@ -50,7 +50,7 @@ where // 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() { + if !fn_abi.ret.layout.has_trivial_abi() { fn_abi.ret.make_indirect_from_ignore(); } } else { @@ -59,7 +59,7 @@ where for arg in fn_abi.args.iter_mut() { if arg.is_ignore() { - if arg.layout.is_repr_c() { + if !arg.layout.has_trivial_abi() { arg.make_indirect_from_ignore(); } diff --git a/compiler/rustc_ty_utils/src/layout/invariant.rs b/compiler/rustc_ty_utils/src/layout/invariant.rs index 4cc01d74ccf29..921fa58783215 100644 --- a/compiler/rustc_ty_utils/src/layout/invariant.rs +++ b/compiler/rustc_ty_utils/src/layout/invariant.rs @@ -16,6 +16,11 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou if layout.size.bytes() >= tcx.data_layout.obj_size_bound() { bug!("size is too large, in the following layout:\n{layout:#?}"); } + + if layout.has_trivial_abi() && !layout.is_1zst() { + bug!("non-1-ZST with trivial ABI:\n{layout:#?}") + } + // FIXME(#124403): Once `repr_c_enums_larger_than_int` is a hard error, we could assert // here that a repr(c) enum discriminant is never larger than a c_int. diff --git a/tests/ui/abi/c-zst.aarch64-darwin.stderr b/tests/ui/abi/c-zst.aarch64-darwin.stderr index ea764cb2cc71e..d840b8d499f97 100644 --- a/tests/ui/abi/c-zst.aarch64-darwin.stderr +++ b/tests/ui/abi/c-zst.aarch64-darwin.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.powerpc-linux.stderr b/tests/ui/abi/c-zst.powerpc-linux.stderr index 8598792e93815..13eb7cff18e00 100644 --- a/tests/ui/abi/c-zst.powerpc-linux.stderr +++ b/tests/ui/abi/c-zst.powerpc-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -74,5 +99,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.rs b/tests/ui/abi/c-zst.rs index 5a3ba8c672f03..f6e7675a56bf0 100644 --- a/tests/ui/abi/c-zst.rs +++ b/tests/ui/abi/c-zst.rs @@ -75,3 +75,7 @@ extern "C" fn pass_zst(_: Czst) -> Czst { //~^ ERROR: fn_abi Czst } + +#[rustc_dump_layout(debug)] +type Array = [u8; 0]; +//~^ ERROR: layout_of diff --git a/tests/ui/abi/c-zst.s390x-linux.stderr b/tests/ui/abi/c-zst.s390x-linux.stderr index 8598792e93815..13eb7cff18e00 100644 --- a/tests/ui/abi/c-zst.s390x-linux.stderr +++ b/tests/ui/abi/c-zst.s390x-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -74,5 +99,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.sparc-linux.stderr b/tests/ui/abi/c-zst.sparc-linux.stderr index 8598792e93815..13eb7cff18e00 100644 --- a/tests/ui/abi/c-zst.sparc-linux.stderr +++ b/tests/ui/abi/c-zst.sparc-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -74,5 +99,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.sparc-none.stderr b/tests/ui/abi/c-zst.sparc-none.stderr index 8598792e93815..13eb7cff18e00 100644 --- a/tests/ui/abi/c-zst.sparc-none.stderr +++ b/tests/ui/abi/c-zst.sparc-none.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -74,5 +99,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.sparc64-linux.stderr b/tests/ui/abi/c-zst.sparc64-linux.stderr index 8598792e93815..13eb7cff18e00 100644 --- a/tests/ui/abi/c-zst.sparc64-linux.stderr +++ b/tests/ui/abi/c-zst.sparc64-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -74,5 +99,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/c-zst.x86_64-linux.stderr b/tests/ui/abi/c-zst.x86_64-linux.stderr index ea764cb2cc71e..d840b8d499f97 100644 --- a/tests/ui/abi/c-zst.x86_64-linux.stderr +++ b/tests/ui/abi/c-zst.x86_64-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors 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 efc74aab224a9..5cf6eb2ded71c 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 @@ -1,3 +1,28 @@ +error: layout_of([u8; 0]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: true, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: $SEED, + } + --> $DIR/c-zst.rs:80:1 + | +LL | type Array = [u8; 0]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +83,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -85,5 +110,5 @@ error: fn_abi_of(pass_zst) = FnAbi { LL | extern "C" fn pass_zst(_: Czst) -> Czst { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/compatibility.rs b/tests/ui/abi/compatibility.rs index 37139f0e633cf..485dcc4fbfa84 100644 --- a/tests/ui/abi/compatibility.rs +++ b/tests/ui/abi/compatibility.rs @@ -206,6 +206,8 @@ enum Either2 { Right(U, ()), } +struct ReprRust(T); + #[repr(C)] struct ReprC(T); #[repr(C)] @@ -238,9 +240,12 @@ test_abi_compatible!(isize_int, isize, i32); #[cfg(target_pointer_width = "64")] test_abi_compatible!(isize_int, isize, i64); -// Compatibility of 1-ZST. +// Compatibility of trivial ABI 1-ZST. test_abi_compatible!(zst_unit, Zst, ()); -test_abi_compatible!(zst_array, Zst, [u8; 0]); +test_abi_compatible!(zst_empty_array, Zst, [(); 0]); +test_abi_compatible!(zst_array, Zst, [(); 4]); +test_abi_compatible!(zst_rust_struct, Zst, ReprRust>); +test_abi_compatible!(zst_tuple, Zst, (ReprC,)); test_abi_compatible!(nonzero_int, NonZero, i32); // `#[repr(C)]` enums should not change ABI based on individual variant inhabitedness. @@ -260,7 +265,7 @@ struct TransparentWrapper1(T); #[repr(transparent)] struct TransparentWrapper2((), Zst, T); #[repr(transparent)] -struct TransparentWrapper3(T, [u8; 0], PhantomData); +struct TransparentWrapper3(T, [(); 0], PhantomData); #[repr(transparent)] union TransparentWrapperUnion { nothing: (), @@ -293,6 +298,7 @@ test_transparent!(float_ppc, ppcf128); test_transparent!(reference, &'static i32); test_transparent!(zst, Zst); +test_transparent!(c_zst, ReprC); test_transparent!(unit, ()); test_transparent!(enum_, Option); test_transparent!(enum_niched, Option<&'static i32>); @@ -317,6 +323,8 @@ mod arrays { use super::*; test_transparent!(empty_array, [u32; 0]); test_transparent!(empty_1zst_array, [u8; 0]); + test_transparent!(empty_trivial_array, [(); 0]); + test_transparent!(trivial_array, [(); 8]); test_transparent!(small_array, [i32; 2]); // chosen to fit into 64bit test_transparent!(large_array, [i32; 16]); } diff --git a/tests/ui/abi/debug.generic.stderr b/tests/ui/abi/debug.generic.stderr index f973e774cdc18..c574ecb48eb1b 100644 --- a/tests/ui/abi/debug.generic.stderr +++ b/tests/ui/abi/debug.generic.stderr @@ -52,7 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -89,7 +89,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -134,7 +134,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -179,7 +179,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -227,7 +227,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -258,7 +258,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -300,7 +300,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -334,7 +334,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -376,7 +376,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -410,7 +410,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -440,7 +440,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -474,7 +474,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -513,7 +513,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -551,7 +551,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -584,7 +584,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -622,7 +622,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -658,7 +658,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -692,7 +692,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -722,7 +722,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -756,7 +756,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -792,7 +792,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -826,7 +826,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -856,7 +856,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -890,7 +890,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -946,7 +946,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -982,7 +982,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/debug.loongarch64.stderr b/tests/ui/abi/debug.loongarch64.stderr index 65425ab57e171..b89ee4ae762ac 100644 --- a/tests/ui/abi/debug.loongarch64.stderr +++ b/tests/ui/abi/debug.loongarch64.stderr @@ -52,7 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -89,7 +89,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -134,7 +134,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -179,7 +179,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -227,7 +227,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -258,7 +258,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -300,7 +300,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -334,7 +334,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -376,7 +376,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -410,7 +410,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -440,7 +440,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -474,7 +474,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -513,7 +513,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -551,7 +551,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -584,7 +584,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -622,7 +622,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -658,7 +658,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -692,7 +692,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -722,7 +722,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -756,7 +756,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -792,7 +792,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -826,7 +826,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -856,7 +856,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -890,7 +890,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -946,7 +946,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -982,7 +982,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/debug.riscv64.stderr b/tests/ui/abi/debug.riscv64.stderr index 65425ab57e171..b89ee4ae762ac 100644 --- a/tests/ui/abi/debug.riscv64.stderr +++ b/tests/ui/abi/debug.riscv64.stderr @@ -52,7 +52,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -89,7 +89,7 @@ error: fn_abi_of(test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -134,7 +134,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -179,7 +179,7 @@ error: fn_abi_of(test_unsized) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -227,7 +227,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -258,7 +258,7 @@ error: fn_abi_of(TestFnPtr) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -300,7 +300,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -334,7 +334,7 @@ error: fn_abi_of(test_generic) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -376,7 +376,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -410,7 +410,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -440,7 +440,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -474,7 +474,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -513,7 +513,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -551,7 +551,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -584,7 +584,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -622,7 +622,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -658,7 +658,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -692,7 +692,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -722,7 +722,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -756,7 +756,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -792,7 +792,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -826,7 +826,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -856,7 +856,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -890,7 +890,7 @@ error: ABIs are not compatible }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -946,7 +946,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -982,7 +982,7 @@ error: fn_abi_of(assoc_test) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr index 683428514e4db..cbd1df6f48c83 100644 --- a/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr +++ b/tests/ui/abi/numbers-arithmetic/x86-64-sysv64-arg-ext.apple.stderr @@ -17,7 +17,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776123356184577, }, }, @@ -48,7 +48,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776123356184577, }, }, @@ -92,7 +92,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776127651151873, }, }, @@ -123,7 +123,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776127651151873, }, }, @@ -167,7 +167,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027808258, }, }, @@ -198,7 +198,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027808258, }, }, @@ -242,7 +242,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322775554, }, }, @@ -273,7 +273,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322775554, }, }, @@ -317,7 +317,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027873795, }, }, @@ -348,7 +348,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027873795, }, }, @@ -392,7 +392,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322841091, }, }, @@ -423,7 +423,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322841091, }, }, 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 2fc0528149667..a882cd13e4e60 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 @@ -17,7 +17,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776123356184577, }, }, @@ -48,7 +48,7 @@ error: fn_abi_of(i8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776123356184577, }, }, @@ -92,7 +92,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776127651151873, }, }, @@ -123,7 +123,7 @@ error: fn_abi_of(u8) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 71776127651151873, }, }, @@ -167,7 +167,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027808258, }, }, @@ -198,7 +198,7 @@ error: fn_abi_of(i16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027808258, }, }, @@ -242,7 +242,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322775554, }, }, @@ -273,7 +273,7 @@ error: fn_abi_of(u16) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322775554, }, }, @@ -317,7 +317,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027873795, }, }, @@ -348,7 +348,7 @@ error: fn_abi_of(i32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462603027873795, }, }, @@ -392,7 +392,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322841091, }, }, @@ -423,7 +423,7 @@ error: fn_abi_of(u32) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 18446462607322841091, }, }, diff --git a/tests/ui/abi/pass-indirectly-attr.stderr b/tests/ui/abi/pass-indirectly-attr.stderr index 25589665cf91d..08bfa7d900164 100644 --- a/tests/ui/abi/pass-indirectly-attr.stderr +++ b/tests/ui/abi/pass-indirectly-attr.stderr @@ -33,7 +33,7 @@ error: fn_abi_of(extern_c) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -71,7 +71,7 @@ error: fn_abi_of(extern_c) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -113,7 +113,7 @@ error: fn_abi_of(extern_rust) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -161,7 +161,7 @@ error: fn_abi_of(extern_rust) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, diff --git a/tests/ui/abi/rust-zst.aarch64-darwin.stderr b/tests/ui/abi/rust-zst.aarch64-darwin.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.aarch64-darwin.stderr +++ b/tests/ui/abi/rust-zst.aarch64-darwin.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.powerpc-linux.stderr b/tests/ui/abi/rust-zst.powerpc-linux.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.powerpc-linux.stderr +++ b/tests/ui/abi/rust-zst.powerpc-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.rs b/tests/ui/abi/rust-zst.rs index dd652c7d23e2f..4e250b9ae9584 100644 --- a/tests/ui/abi/rust-zst.rs +++ b/tests/ui/abi/rust-zst.rs @@ -62,3 +62,8 @@ use minicore::*; #[rustc_abi(debug)] extern "C" fn pass_rust_zst(_: ()) {} //~ ERROR: fn_abi + +// Unsized type, so shouldn't have a trivial ABI. +#[rustc_dump_layout(debug)] +type Slice = [u8]; +//~^ ERROR: layout_of diff --git a/tests/ui/abi/rust-zst.s390x-linux.stderr b/tests/ui/abi/rust-zst.s390x-linux.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.s390x-linux.stderr +++ b/tests/ui/abi/rust-zst.s390x-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.sparc-linux.stderr b/tests/ui/abi/rust-zst.sparc-linux.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.sparc-linux.stderr +++ b/tests/ui/abi/rust-zst.sparc-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.sparc-none.stderr b/tests/ui/abi/rust-zst.sparc-none.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.sparc-none.stderr +++ b/tests/ui/abi/rust-zst.sparc-none.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.sparc64-linux.stderr b/tests/ui/abi/rust-zst.sparc64-linux.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.sparc64-linux.stderr +++ b/tests/ui/abi/rust-zst.sparc64-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.x86_64-linux.stderr b/tests/ui/abi/rust-zst.x86_64-linux.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.x86_64-linux.stderr +++ b/tests/ui/abi/rust-zst.x86_64-linux.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/rust-zst.x86_64-pc-windows-gnu.stderr b/tests/ui/abi/rust-zst.x86_64-pc-windows-gnu.stderr index f4a3338ca287d..dbd23a2aac250 100644 --- a/tests/ui/abi/rust-zst.x86_64-pc-windows-gnu.stderr +++ b/tests/ui/abi/rust-zst.x86_64-pc-windows-gnu.stderr @@ -1,3 +1,28 @@ +error: layout_of([u8]) = Layout { + size: Size(0 bytes), + align: $SOME_ALIGN, + backend_repr: Memory { + sized: false, + }, + fields: Array { + stride: Size(1 bytes), + count: 0, + }, + largest_niche: None, + uninhabited: false, + variants: Single { + index: 0, + }, + max_repr_align: None, + unadjusted_abi_align: $SOME_ALIGN, + trivial_abi: false, + randomization_seed: 3299917640423194882, + } + --> $DIR/rust-zst.rs:68:1 + | +LL | type Slice = [u8]; + | ^^^^^^^^^^ + error: fn_abi_of(pass_rust_zst) = FnAbi { args: [ ArgAbi { @@ -20,7 +45,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +72,7 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -63,5 +88,5 @@ error: fn_abi_of(pass_rust_zst) = FnAbi { LL | extern "C" fn pass_rust_zst(_: ()) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors diff --git a/tests/ui/abi/sysv64-zst.stderr b/tests/ui/abi/sysv64-zst.stderr index f644f32fe86f9..d6ffe56839868 100644 --- a/tests/ui/abi/sysv64-zst.stderr +++ b/tests/ui/abi/sysv64-zst.stderr @@ -20,7 +20,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, randomization_seed: 0, }, }, @@ -47,7 +47,7 @@ error: fn_abi_of(pass_zst) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: $SOME_ALIGN, - repr_c: false, + trivial_abi: true, 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 2cfe2f9cf60e6..29e0f00b3c731 100644 --- a/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr +++ b/tests/ui/attributes/doc_examples/rustc_dump_layout_debug.stderr @@ -14,7 +14,7 @@ error: layout_of(Union) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: 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 22d1739a78ab3..8e3c5723da96f 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.aarch64.stderr @@ -20,7 +20,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +58,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, 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 ffbfa5f146eba..5950c643577e7 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.win.stderr +++ b/tests/ui/c-variadic/pass-by-value-abi.win.stderr @@ -20,7 +20,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -54,7 +54,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, 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 e8b17cd9001e3..9537258618313 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 @@ -20,7 +20,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -58,7 +58,7 @@ error: fn_abi_of(take_va_list) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -96,7 +96,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -134,7 +134,7 @@ error: fn_abi_of(take_va_list_sysv64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, @@ -174,7 +174,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, }, }, @@ -212,7 +212,7 @@ error: fn_abi_of(take_va_list_win64) = FnAbi { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: true, randomization_seed: $SEED, }, }, diff --git a/tests/ui/enum-discriminant/wrapping_niche.stderr b/tests/ui/enum-discriminant/wrapping_niche.stderr index 93423bbe45500..6fc489cf4a798 100644 --- a/tests/ui/enum-discriminant/wrapping_niche.stderr +++ b/tests/ui/enum-discriminant/wrapping_niche.stderr @@ -59,7 +59,7 @@ error: layout_of(UnsignedAroundZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: 2648004449468912780, } --> $DIR/wrapping_niche.rs:8:1 @@ -128,7 +128,7 @@ error: layout_of(SignedAroundZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: 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 438fa82c45f2c..f569eb65e1a1d 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -81,7 +81,7 @@ error: layout_of(E) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:7:1 @@ -116,7 +116,7 @@ error: layout_of(S) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:10:1 @@ -140,7 +140,7 @@ error: layout_of(U) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:13:1 @@ -213,7 +213,7 @@ error: layout_of(Result) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:16:1 @@ -235,7 +235,7 @@ error: layout_of(i32) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:19:1 @@ -259,7 +259,7 @@ error: layout_of(V) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:26:1 @@ -283,7 +283,7 @@ error: layout_of(W) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:32:1 @@ -307,7 +307,7 @@ error: layout_of(Y) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:38:1 @@ -331,7 +331,7 @@ error: layout_of(P1) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:45:1 @@ -355,7 +355,7 @@ error: layout_of(P2) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:49:1 @@ -379,7 +379,7 @@ error: layout_of(P3) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:57:1 @@ -403,7 +403,7 @@ error: layout_of(P4) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:61:1 @@ -427,7 +427,7 @@ error: layout_of(P5) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:65:1 @@ -451,7 +451,7 @@ error: layout_of(MaybeUninit) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:68:1 @@ -545,7 +545,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:92:1 @@ -618,7 +618,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/debug.rs:95:1 diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index 9fd5972855dce..5bcee1817004e 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -39,7 +39,7 @@ error: layout_of(A) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:19:1 @@ -88,7 +88,7 @@ error: layout_of(B) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:23:1 @@ -137,7 +137,7 @@ error: layout_of(C) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:27:1 @@ -186,7 +186,7 @@ error: layout_of(P) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/hexagon-enum.rs:31:1 @@ -235,7 +235,7 @@ error: layout_of(T) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, 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 bc998260bd836..9e56cf4e12efd 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 @@ -57,7 +57,7 @@ error: layout_of(MissingPayloadField) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:16:1 @@ -130,7 +130,7 @@ error: layout_of(CommonPayloadField) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:25:1 @@ -203,7 +203,7 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:33:1 @@ -292,7 +292,7 @@ error: layout_of(NicheFirst) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:41:1 @@ -381,7 +381,7 @@ error: layout_of(NicheSecond) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96158-scalarpair-payload-might-be-uninit.rs:50:1 diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index 6baec51908927..b30473127d5a0 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -51,7 +51,7 @@ error: layout_of(Aligned1) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96185-overaligned-enum.rs:8:1 @@ -112,7 +112,7 @@ error: layout_of(Aligned2) = Layout { Align(1 bytes), ), unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/issue-96185-overaligned-enum.rs:16:1 diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index fad15af1421a8..b0d42cbb0de83 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -39,7 +39,7 @@ error: layout_of(A) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:19:1 @@ -88,7 +88,7 @@ error: layout_of(B) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:23:1 @@ -137,7 +137,7 @@ error: layout_of(C) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(2 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:27:1 @@ -186,7 +186,7 @@ error: layout_of(P) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/thumb-enum.rs:31:1 @@ -235,7 +235,7 @@ error: layout_of(T) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, 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 f08e4df2b7ac3..4b18384ef7982 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -63,7 +63,7 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:13:1 @@ -150,7 +150,7 @@ error: layout_of(MultipleAlignments) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:21:1 @@ -223,7 +223,7 @@ error: layout_of(Result<[u32; 0], Packed>>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:37:1 @@ -300,7 +300,7 @@ error: layout_of(Result<[u32; 0], Packed>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/zero-sized-array-enum-niche.rs:44: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 cc934916046a9..27a3eb65d29c3 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 @@ -43,7 +43,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:43:1 @@ -116,7 +116,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:50:1 @@ -187,7 +187,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:62: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 357361d582526..cd1a2c5af9b28 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 @@ -43,7 +43,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:43:1 @@ -116,7 +116,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:50:1 @@ -187,7 +187,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:62: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 cc934916046a9..27a3eb65d29c3 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 @@ -43,7 +43,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:43:1 @@ -116,7 +116,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:50:1 @@ -187,7 +187,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:62: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 cc934916046a9..27a3eb65d29c3 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 @@ -43,7 +43,7 @@ error: layout_of(Univariant) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:43:1 @@ -116,7 +116,7 @@ error: layout_of(TwoVariants) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:50:1 @@ -187,7 +187,7 @@ error: layout_of(DeadBranchHasOtherField) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-dead-variants.rs:62:1 diff --git a/tests/ui/repr/repr-c-int-dead-variants.stderr b/tests/ui/repr/repr-c-int-dead-variants.stderr index 2d31bb75c61ba..1c18143e28668 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.stderr +++ b/tests/ui/repr/repr-c-int-dead-variants.stderr @@ -43,7 +43,7 @@ error: layout_of(UnivariantU8) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:14:1 @@ -116,7 +116,7 @@ error: layout_of(TwoVariantsU8) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:21:1 @@ -187,7 +187,7 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { Align(8 bytes), ), unadjusted_abi_align: Align(8 bytes), - repr_c: true, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/repr-c-int-dead-variants.rs:33:1 diff --git a/tests/ui/type/pattern_types/non_null.stderr b/tests/ui/type/pattern_types/non_null.stderr index 2983cef4924b6..966abad86c294 100644 --- a/tests/ui/type/pattern_types/non_null.stderr +++ b/tests/ui/type/pattern_types/non_null.stderr @@ -25,7 +25,7 @@ error: layout_of(pattern_type!(*const T is !null)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/non_null.rs:11:1 @@ -92,7 +92,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/non_null.rs:14:1 @@ -129,7 +129,7 @@ error: layout_of(pattern_type!(*const [u8] is !null)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(8 bytes), - repr_c: false, + trivial_abi: 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 bda319b4be19b..f05e070148bd5 100644 --- a/tests/ui/type/pattern_types/or_patterns.stderr +++ b/tests/ui/type/pattern_types/or_patterns.stderr @@ -66,7 +66,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, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/or_patterns.rs:10:1 @@ -101,7 +101,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, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/or_patterns.rs:14:1 diff --git a/tests/ui/type/pattern_types/range_patterns.stderr b/tests/ui/type/pattern_types/range_patterns.stderr index 5ed826fa66331..848c930d30caf 100644 --- a/tests/ui/type/pattern_types/range_patterns.stderr +++ b/tests/ui/type/pattern_types/range_patterns.stderr @@ -25,7 +25,7 @@ error: layout_of(NonZero) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:8:1 @@ -60,7 +60,7 @@ error: layout_of(pattern_type!(u32 is 1..)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:10:1 @@ -127,7 +127,7 @@ error: layout_of(Option) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:12:1 @@ -194,7 +194,7 @@ error: layout_of(Option>) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:14:1 @@ -229,7 +229,7 @@ error: layout_of(NonZeroU32New) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(4 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:16:1 @@ -292,7 +292,7 @@ error: layout_of(pattern_type!(i8 is -10..=10)) = Layout { }, max_repr_align: None, unadjusted_abi_align: Align(1 bytes), - repr_c: false, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:29:1 @@ -327,7 +327,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, + trivial_abi: false, randomization_seed: $SEED, } --> $DIR/range_patterns.rs:32:1