diff --git a/compiler/rustc_abi/src/layout.rs b/compiler/rustc_abi/src/layout.rs index cca1d499088f4..f0b92155d0be1 100644 --- a/compiler/rustc_abi/src/layout.rs +++ b/compiler/rustc_abi/src/layout.rs @@ -11,7 +11,7 @@ use tracing::{debug, trace}; use crate::{ AbiAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer, LayoutData, Niche, NonZeroUsize, NumScalableVectors, Primitive, ReprOptions, Scalar, Size, - StructKind, TagEncoding, TargetDataLayout, Variants, WrappingRange, + StructKind, TagEncoding, TargetDataLayout, VariantLayout, Variants, WrappingRange, }; mod coroutine; @@ -638,6 +638,10 @@ impl LayoutCalculator { } let calculate_niche_filling_layout = || -> Option> { + struct VariantLayoutInfo { + align_abi: Align, + } + if repr.inhibit_enum_layout_opt() { return None; } @@ -649,18 +653,22 @@ impl LayoutCalculator { let mut align = dl.aggregate_align; let mut max_repr_align = repr.align; let mut unadjusted_abi_align = align; + let mut combined_seed = repr.field_shuffle_seed; + let mut variants_info = IndexVec::::with_capacity(variants.len()); let mut variant_layouts = variants - .iter_enumerated() - .map(|(j, v)| { - let mut st = self.univariant(v, repr, StructKind::AlwaysSized).ok()?; - st.variants = Variants::Single { index: j }; + .iter() + .map(|v| { + let st = self.univariant(v, repr, StructKind::AlwaysSized).ok()?; + + variants_info.push(VariantLayoutInfo { align_abi: st.align.abi }); align = align.max(st.align.abi); max_repr_align = max_repr_align.max(st.max_repr_align); unadjusted_abi_align = unadjusted_abi_align.max(st.unadjusted_abi_align); + combined_seed = combined_seed.wrapping_add(st.randomization_seed); - Some(st) + Some(VariantLayout::from_layout(st)) }) .collect::>>()?; @@ -698,7 +706,7 @@ impl LayoutCalculator { } // Determine if it'll fit after the niche. - let this_align = layout.align.abi; + let this_align = variants_info[i].align_abi; let this_offset = (niche_offset + niche_size).align_to(this_align); if this_offset + layout.size > size { @@ -706,15 +714,8 @@ impl LayoutCalculator { } // It'll fit, but we need to make some adjustments. - match layout.fields { - FieldsShape::Arbitrary { ref mut offsets, .. } => { - for offset in offsets.iter_mut() { - *offset += this_offset; - } - } - FieldsShape::Primitive | FieldsShape::Array { .. } | FieldsShape::Union(..) => { - panic!("Layout of fields should be Arbitrary for variants") - } + for offset in layout.field_offsets.iter_mut() { + *offset += this_offset; } // It can't be a Scalar or ScalarPair because the offset isn't 0. @@ -736,7 +737,7 @@ impl LayoutCalculator { .iter_enumerated() .all(|(i, layout)| i == largest_variant_index || layout.size == Size::ZERO); let same_size = size == variant_layouts[largest_variant_index].size; - let same_align = align == variant_layouts[largest_variant_index].align.abi; + let same_align = align == variants_info[largest_variant_index].align_abi; let uninhabited = variant_layouts.iter().all(|v| v.is_uninhabited()); let abi = if same_size && same_align && others_zst { @@ -759,11 +760,6 @@ impl LayoutCalculator { BackendRepr::Memory { sized: true } }; - let combined_seed = variant_layouts - .iter() - .map(|v| v.randomization_seed) - .fold(repr.field_shuffle_seed, |acc, seed| acc.wrapping_add(seed)); - let layout = LayoutData { variants: Variants::Multiple { tag: niche_scalar, @@ -856,6 +852,7 @@ impl LayoutCalculator { let mut align = dl.aggregate_align; let mut max_repr_align = repr.align; let mut unadjusted_abi_align = align; + let mut combined_seed = repr.field_shuffle_seed; let mut size = Size::ZERO; @@ -879,14 +876,13 @@ impl LayoutCalculator { // Create the set of structs that represent each variant. let mut layout_variants = variants - .iter_enumerated() - .map(|(i, field_layouts)| { - let mut st = self.univariant( + .iter() + .map(|field_layouts| { + let st = self.univariant( field_layouts, repr, StructKind::Prefixed(min_ity.size(), prefix_align), )?; - st.variants = Variants::Single { index: i }; // Find the first field we can't move later // to make room for a larger discriminant. for field_idx in st.fields.index_by_increasing_offset() { @@ -900,7 +896,8 @@ impl LayoutCalculator { align = align.max(st.align.abi); max_repr_align = max_repr_align.max(st.max_repr_align); unadjusted_abi_align = unadjusted_abi_align.max(st.unadjusted_abi_align); - Ok(st) + combined_seed = combined_seed.wrapping_add(st.randomization_seed); + Ok(VariantLayout::from_layout(st)) }) .collect::, _>>()?; @@ -955,23 +952,16 @@ impl LayoutCalculator { let old_ity_size = min_ity.size(); let new_ity_size = ity.size(); for variant in &mut layout_variants { - match variant.fields { - FieldsShape::Arbitrary { ref mut offsets, .. } => { - for i in offsets { - if *i <= old_ity_size { - assert_eq!(*i, old_ity_size); - *i = new_ity_size; - } - } - // We might be making the struct larger. - if variant.size <= old_ity_size { - variant.size = new_ity_size; - } - } - FieldsShape::Primitive | FieldsShape::Array { .. } | FieldsShape::Union(..) => { - panic!("encountered a non-arbitrary layout during enum layout") + for i in &mut variant.field_offsets { + if *i <= old_ity_size { + assert_eq!(*i, old_ity_size); + *i = new_ity_size; } } + // We might be making the struct larger. + if variant.size <= old_ity_size { + variant.size = new_ity_size; + } } } @@ -996,12 +986,10 @@ impl LayoutCalculator { let mut common_prim = None; let mut common_prim_initialized_in_all_variants = true; for (field_layouts, layout_variant) in iter::zip(variants, &layout_variants) { - let FieldsShape::Arbitrary { ref offsets, .. } = layout_variant.fields else { - panic!("encountered a non-arbitrary layout during enum layout"); - }; // We skip *all* ZST here and later check if we are good in terms of alignment. // This lets us handle some cases involving aligned ZST. - let mut fields = iter::zip(field_layouts, offsets).filter(|p| !p.0.is_zst()); + let mut fields = iter::zip(field_layouts, &layout_variant.field_offsets) + .filter(|p| !p.0.is_zst()); let (field, offset) = match (fields.next(), fields.next()) { (None, None) => { common_prim_initialized_in_all_variants = false; @@ -1096,25 +1084,17 @@ impl LayoutCalculator { for variant in &mut layout_variants { // We only do this for variants with fields; the others are not accessed anyway. // Also do not overwrite any already existing "clever" ABIs. - if variant.fields.count() > 0 - && matches!(variant.backend_repr, BackendRepr::Memory { .. }) + if matches!(variant.backend_repr, BackendRepr::Memory { .. } if variant.has_fields()) { variant.backend_repr = abi; - // Also need to bump up the size and alignment, so that the entire value fits - // in here. + // Also need to bump up the size, so that the entire value fits in here. variant.size = cmp::max(variant.size, size); - variant.align.abi = cmp::max(variant.align.abi, align); } } } let largest_niche = Niche::from_scalar(dl, Size::ZERO, tag); - let combined_seed = layout_variants - .iter() - .map(|v| v.randomization_seed) - .fold(repr.field_shuffle_seed, |acc, seed| acc.wrapping_add(seed)); - let tagged_layout = LayoutData { variants: Variants::Multiple { tag, diff --git a/compiler/rustc_abi/src/layout/coroutine.rs b/compiler/rustc_abi/src/layout/coroutine.rs index 815cf1e28a08c..fd68d06c93829 100644 --- a/compiler/rustc_abi/src/layout/coroutine.rs +++ b/compiler/rustc_abi/src/layout/coroutine.rs @@ -27,7 +27,7 @@ use tracing::{debug, trace}; use crate::{ BackendRepr, FieldsShape, HasDataLayout, Integer, LayoutData, Primitive, ReprOptions, Scalar, - StructKind, TagEncoding, Variants, WrappingRange, + StructKind, TagEncoding, VariantLayout, Variants, WrappingRange, }; /// Overlap eligibility and variant assignment for each CoroutineSavedLocal. @@ -230,7 +230,6 @@ pub(super) fn layout< &ReprOptions::default(), StructKind::Prefixed(prefix_size, prefix_align.abi), )?; - variant.variants = Variants::Single { index }; let FieldsShape::Arbitrary { offsets, in_memory_order } = variant.fields else { unreachable!(); @@ -281,7 +280,7 @@ pub(super) fn layout< size = size.max(variant.size); align = align.max(variant.align); - Ok(variant) + Ok(VariantLayout::from_layout(variant)) }) .collect::, _>>()?; diff --git a/compiler/rustc_abi/src/layout/simple.rs b/compiler/rustc_abi/src/layout/simple.rs index 3784611b157be..48530cbf69c77 100644 --- a/compiler/rustc_abi/src/layout/simple.rs +++ b/compiler/rustc_abi/src/layout/simple.rs @@ -146,4 +146,28 @@ impl LayoutData { randomization_seed: Hash64::ZERO, } } + + /// Returns a layout for an inhabited variant. + pub fn for_variant(parent: &Self, index: VariantIdx) -> Self { + let layout = match &parent.variants { + Variants::Multiple { variants, .. } => &variants[index], + _ => panic!("Expected multi-variant layout in `Layout::for_variant`"), + }; + + Self { + fields: FieldsShape::Arbitrary { + offsets: layout.field_offsets.clone(), + in_memory_order: layout.fields_in_memory_order.clone(), + }, + variants: Variants::Single { index }, + backend_repr: layout.backend_repr, + largest_niche: layout.largest_niche, + uninhabited: layout.uninhabited, + size: layout.size, + align: parent.align, + max_repr_align: parent.max_repr_align, + unadjusted_abi_align: parent.unadjusted_abi_align, + randomization_seed: Hash64::ZERO, + } + } } diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs index 22300fda5f698..1b3d9d1467074 100644 --- a/compiler/rustc_abi/src/lib.rs +++ b/compiler/rustc_abi/src/lib.rs @@ -1974,7 +1974,7 @@ pub enum Variants { tag: Scalar, tag_encoding: TagEncoding, tag_field: FieldIdx, - variants: IndexVec>, + variants: IndexVec>, }, } @@ -2340,3 +2340,40 @@ pub enum AbiFromStrErr { /// no "-unwind" variant can be used here NoExplicitUnwind, } + +// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage. +#[derive(PartialEq, Eq, Hash, Clone, Debug)] +#[cfg_attr(feature = "nightly", derive(HashStable_Generic))] +pub struct VariantLayout { + pub size: Size, + pub backend_repr: BackendRepr, + pub field_offsets: IndexVec, + fields_in_memory_order: IndexVec, + largest_niche: Option, + uninhabited: bool, +} + +impl VariantLayout { + pub fn from_layout(layout: LayoutData) -> Self { + let FieldsShape::Arbitrary { offsets, in_memory_order } = layout.fields else { + panic!("Layout of fields should be Arbitrary for variants"); + }; + + Self { + size: layout.size, + backend_repr: layout.backend_repr, + field_offsets: offsets, + fields_in_memory_order: in_memory_order, + largest_niche: layout.largest_niche, + uninhabited: layout.uninhabited, + } + } + + pub fn is_uninhabited(&self) -> bool { + self.uninhabited + } + + pub fn has_fields(&self) -> bool { + self.field_offsets.len() > 0 + } +} diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index df2eeec74cf2d..4082a7aa11d18 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -765,7 +765,7 @@ impl<'hir> LoweringContext<'_, 'hir> { let mut bodies = std::mem::take(&mut self.bodies); let define_opaque = std::mem::take(&mut self.define_opaque); let trait_map = std::mem::take(&mut self.trait_map); - let delayed_lints = std::mem::take(&mut self.delayed_lints).into_boxed_slice(); + let delayed_lints = Steal::new(std::mem::take(&mut self.delayed_lints).into_boxed_slice()); #[cfg(debug_assertions)] for (id, attrs) in attrs.iter() { diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index 3f12e857391b2..9b9fa737d6d8d 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -217,12 +217,10 @@ fn create_mingw_dll_import_lib( // able to control the *exact* spelling of each of the symbols that are being imported: // hence we don't want `dlltool` adding leading underscores automatically. let dlltool = find_binutils_dlltool(sess); - let temp_prefix = { - let mut path = PathBuf::from(&output_path); - path.pop(); - path.push(lib_name); - path - }; + // temp_prefix doesn't handle paths with spaces so + // use a relative path and set the current working directory + let cwd = output_path.parent().unwrap_or(output_path); + let temp_prefix = lib_name; // dlltool target architecture args from: // https://github.com/llvm/llvm-project-release-prs/blob/llvmorg-15.0.6/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp#L69 let (dlltool_target_arch, dlltool_target_bitness) = match &sess.target.arch { @@ -246,7 +244,8 @@ fn create_mingw_dll_import_lib( .arg(dlltool_target_bitness) .arg("--no-leading-underscore") .arg("--temp-prefix") - .arg(temp_prefix); + .arg(temp_prefix) + .current_dir(cwd); match dlltool_cmd.output() { Err(e) => { diff --git a/compiler/rustc_data_structures/src/flat_map_in_place.rs b/compiler/rustc_data_structures/src/flat_map_in_place.rs index d1fdd999d36ae..9064428202a8b 100644 --- a/compiler/rustc_data_structures/src/flat_map_in_place.rs +++ b/compiler/rustc_data_structures/src/flat_map_in_place.rs @@ -67,8 +67,13 @@ impl FlatMapInPlace for V { } } -// A vec-like type must implement these operations to support `flat_map_in_place`. -pub trait FlatMapInPlaceVec { +/// A vec-like type must implement these operations to support `flat_map_in_place`. +/// +/// # Safety +/// +/// The memory safety of the unsafe block in `flat_map_in_place` relies on impls of this trait +/// implementing all the operations correctly. +pub unsafe trait FlatMapInPlaceVec { type Elem; fn len(&self) -> usize; @@ -78,7 +83,7 @@ pub trait FlatMapInPlaceVec { fn insert(&mut self, idx: usize, elem: Self::Elem); } -impl FlatMapInPlaceVec for Vec { +unsafe impl FlatMapInPlaceVec for Vec { type Elem = T; fn len(&self) -> usize { @@ -104,7 +109,7 @@ impl FlatMapInPlaceVec for Vec { } } -impl FlatMapInPlaceVec for ThinVec { +unsafe impl FlatMapInPlaceVec for ThinVec { type Elem = T; fn len(&self) -> usize { @@ -130,7 +135,7 @@ impl FlatMapInPlaceVec for ThinVec { } } -impl FlatMapInPlaceVec for SmallVec<[T; N]> { +unsafe impl FlatMapInPlaceVec for SmallVec<[T; N]> { type Elem = T; fn len(&self) -> usize { diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 9f1a20355f7de..aa1023f0e98a9 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -18,6 +18,7 @@ pub use rustc_ast::{ }; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::sorted_map::SortedMap; +use rustc_data_structures::steal::Steal; use rustc_data_structures::tagged_ptr::TaggedRef; use rustc_error_messages::{DiagArgValue, IntoDiagArg}; use rustc_index::IndexVec; @@ -1636,7 +1637,7 @@ pub struct OwnerInfo<'hir> { /// WARNING: The delayed lints are not hashed as a part of the `OwnerInfo`, and therefore /// should only be accessed in `eval_always` queries. #[stable_hasher(ignore)] - pub delayed_lints: DelayedLints, + pub delayed_lints: Steal, } impl<'tcx> OwnerInfo<'tcx> { diff --git a/compiler/rustc_hir_analysis/src/check/always_applicable.rs b/compiler/rustc_hir_analysis/src/check/always_applicable.rs index dbf5465ee18b3..689911000ea8c 100644 --- a/compiler/rustc_hir_analysis/src/check/always_applicable.rs +++ b/compiler/rustc_hir_analysis/src/check/always_applicable.rs @@ -217,16 +217,26 @@ fn ensure_all_fields_are_const_destruct<'tcx>( unreachable!() }; let field_ty = eff.trait_ref.self_ty(); - let diag = struct_span_code_err!( + let mut diag = struct_span_code_err!( tcx.dcx(), error.root_obligation.cause.span, E0367, "`{field_ty}` does not implement `[const] Destruct`", ) .with_span_note(impl_span, "required for this `Drop` impl"); - if field_ty.has_param() { - // FIXME: suggest adding `[const] Destruct` by teaching - // `suggest_restricting_param_bound` about const traits. + if field_ty.has_param() + && let Some(generics) = tcx.hir_node_by_def_id(impl_def_id).generics() + { + let destruct_def_id = tcx.lang_items().destruct_trait(); + ty::suggest_constraining_type_param( + tcx, + generics, + &mut diag, + &field_ty.to_string(), + "[const] Destruct", + destruct_def_id, + None, + ); } Err(diag.emit()) }) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index eba38cf24b346..16092926390fa 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -1041,7 +1041,7 @@ impl<'a, 'b, 'tcx> Diagnostic<'a, ()> for DiagCallback<'b, 'tcx> { pub fn emit_delayed_lints(tcx: TyCtxt<'_>) { for owner_id in tcx.hir_crate_items(()).delayed_lint_items() { if let Some(delayed_lints) = tcx.opt_ast_lowering_delayed_lints(owner_id) { - for lint in delayed_lints { + for lint in delayed_lints.steal() { tcx.emit_node_span_lint( lint.lint_id.lint, lint.id, @@ -1117,7 +1117,7 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { let hir_items = tcx.hir_crate_items(()); for owner_id in hir_items.owners() { if let Some(delayed_lints) = tcx.opt_ast_lowering_delayed_lints(owner_id) - && !delayed_lints.is_empty() + && !delayed_lints.borrow().is_empty() { // Assert that delayed_lint_items also picked up this item to have lints. assert!(hir_items.delayed_lint_items().any(|i| i == owner_id)); diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index 7c6ab642b2736..f0c367beefd65 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -274,7 +274,7 @@ rustc_queries! { /// /// This can be conveniently accessed by `tcx.hir_*` methods. /// Avoid calling this query directly. - query opt_ast_lowering_delayed_lints(key: hir::OwnerId) -> Option<&'tcx hir::lints::DelayedLints> { + query opt_ast_lowering_delayed_lints(key: hir::OwnerId) -> Option<&'tcx Steal> { desc { "getting AST lowering delayed lints in `{}`", tcx.def_path_str(key) } // This query has to be `no_hash` and `eval_always`, // because it accesses `delayed_lints` which is not hashed as part of the HIR diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs index 53706cc8202b4..0aff019fb865b 100644 --- a/compiler/rustc_middle/src/ty/layout.rs +++ b/compiler/rustc_middle/src/ty/layout.rs @@ -765,8 +765,8 @@ where tcx.mk_layout(LayoutData::uninhabited_variant(cx, variant_index, fields)) } - Variants::Multiple { ref variants, .. } => { - cx.tcx().mk_layout(variants[variant_index].clone()) + Variants::Multiple { .. } => { + cx.tcx().mk_layout(LayoutData::for_variant(&this, variant_index)) } }; diff --git a/compiler/rustc_public/src/unstable/convert/stable/abi.rs b/compiler/rustc_public/src/unstable/convert/stable/abi.rs index d8c4cee7abbe4..970a31d02d789 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/abi.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/abi.rs @@ -216,11 +216,8 @@ impl<'tcx> Stable<'tcx> for rustc_abi::Variants VariantFields { - offsets: offsets.iter().as_slice().stable(tables, cx), - }, - _ => panic!("variant layout should be Arbitrary"), + .map(|v| VariantFields { + offsets: v.field_offsets.iter().as_slice().stable(tables, cx), }) .collect(), } diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 0d6cd53dacab2..c46c042c886f7 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -25,8 +25,8 @@ use rustc_middle::traits::select::OverflowError; use rustc_middle::ty::abstract_const::NotConstEvaluatable; use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::print::{ - PrintPolyTraitPredicateExt, PrintTraitPredicateExt as _, PrintTraitRefExt as _, - with_forced_trimmed_paths, + PrintPolyTraitPredicateExt, PrintPolyTraitRefExt as _, PrintTraitPredicateExt as _, + PrintTraitRefExt as _, with_forced_trimmed_paths, }; use rustc_middle::ty::{ self, GenericArgKind, TraitRef, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, @@ -886,6 +886,23 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { ); } } + } else if let ty::Param(param) = trait_ref.self_ty().skip_binder().kind() + && let Some(generics) = + self.tcx.hir_node_by_def_id(main_obligation.cause.body_id).generics() + { + let constraint = ty::print::with_no_trimmed_paths!(format!( + "[const] {}", + trait_ref.map_bound(|tr| tr.trait_ref).print_trait_sugared(), + )); + ty::suggest_constraining_type_param( + self.tcx, + generics, + &mut diag, + param.name.as_str(), + &constraint, + Some(trait_ref.def_id()), + None, + ); } diag } @@ -2708,7 +2725,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { fn predicate_can_apply( &self, param_env: ty::ParamEnv<'tcx>, - pred: ty::PolyTraitPredicate<'tcx>, + pred: impl Upcast, ty::Predicate<'tcx>> + TypeFoldable>, ) -> bool { struct ParamToVarFolder<'a, 'tcx> { infcx: &'a InferCtxt<'tcx>, diff --git a/compiler/rustc_ty_utils/src/layout/invariant.rs b/compiler/rustc_ty_utils/src/layout/invariant.rs index a9edaa7371a88..8c07a7ec3d2de 100644 --- a/compiler/rustc_ty_utils/src/layout/invariant.rs +++ b/compiler/rustc_ty_utils/src/layout/invariant.rs @@ -302,10 +302,7 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou } } for variant in variants.iter() { - // No nested "multiple". - assert_matches!(variant.variants, Variants::Single { .. }); - // Variants should have the same or a smaller size as the full thing, - // and same for alignment. + // Variants should have the same or a smaller size as the full thing. if variant.size > layout.size { bug!( "Type with size {} bytes has variant with size {} bytes: {layout:#?}", @@ -313,18 +310,8 @@ pub(super) fn layout_sanity_check<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayou variant.size.bytes(), ) } - if variant.align.abi > layout.align.abi { - bug!( - "Type with alignment {} bytes has variant with alignment {} bytes: {layout:#?}", - layout.align.bytes(), - variant.align.bytes(), - ) - } // Skip empty variants. - if variant.size == Size::ZERO - || variant.fields.count() == 0 - || variant.is_uninhabited() - { + if variant.size == Size::ZERO || !variant.has_fields() || variant.is_uninhabited() { // These are never actually accessed anyway, so we can skip the coherence check // for them. They also fail that check, since they may have // a different ABI even when the main type is diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index 473c5f3e0faab..c545f521a6e1a 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -1073,6 +1073,8 @@ impl Builder<'_> { // rustc creates absolute paths (in part bc of the `rust-src` unremap // and for working directory) so let's remap the build directory as well. format!("{}={map_to}", self.build.src.display()), + // remap OUT_DIR so they don't leak into artifacts. + format!("{}={map_to}/out", self.build.out.display()), ] .join("\t"); cargo.env("RUSTC_DEBUGINFO_MAP", map); @@ -1093,6 +1095,8 @@ impl Builder<'_> { // rustc creates absolute paths (in part bc of the `rust-src` unremap // and for working directory) so let's remap the build directory as well. format!("{}={map_to}", self.build.src.display()), + // remap OUT_DIR so they don't leak into artifacts. + format!("{}={map_to}/out", self.build.out.display()), ] .join("\t"); cargo.env("RUSTC_DEBUGINFO_MAP", map); diff --git a/src/librustdoc/html/render/type_layout.rs b/src/librustdoc/html/render/type_layout.rs index e17058c4ca80c..c3a8582deaeee 100644 --- a/src/librustdoc/html/render/type_layout.rs +++ b/src/librustdoc/html/render/type_layout.rs @@ -54,7 +54,7 @@ pub(crate) fn document_type_layout(cx: &Context<'_>, ty_def_id: DefId) -> impl f span_bug!(tcx.def_span(ty_def_id), "not an adt") }; let name = adt.variant(variant_idx).name; - let is_unsized = variant_layout.is_unsized(); + let is_unsized = variant_layout.backend_repr.is_unsized(); let is_uninhabited = variant_layout.is_uninhabited(); let size = variant_layout.size.bytes() - tag_size; let type_layout_size = TypeLayoutSize { is_unsized, is_uninhabited, size }; diff --git a/tests/codegen-llvm/cffi/c-variadic-naked.rs b/tests/codegen-llvm/cffi/c-variadic-naked.rs index 5843628b6330a..caca6d327dd63 100644 --- a/tests/codegen-llvm/cffi/c-variadic-naked.rs +++ b/tests/codegen-llvm/cffi/c-variadic-naked.rs @@ -1,5 +1,5 @@ //@ needs-asm-support -//@ only-x86_64 +//@ needs-asm-mnemonic: ret // tests that `va_start` is not injected into naked functions diff --git a/tests/codegen-llvm/naked-fn/aligned.rs b/tests/codegen-llvm/naked-fn/aligned.rs index d7281c4219a10..8c4ac57a7bf90 100644 --- a/tests/codegen-llvm/naked-fn/aligned.rs +++ b/tests/codegen-llvm/naked-fn/aligned.rs @@ -1,6 +1,6 @@ //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 //@ needs-asm-support -//@ ignore-arm no "ret" mnemonic +//@ needs-asm-mnemonic: ret //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) #![crate_type = "lib"] diff --git a/tests/codegen-llvm/naked-fn/min-function-alignment.rs b/tests/codegen-llvm/naked-fn/min-function-alignment.rs index 406e9334fa59c..2619f4ef476a7 100644 --- a/tests/codegen-llvm/naked-fn/min-function-alignment.rs +++ b/tests/codegen-llvm/naked-fn/min-function-alignment.rs @@ -1,6 +1,6 @@ //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 -Zmin-function-alignment=16 //@ needs-asm-support -//@ ignore-arm no "ret" mnemonic +//@ needs-asm-mnemonic: ret //@ ignore-wasm32 aligning functions is not currently supported on wasm (#143368) // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity diff --git a/tests/run-make/raw-dylib-custom-dlltool/script.cmd b/tests/run-make/raw-dylib-custom-dlltool/script.cmd index 51834590be034..c88878151af48 100644 --- a/tests/run-make/raw-dylib-custom-dlltool/script.cmd +++ b/tests/run-make/raw-dylib-custom-dlltool/script.cmd @@ -1,2 +1,2 @@ -echo Called dlltool via script.cmd> actual.txt +echo Called dlltool via script.cmd> %~dp0\actual.txt dlltool.exe %* diff --git a/tests/run-make/raw-dylib-whitespace/main.rs b/tests/run-make/raw-dylib-whitespace/main.rs new file mode 100644 index 0000000000000..023c3570c3262 --- /dev/null +++ b/tests/run-make/raw-dylib-whitespace/main.rs @@ -0,0 +1,18 @@ +type BOOL = i32; + +#[cfg_attr( + target_arch = "x86", + link(name = "bcryptprimitives", kind = "raw-dylib", import_name_type = "undecorated") +)] +#[cfg_attr(not(target_arch = "x86"), link(name = "bcryptprimitives", kind = "raw-dylib"))] +extern "system" { + fn ProcessPrng(pbdata: *mut u8, cbdata: usize) -> BOOL; +} + +fn main() { + let mut num: u8 = 0; + unsafe { + ProcessPrng(&mut num, 1); + } + println!("{num}"); +} diff --git a/tests/run-make/raw-dylib-whitespace/rmake.rs b/tests/run-make/raw-dylib-whitespace/rmake.rs new file mode 100644 index 0000000000000..4f90eeb055142 --- /dev/null +++ b/tests/run-make/raw-dylib-whitespace/rmake.rs @@ -0,0 +1,15 @@ +// Ensure that raw-dylib still works if the output directory contains spaces. + +//@ only-windows-gnu +//@ ignore-cross-compile +//@ needs-dlltool +// Reason: this test specifically checks the dlltool feature, +// which is only used on windows-gnu. + +use run_make_support::{rfs, rustc}; + +fn main() { + let out_dir = std::path::absolute("path with spaces").unwrap(); + rfs::create_dir_all(&out_dir); + rustc().crate_type("bin").input("main.rs").out_dir(&out_dir).env("TMP", &out_dir).run(); +} diff --git a/tests/ui/consts/drop-impl-nonconst-drop-field.stderr b/tests/ui/consts/drop-impl-nonconst-drop-field.stderr index 0e626176579c6..5a81044dfadb7 100644 --- a/tests/ui/consts/drop-impl-nonconst-drop-field.stderr +++ b/tests/ui/consts/drop-impl-nonconst-drop-field.stderr @@ -21,6 +21,10 @@ note: required for this `Drop` impl | LL | impl const Drop for ConstDrop2 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: consider restricting type parameter `T` with unstable trait `Destruct` + | +LL | impl const Drop for ConstDrop2 { + | ++++++++++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/consts/trait_alias.fail.stderr b/tests/ui/consts/trait_alias.fail.stderr index 16675206a7a4b..62f5ab1a7d2cd 100644 --- a/tests/ui/consts/trait_alias.fail.stderr +++ b/tests/ui/consts/trait_alias.fail.stderr @@ -3,6 +3,11 @@ error[E0277]: the trait bound `T: [const] Baz` is not satisfied | LL | x.baz(); | ^^^ + | +help: consider further restricting type parameter `T` with trait `Baz` + | +LL | const fn foo(x: &T) { + | +++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/consts/trait_alias.next_fail.stderr b/tests/ui/consts/trait_alias.next_fail.stderr index 16675206a7a4b..62f5ab1a7d2cd 100644 --- a/tests/ui/consts/trait_alias.next_fail.stderr +++ b/tests/ui/consts/trait_alias.next_fail.stderr @@ -3,6 +3,11 @@ error[E0277]: the trait bound `T: [const] Baz` is not satisfied | LL | x.baz(); | ^^^ + | +help: consider further restricting type parameter `T` with trait `Baz` + | +LL | const fn foo(x: &T) { + | +++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/enum-discriminant/wrapping_niche.stderr b/tests/ui/enum-discriminant/wrapping_niche.stderr index 9b97ad4aeac7e..b24948fb39ddf 100644 --- a/tests/ui/enum-discriminant/wrapping_niche.stderr +++ b/tests/ui/enum-discriminant/wrapping_niche.stderr @@ -42,68 +42,35 @@ error: layout_of(UnsignedAroundZero) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 9885373149222004003, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 9885373149222004003, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 2, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 9885373149222004003, }, ], }, @@ -160,68 +127,35 @@ error: layout_of(SignedAroundZero) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 2684536712112553499, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 2684536712112553499, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 2, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: 2684536712112553499, }, ], }, diff --git a/tests/ui/layout/debug.stderr b/tests/ui/layout/debug.stderr index bfd2f7ec95da1..f08d1200b9fbc 100644 --- a/tests/ui/layout/debug.stderr +++ b/tests/ui/layout/debug.stderr @@ -58,55 +58,33 @@ error: layout_of(E) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(12 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(4 bytes), - Size(4 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - 2, - ], - }, + field_offsets: [ + Size(4 bytes), + Size(4 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + 2, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -242,11 +220,8 @@ error: layout_of(Result) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -263,28 +238,17 @@ error: layout_of(Result) = Layout { valid_range: 0..=4294967295, }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -301,22 +265,14 @@ error: layout_of(Result) = Layout { valid_range: 0..=4294967295, }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -662,32 +618,18 @@ error: layout_of(Option) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -697,14 +639,12 @@ error: layout_of(Option) = Layout { valid_range: 0..=1, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -716,12 +656,6 @@ error: layout_of(Option) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -782,32 +716,18 @@ error: layout_of(Option) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -817,14 +737,12 @@ error: layout_of(Option) = Layout { valid_range: 0..=1114111, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -836,12 +754,6 @@ error: layout_of(Option) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/layout/hexagon-enum.stderr b/tests/ui/layout/hexagon-enum.stderr index 20e0a8642a66f..993ff476b6b6c 100644 --- a/tests/ui/layout/hexagon-enum.stderr +++ b/tests/ui/layout/hexagon-enum.stderr @@ -42,26 +42,15 @@ error: layout_of(A) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -118,26 +107,15 @@ error: layout_of(B) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -194,26 +172,15 @@ error: layout_of(C) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: $SEED, }, ], }, @@ -270,26 +237,15 @@ error: layout_of(P) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -346,26 +302,15 @@ error: layout_of(T) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, 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 61cfcbdc07f75..7e6294f894c3e 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 @@ -48,11 +48,8 @@ error: layout_of(MissingPayloadField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -68,43 +65,24 @@ error: layout_of(MissingPayloadField) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -168,11 +146,8 @@ error: layout_of(CommonPayloadField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -189,28 +164,17 @@ error: layout_of(CommonPayloadField) = Layout { valid_range: 0..=255, }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -227,22 +191,14 @@ error: layout_of(CommonPayloadField) = Layout { valid_range: 0..=255, }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -305,11 +261,8 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -325,28 +278,17 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -362,22 +304,14 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -444,11 +378,8 @@ error: layout_of(NicheFirst) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -465,16 +396,14 @@ error: layout_of(NicheFirst) = Layout { valid_range: 0..=255, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - Size(1 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(0 bytes), + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -486,54 +415,26 @@ error: layout_of(NicheFirst) = Layout { }, ), uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 2, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -600,11 +501,8 @@ error: layout_of(NicheSecond) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -621,16 +519,14 @@ error: layout_of(NicheSecond) = Layout { valid_range: 0..=255, }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - Size(0 bytes), - ], - in_memory_order: [ - 1, - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + Size(0 bytes), + ], + fields_in_memory_order: [ + 1, + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -642,54 +538,26 @@ error: layout_of(NicheSecond) = Layout { }, ), uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 2, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/layout/issue-96185-overaligned-enum.stderr b/tests/ui/layout/issue-96185-overaligned-enum.stderr index 64e2f42c042f1..8937af2f5d494 100644 --- a/tests/ui/layout/issue-96185-overaligned-enum.stderr +++ b/tests/ui/layout/issue-96185-overaligned-enum.stderr @@ -36,51 +36,25 @@ error: layout_of(Aligned1) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -139,51 +113,25 @@ error: layout_of(Aligned2) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(1 bytes), - ), - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: Some( - Align(1 bytes), - ), - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/layout/thumb-enum.stderr b/tests/ui/layout/thumb-enum.stderr index a6e603652123b..200002490d5c5 100644 --- a/tests/ui/layout/thumb-enum.stderr +++ b/tests/ui/layout/thumb-enum.stderr @@ -42,26 +42,15 @@ error: layout_of(A) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -118,26 +107,15 @@ error: layout_of(B) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -194,26 +172,15 @@ error: layout_of(C) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: $SEED, }, ], }, @@ -270,26 +237,15 @@ error: layout_of(P) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -346,26 +302,15 @@ error: layout_of(T) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr index a29586f3bb2fa..6618f162853e5 100644 --- a/tests/ui/layout/zero-sized-array-enum-niche.stderr +++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr @@ -36,47 +36,31 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(1 bytes), @@ -88,12 +72,6 @@ error: layout_of(Result<[u32; 0], bool>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -144,72 +122,45 @@ error: layout_of(MultipleAlignments) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(2 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(2 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(2 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(2 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(1 bytes), @@ -221,12 +172,6 @@ error: layout_of(MultipleAlignments) = Layout { }, ), uninhabited: false, - variants: Single { - index: 2, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -277,47 +222,31 @@ error: layout_of(Result<[u32; 0], Packed>>) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(3 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(1 bytes), @@ -329,12 +258,6 @@ error: layout_of(Result<[u32; 0], Packed>>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -389,47 +312,31 @@ error: layout_of(Result<[u32; 0], Packed>) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -441,12 +348,6 @@ error: layout_of(Result<[u32; 0], Packed>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs index dac878c1cd992..ae326193550bc 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs +++ b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.rs @@ -7,7 +7,6 @@ //@ normalize-stderr: "[^ ]*/foo.dll_imports.lib" -> "$$LIB_FILE" //@ normalize-stderr: "-m [^ ]*" -> "$$TARGET_MACHINE" //@ normalize-stderr: "-f [^ ]*" -> "$$ASM_FLAGS" -//@ normalize-stderr: "--temp-prefix [^ ]*/foo.dll" -> "$$TEMP_PREFIX" #[link(name = "foo", kind = "raw-dylib")] extern "C" { // `@1` is an invalid name to export, as it usually indicates that something diff --git a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr index 6fcb07cf3882c..b7279f23e6676 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/dlltool-failed.stderr @@ -1,4 +1,4 @@ -error: dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore $TEMP_PREFIX: +error: dlltool could not create import library with $DLLTOOL -d $DEF_FILE -D foo.dll -l $LIB_FILE $TARGET_MACHINE $ASM_FLAGS --no-leading-underscore --temp-prefix foo.dll: $DLLTOOL: Syntax error in def file $DEF_FILE: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 62f6ec92d493c..28fafa7800305 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 @@ -42,11 +42,8 @@ error: layout_of(Univariant) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -56,22 +53,14 @@ error: layout_of(Univariant) = Layout { valid_range: 0..=0, }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -134,11 +123,8 @@ error: layout_of(TwoVariants) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -154,28 +140,17 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -191,22 +166,14 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -257,59 +224,35 @@ error: layout_of(DeadBranchHasOtherField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(8 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, 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 3e0efad974cd2..45193552b507f 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 @@ -42,11 +42,8 @@ error: layout_of(Univariant) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -56,22 +53,14 @@ error: layout_of(Univariant) = Layout { valid_range: 0..=0, }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -134,11 +123,8 @@ error: layout_of(TwoVariants) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -154,28 +140,17 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -191,22 +166,14 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -257,59 +224,35 @@ error: layout_of(DeadBranchHasOtherField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(8 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, 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 62f6ec92d493c..28fafa7800305 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 @@ -42,11 +42,8 @@ error: layout_of(Univariant) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -56,22 +53,14 @@ error: layout_of(Univariant) = Layout { valid_range: 0..=0, }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -134,11 +123,8 @@ error: layout_of(TwoVariants) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -154,28 +140,17 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -191,22 +166,14 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -257,59 +224,35 @@ error: layout_of(DeadBranchHasOtherField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(8 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, 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 62f6ec92d493c..28fafa7800305 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 @@ -42,11 +42,8 @@ error: layout_of(Univariant) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -56,22 +53,14 @@ error: layout_of(Univariant) = Layout { valid_range: 0..=0, }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -134,11 +123,8 @@ error: layout_of(TwoVariants) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -154,28 +140,17 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -191,22 +166,14 @@ error: layout_of(TwoVariants) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(4 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(4 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -257,59 +224,35 @@ error: layout_of(DeadBranchHasOtherField) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(8 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/repr/repr-c-int-dead-variants.stderr b/tests/ui/repr/repr-c-int-dead-variants.stderr index b25e4a9b7b6f5..c2f7fec38c81f 100644 --- a/tests/ui/repr/repr-c-int-dead-variants.stderr +++ b/tests/ui/repr/repr-c-int-dead-variants.stderr @@ -42,11 +42,8 @@ error: layout_of(UnivariantU8) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(1 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -56,22 +53,14 @@ error: layout_of(UnivariantU8) = Layout { valid_range: 0..=0, }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -134,11 +123,8 @@ error: layout_of(TwoVariantsU8) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -154,28 +140,17 @@ error: layout_of(TwoVariantsU8) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(2 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: ScalarPair( Initialized { value: Int( @@ -191,22 +166,14 @@ error: layout_of(TwoVariantsU8) = Layout { ), }, ), - fields: Arbitrary { - offsets: [ - Size(1 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(1 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, ], }, @@ -257,59 +224,35 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout { tag_encoding: Direct, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - Size(8 bytes), - ], - in_memory_order: [ - 0, - 1, - ], - }, + field_offsets: [ + Size(8 bytes), + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + 1, + ], largest_niche: None, uninhabited: true, - variants: Single { - index: 0, - }, - max_repr_align: Some( - Align(8 bytes), - ), - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(16 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [ - Size(8 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(8 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: None, uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr index 65c6f833ccea1..3e93ce8cbd7a6 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.yn.stderr @@ -15,6 +15,11 @@ error[E0277]: the trait bound `T: [const] Foo` is not satisfied | LL | x.a(); | ^ + | +help: consider further restricting type parameter `T` with trait `Foo` + | +LL | const fn foo(x: &T) { + | +++++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr index c17a67132116e..ea637e1ab8db8 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-2.yy.stderr @@ -3,6 +3,11 @@ error[E0277]: the trait bound `T: [const] Foo` is not satisfied | LL | x.a(); | ^ + | +help: consider further restricting type parameter `T` with trait `Foo` + | +LL | const fn foo(x: &T) { + | +++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr b/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr index 7b5a1f7a6a230..6fd236a0de4fe 100644 --- a/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr +++ b/tests/ui/traits/const-traits/super-traits-fail-3.yyn.stderr @@ -38,6 +38,11 @@ error[E0277]: the trait bound `T: [const] Foo` is not satisfied | LL | x.a(); | ^ + | +help: consider further restricting type parameter `T` with trait `Foo` + | +LL | const fn foo(x: &T) { + | +++++++++++++ error: aborting due to 4 previous errors diff --git a/tests/ui/type/pattern_types/non_null.stderr b/tests/ui/type/pattern_types/non_null.stderr index 9f27be86bff44..7d3e61770c2c7 100644 --- a/tests/ui/type/pattern_types/non_null.stderr +++ b/tests/ui/type/pattern_types/non_null.stderr @@ -86,32 +86,18 @@ error: layout_of(Option<(*const ()) is !null>) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(8 bytes), - align: AbiAlign { - abi: Align(8 bytes), - }, backend_repr: Scalar( Initialized { value: Pointer( @@ -122,14 +108,12 @@ error: layout_of(Option<(*const ()) is !null>) = Layout { valid_range: 1..=18446744073709551615, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -142,12 +126,6 @@ error: layout_of(Option<(*const ()) is !null>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(8 bytes), - randomization_seed: $SEED, }, ], }, diff --git a/tests/ui/type/pattern_types/range_patterns.stderr b/tests/ui/type/pattern_types/range_patterns.stderr index d0dad5648d76f..556376164d9a3 100644 --- a/tests/ui/type/pattern_types/range_patterns.stderr +++ b/tests/ui/type/pattern_types/range_patterns.stderr @@ -127,32 +127,18 @@ error: layout_of(Option<(u32) is 1..>) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -162,14 +148,12 @@ error: layout_of(Option<(u32) is 1..>) = Layout { valid_range: 1..=4294967295, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -181,12 +165,6 @@ error: layout_of(Option<(u32) is 1..>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], }, @@ -238,32 +216,18 @@ error: layout_of(Option>) = Layout { }, tag_field: 0, variants: [ - Layout { + VariantLayout { size: Size(0 bytes), - align: AbiAlign { - abi: Align(1 bytes), - }, backend_repr: Memory { sized: true, }, - fields: Arbitrary { - offsets: [], - in_memory_order: [], - }, + field_offsets: [], + fields_in_memory_order: [], largest_niche: None, uninhabited: false, - variants: Single { - index: 0, - }, - max_repr_align: None, - unadjusted_abi_align: Align(1 bytes), - randomization_seed: $SEED, }, - Layout { + VariantLayout { size: Size(4 bytes), - align: AbiAlign { - abi: Align(4 bytes), - }, backend_repr: Scalar( Initialized { value: Int( @@ -273,14 +237,12 @@ error: layout_of(Option>) = Layout { valid_range: 1..=4294967295, }, ), - fields: Arbitrary { - offsets: [ - Size(0 bytes), - ], - in_memory_order: [ - 0, - ], - }, + field_offsets: [ + Size(0 bytes), + ], + fields_in_memory_order: [ + 0, + ], largest_niche: Some( Niche { offset: Size(0 bytes), @@ -292,12 +254,6 @@ error: layout_of(Option>) = Layout { }, ), uninhabited: false, - variants: Single { - index: 1, - }, - max_repr_align: None, - unadjusted_abi_align: Align(4 bytes), - randomization_seed: $SEED, }, ], },