Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6b4590d

Browse files
committedJun 4, 2025·
Remove rustc's notion of "preferred" alignment AKA __alignof
In PR 90877 T-lang decided not to remove `intrinsics::pref_align_of`. However, the intrinsic and its supporting code 1. is a nightly feature, so can be removed at compiler/libs discretion 2. requires considerable effort in the compiler to support, as it necessarily complicates every single site reasoning about alignment 3. has been justified based on relevance to codegen, but it is only a requirement for C++ (not C, not Rust) stack frame layout for AIX, in ways Rust would not consider even with increased C++ interop 4. is only used by rustc to overalign some globals, not correctness 5. can be adequately replaced by other rules for globals, as it mostly affects alignments for a few types under 16 bytes of alignment 6. has only one clear benefactor: automating C -> Rust translation for GNU extensions like `__alignof` 7. such code was likely intended to be `alignof` or `_Alignof`, because the GNU extension is a "false friend" of the C keyword, which makes the choice to support such a mapping very questionable 8. makes it easy to do incorrect codegen in the compiler by its mere presence as usual Rust rules of alignment (e.g. `size == align * N`) do not hold with preferred alignment The implementation is clearly damaging the code quality of the compiler. Thus it is within the compiler team's purview to simply rip it out. If T-lang wishes to have this intrinsic restored for c2rust's benefit, it would have to use a radically different implementation that somehow does not cause internal incorrectness. Until then, remove the intrinsic and its supporting code, as one tool and an ill-considered GCC extension cannot justify risking correctness. Because we touch a fair amount of the compiler to change this at all, and unfortunately the duplication of AbiAndPrefAlign is deep-rooted, we keep an "AbiAlign" type which we can wean code off later.
1 parent 61413ae commit 6b4590d

32 files changed

+231
-445
lines changed
 

‎compiler/rustc_abi/src/layout.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_index::bit_set::BitMatrix;
88
use tracing::debug;
99

1010
use crate::{
11-
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
11+
AbiAlign, Align, BackendRepr, FieldsShape, HasDataLayout, IndexSlice, IndexVec, Integer,
1212
LayoutData, Niche, NonZeroUsize, Primitive, ReprOptions, Scalar, Size, StructKind, TagEncoding,
1313
Variants, WrappingRange,
1414
};
@@ -173,13 +173,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
173173
// Non-power-of-two vectors have padding up to the next power-of-two.
174174
// If we're a packed repr, remove the padding while keeping the alignment as close
175175
// to a vector as possible.
176-
(
177-
BackendRepr::Memory { sized: true },
178-
AbiAndPrefAlign {
179-
abi: Align::max_aligned_factor(size),
180-
pref: dl.llvmlike_vector_align(size).pref,
181-
},
182-
)
176+
(BackendRepr::Memory { sized: true }, AbiAlign { abi: Align::max_aligned_factor(size) })
183177
} else {
184178
(BackendRepr::SimdVector { element: e_repr, count }, dl.llvmlike_vector_align(size))
185179
};
@@ -435,13 +429,13 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
435429
}
436430

437431
if let Some(pack) = repr.pack {
438-
align = align.min(AbiAndPrefAlign::new(pack));
432+
align = align.min(AbiAlign::new(pack));
439433
}
440434
// The unadjusted ABI alignment does not include repr(align), but does include repr(pack).
441435
// See documentation on `LayoutS::unadjusted_abi_align`.
442436
let unadjusted_abi_align = align.abi;
443437
if let Some(repr_align) = repr.align {
444-
align = align.max(AbiAndPrefAlign::new(repr_align));
438+
align = align.max(AbiAlign::new(repr_align));
445439
}
446440
// `align` must not be modified after this, or `unadjusted_abi_align` could be inaccurate.
447441
let align = align;
@@ -1289,7 +1283,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
12891283
if let StructKind::Prefixed(prefix_size, prefix_align) = kind {
12901284
let prefix_align =
12911285
if let Some(pack) = pack { prefix_align.min(pack) } else { prefix_align };
1292-
align = align.max(AbiAndPrefAlign::new(prefix_align));
1286+
align = align.max(AbiAlign::new(prefix_align));
12931287
offset = prefix_size.align_to(prefix_align);
12941288
}
12951289
for &i in &inverse_memory_index {
@@ -1308,7 +1302,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
13081302

13091303
// Invariant: offset < dl.obj_size_bound() <= 1<<61
13101304
let field_align = if let Some(pack) = pack {
1311-
field.align.min(AbiAndPrefAlign::new(pack))
1305+
field.align.min(AbiAlign::new(pack))
13121306
} else {
13131307
field.align
13141308
};
@@ -1342,7 +1336,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
13421336
// See documentation on `LayoutS::unadjusted_abi_align`.
13431337
let unadjusted_abi_align = align.abi;
13441338
if let Some(repr_align) = repr.align {
1345-
align = align.max(AbiAndPrefAlign::new(repr_align));
1339+
align = align.max(AbiAlign::new(repr_align));
13461340
}
13471341
// `align` must not be modified after this point, or `unadjusted_abi_align` could be inaccurate.
13481342
let align = align;

‎compiler/rustc_abi/src/layout/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_data_structures::intern::Interned;
55
use rustc_macros::HashStable_Generic;
66

77
use crate::{
8-
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
8+
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
99
PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants,
1010
};
1111

@@ -93,7 +93,7 @@ impl<'a> Layout<'a> {
9393
self.0.0.largest_niche
9494
}
9595

96-
pub fn align(self) -> AbiAndPrefAlign {
96+
pub fn align(self) -> AbiAlign {
9797
self.0.0.align
9898
}
9999

‎compiler/rustc_abi/src/lib.rs

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -226,22 +226,22 @@ pub const MAX_SIMD_LANES: u64 = 1 << 0xF;
226226
#[derive(Debug, PartialEq, Eq)]
227227
pub struct TargetDataLayout {
228228
pub endian: Endian,
229-
pub i1_align: AbiAndPrefAlign,
230-
pub i8_align: AbiAndPrefAlign,
231-
pub i16_align: AbiAndPrefAlign,
232-
pub i32_align: AbiAndPrefAlign,
233-
pub i64_align: AbiAndPrefAlign,
234-
pub i128_align: AbiAndPrefAlign,
235-
pub f16_align: AbiAndPrefAlign,
236-
pub f32_align: AbiAndPrefAlign,
237-
pub f64_align: AbiAndPrefAlign,
238-
pub f128_align: AbiAndPrefAlign,
229+
pub i1_align: AbiAlign,
230+
pub i8_align: AbiAlign,
231+
pub i16_align: AbiAlign,
232+
pub i32_align: AbiAlign,
233+
pub i64_align: AbiAlign,
234+
pub i128_align: AbiAlign,
235+
pub f16_align: AbiAlign,
236+
pub f32_align: AbiAlign,
237+
pub f64_align: AbiAlign,
238+
pub f128_align: AbiAlign,
239239
pub pointer_size: Size,
240-
pub pointer_align: AbiAndPrefAlign,
241-
pub aggregate_align: AbiAndPrefAlign,
240+
pub pointer_align: AbiAlign,
241+
pub aggregate_align: AbiAlign,
242242

243243
/// Alignments for vector types.
244-
pub vector_align: Vec<(Size, AbiAndPrefAlign)>,
244+
pub vector_align: Vec<(Size, AbiAlign)>,
245245

246246
pub instruction_address_space: AddressSpace,
247247

@@ -257,22 +257,22 @@ impl Default for TargetDataLayout {
257257
let align = |bits| Align::from_bits(bits).unwrap();
258258
TargetDataLayout {
259259
endian: Endian::Big,
260-
i1_align: AbiAndPrefAlign::new(align(8)),
261-
i8_align: AbiAndPrefAlign::new(align(8)),
262-
i16_align: AbiAndPrefAlign::new(align(16)),
263-
i32_align: AbiAndPrefAlign::new(align(32)),
264-
i64_align: AbiAndPrefAlign { abi: align(32), pref: align(64) },
265-
i128_align: AbiAndPrefAlign { abi: align(32), pref: align(64) },
266-
f16_align: AbiAndPrefAlign::new(align(16)),
267-
f32_align: AbiAndPrefAlign::new(align(32)),
268-
f64_align: AbiAndPrefAlign::new(align(64)),
269-
f128_align: AbiAndPrefAlign::new(align(128)),
260+
i1_align: AbiAlign::new(align(8)),
261+
i8_align: AbiAlign::new(align(8)),
262+
i16_align: AbiAlign::new(align(16)),
263+
i32_align: AbiAlign::new(align(32)),
264+
i64_align: AbiAlign::new(align(32)),
265+
i128_align: AbiAlign::new(align(32)),
266+
f16_align: AbiAlign::new(align(16)),
267+
f32_align: AbiAlign::new(align(32)),
268+
f64_align: AbiAlign::new(align(64)),
269+
f128_align: AbiAlign::new(align(128)),
270270
pointer_size: Size::from_bits(64),
271-
pointer_align: AbiAndPrefAlign::new(align(64)),
272-
aggregate_align: AbiAndPrefAlign { abi: align(0), pref: align(64) },
271+
pointer_align: AbiAlign::new(align(64)),
272+
aggregate_align: AbiAlign { abi: align(8) },
273273
vector_align: vec![
274-
(Size::from_bits(64), AbiAndPrefAlign::new(align(64))),
275-
(Size::from_bits(128), AbiAndPrefAlign::new(align(128))),
274+
(Size::from_bits(64), AbiAlign::new(align(64))),
275+
(Size::from_bits(128), AbiAlign::new(align(128))),
276276
],
277277
instruction_address_space: AddressSpace::DATA,
278278
c_enum_min_size: Integer::I32,
@@ -330,8 +330,7 @@ impl TargetDataLayout {
330330
.map_err(|err| TargetDataLayoutErrors::InvalidAlignment { cause, err })
331331
};
332332
let abi = parse_bits(s[0], "alignment", cause)?;
333-
let pref = s.get(1).map_or(Ok(abi), |pref| parse_bits(pref, "alignment", cause))?;
334-
Ok(AbiAndPrefAlign { abi: align_from_bits(abi)?, pref: align_from_bits(pref)? })
333+
Ok(AbiAlign::new(align_from_bits(abi)?))
335334
};
336335

337336
let mut dl = TargetDataLayout::default();
@@ -426,7 +425,7 @@ impl TargetDataLayout {
426425

427426
/// psABI-mandated alignment for a vector type, if any
428427
#[inline]
429-
fn cabi_vector_align(&self, vec_size: Size) -> Option<AbiAndPrefAlign> {
428+
fn cabi_vector_align(&self, vec_size: Size) -> Option<AbiAlign> {
430429
self.vector_align
431430
.iter()
432431
.find(|(size, _align)| *size == vec_size)
@@ -435,8 +434,8 @@ impl TargetDataLayout {
435434

436435
/// an alignment resembling the one LLVM would pick for a vector
437436
#[inline]
438-
pub fn llvmlike_vector_align(&self, vec_size: Size) -> AbiAndPrefAlign {
439-
self.cabi_vector_align(vec_size).unwrap_or(AbiAndPrefAlign::new(
437+
pub fn llvmlike_vector_align(&self, vec_size: Size) -> AbiAlign {
438+
self.cabi_vector_align(vec_size).unwrap_or(AbiAlign::new(
440439
Align::from_bytes(vec_size.bytes().next_power_of_two()).unwrap(),
441440
))
442441
}
@@ -864,25 +863,24 @@ impl Align {
864863
/// It is of effectively no consequence for layout in structs and on the stack.
865864
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
866865
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
867-
pub struct AbiAndPrefAlign {
866+
pub struct AbiAlign {
868867
pub abi: Align,
869-
pub pref: Align,
870868
}
871869

872-
impl AbiAndPrefAlign {
870+
impl AbiAlign {
873871
#[inline]
874-
pub fn new(align: Align) -> AbiAndPrefAlign {
875-
AbiAndPrefAlign { abi: align, pref: align }
872+
pub fn new(align: Align) -> AbiAlign {
873+
AbiAlign { abi: align }
876874
}
877875

878876
#[inline]
879-
pub fn min(self, other: AbiAndPrefAlign) -> AbiAndPrefAlign {
880-
AbiAndPrefAlign { abi: self.abi.min(other.abi), pref: self.pref.min(other.pref) }
877+
pub fn min(self, other: AbiAlign) -> AbiAlign {
878+
AbiAlign { abi: self.abi.min(other.abi) }
881879
}
882880

883881
#[inline]
884-
pub fn max(self, other: AbiAndPrefAlign) -> AbiAndPrefAlign {
885-
AbiAndPrefAlign { abi: self.abi.max(other.abi), pref: self.pref.max(other.pref) }
882+
pub fn max(self, other: AbiAlign) -> AbiAlign {
883+
AbiAlign { abi: self.abi.max(other.abi) }
886884
}
887885
}
888886

@@ -945,7 +943,7 @@ impl Integer {
945943
}
946944
}
947945

948-
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign {
946+
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
949947
use Integer::*;
950948
let dl = cx.data_layout();
951949

@@ -1058,7 +1056,7 @@ impl Float {
10581056
}
10591057
}
10601058

1061-
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign {
1059+
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
10621060
use Float::*;
10631061
let dl = cx.data_layout();
10641062

@@ -1102,7 +1100,7 @@ impl Primitive {
11021100
}
11031101
}
11041102

1105-
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign {
1103+
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAlign {
11061104
use Primitive::*;
11071105
let dl = cx.data_layout();
11081106

@@ -1225,7 +1223,7 @@ impl Scalar {
12251223
}
12261224
}
12271225

1228-
pub fn align(self, cx: &impl HasDataLayout) -> AbiAndPrefAlign {
1226+
pub fn align(self, cx: &impl HasDataLayout) -> AbiAlign {
12291227
self.primitive().align(cx)
12301228
}
12311229

@@ -1731,7 +1729,7 @@ pub struct LayoutData<FieldIdx: Idx, VariantIdx: Idx> {
17311729
/// especially in the case of by-pointer struct returns, which allocate stack even when unused.
17321730
pub uninhabited: bool,
17331731

1734-
pub align: AbiAndPrefAlign,
1732+
pub align: AbiAlign,
17351733
pub size: Size,
17361734

17371735
/// The largest alignment explicitly requested with `repr(align)` on this type or any field.

‎compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,11 +812,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
812812
dest.write_cvalue(fx, val);
813813
}
814814

815-
sym::pref_align_of
816-
| sym::needs_drop
817-
| sym::type_id
818-
| sym::type_name
819-
| sym::variant_count => {
815+
sym::needs_drop | sym::type_id | sym::type_name | sym::variant_count => {
820816
intrinsic_args!(fx, args => (); intrinsic);
821817

822818
let const_val = fx

‎compiler/rustc_codegen_ssa/src/mir/intrinsic.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
151151
}
152152
value
153153
}
154-
sym::pref_align_of
155-
| sym::needs_drop
156-
| sym::type_id
157-
| sym::type_name
158-
| sym::variant_count => {
154+
sym::needs_drop | sym::type_id | sym::type_name | sym::variant_count => {
159155
let value = bx.tcx().const_eval_instance(bx.typing_env(), instance, span).unwrap();
160156
OperandRef::from_const(bx, value, result.layout.ty).immediate_or_packed_pair(bx)
161157
}

‎compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
5050
ensure_monomorphic_enough(tcx, tp_ty)?;
5151
ConstValue::from_bool(tp_ty.needs_drop(tcx, typing_env))
5252
}
53-
sym::pref_align_of => {
54-
// Correctly handles non-monomorphic calls, so there is no need for ensure_monomorphic_enough.
55-
let layout = tcx
56-
.layout_of(typing_env.as_query_input(tp_ty))
57-
.map_err(|e| err_inval!(Layout(*e)))?;
58-
ConstValue::from_target_usize(layout.align.pref.bytes(), &tcx)
59-
}
6053
sym::type_id => {
6154
ensure_monomorphic_enough(tcx, tp_ty)?;
6255
ConstValue::from_u128(tcx.type_id_hash(tp_ty).as_u128())
@@ -144,14 +137,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
144137
self.write_scalar(Scalar::from_target_usize(result, self), dest)?;
145138
}
146139

147-
sym::pref_align_of
148-
| sym::needs_drop
149-
| sym::type_id
150-
| sym::type_name
151-
| sym::variant_count => {
140+
sym::needs_drop | sym::type_id | sym::type_name | sym::variant_count => {
152141
let gid = GlobalId { instance, promoted: None };
153142
let ty = match intrinsic_name {
154-
sym::pref_align_of | sym::variant_count => self.tcx.types.usize,
143+
sym::variant_count => self.tcx.types.usize,
155144
sym::needs_drop => self.tcx.types.bool,
156145
sym::type_id => self.tcx.types.u128,
157146
sym::type_name => Ty::new_static_str(self.tcx.tcx),

‎compiler/rustc_feature/src/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ declare_features! (
207207
/// Allows exhaustive integer pattern matching with `usize::MAX`/`isize::MIN`/`isize::MAX`.
208208
(removed, precise_pointer_size_matching, "1.32.0", Some(56354),
209209
Some("removed in favor of half-open ranges")),
210+
(removed, pref_align_of, "CURRENT_RUSTC_VERSION", Some(91971),
211+
Some("removed due to marginal use and inducing compiler complications")),
210212
(removed, proc_macro_expr, "1.27.0", Some(54727),
211213
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
212214
(removed, proc_macro_gen, "1.27.0", Some(54727),

‎compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub(crate) fn check_intrinsic_type(
235235
sym::abort => (0, 0, vec![], tcx.types.never),
236236
sym::unreachable => (0, 0, vec![], tcx.types.never),
237237
sym::breakpoint => (0, 0, vec![], tcx.types.unit),
238-
sym::size_of | sym::pref_align_of | sym::min_align_of | sym::variant_count => {
238+
sym::size_of | sym::min_align_of | sym::variant_count => {
239239
(1, 0, vec![], tcx.types.usize)
240240
}
241241
sym::size_of_val | sym::min_align_of_val => {

‎library/core/src/intrinsics/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3485,15 +3485,6 @@ pub const fn size_of<T>() -> usize;
34853485
#[rustc_intrinsic]
34863486
pub const fn min_align_of<T>() -> usize;
34873487

3488-
/// The preferred alignment of a type.
3489-
///
3490-
/// This intrinsic does not have a stable counterpart.
3491-
/// It's "tracking issue" is [#91971](https://github.com/rust-lang/rust/issues/91971).
3492-
#[rustc_nounwind]
3493-
#[unstable(feature = "core_intrinsics", issue = "none")]
3494-
#[rustc_intrinsic]
3495-
pub const unsafe fn pref_align_of<T>() -> usize;
3496-
34973488
/// Returns the number of variants of the type `T` cast to a `usize`;
34983489
/// if `T` has no variants, returns `0`. Uninhabited variants will be counted.
34993490
///

‎tests/ui/abi/c-zst.aarch64-darwin.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -34,9 +33,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
3433
ty: (),
3534
layout: Layout {
3635
size: Size(0 bytes),
37-
align: AbiAndPrefAlign {
36+
align: AbiAlign {
3837
abi: $SOME_ALIGN,
39-
pref: $SOME_ALIGN,
4038
},
4139
backend_repr: Memory {
4240
sized: true,

‎tests/ui/abi/c-zst.powerpc-linux.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -45,9 +44,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
4544
ty: (),
4645
layout: Layout {
4746
size: Size(0 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: $SOME_ALIGN,
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Memory {
5351
sized: true,

‎tests/ui/abi/c-zst.s390x-linux.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -45,9 +44,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
4544
ty: (),
4645
layout: Layout {
4746
size: Size(0 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: $SOME_ALIGN,
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Memory {
5351
sized: true,

‎tests/ui/abi/c-zst.sparc64-linux.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -45,9 +44,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
4544
ty: (),
4645
layout: Layout {
4746
size: Size(0 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: $SOME_ALIGN,
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Memory {
5351
sized: true,

‎tests/ui/abi/c-zst.x86_64-linux.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -34,9 +33,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
3433
ty: (),
3534
layout: Layout {
3635
size: Size(0 bytes),
37-
align: AbiAndPrefAlign {
36+
align: AbiAlign {
3837
abi: $SOME_ALIGN,
39-
pref: $SOME_ALIGN,
4038
},
4139
backend_repr: Memory {
4240
sized: true,

‎tests/ui/abi/c-zst.x86_64-pc-windows-gnu.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -45,9 +44,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
4544
ty: (),
4645
layout: Layout {
4746
size: Size(0 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: $SOME_ALIGN,
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Memory {
5351
sized: true,

‎tests/ui/abi/debug.stderr

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(test) = FnAbi {
55
ty: u8,
66
layout: Layout {
77
size: Size(1 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Scalar(
1312
Initialized {
@@ -44,9 +43,8 @@ error: fn_abi_of(test) = FnAbi {
4443
ty: bool,
4544
layout: Layout {
4645
size: Size(1 bytes),
47-
align: AbiAndPrefAlign {
46+
align: AbiAlign {
4847
abi: $SOME_ALIGN,
49-
pref: $SOME_ALIGN,
5048
},
5149
backend_repr: Scalar(
5250
Initialized {
@@ -103,9 +101,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi {
103101
ty: bool,
104102
layout: Layout {
105103
size: Size(1 bytes),
106-
align: AbiAndPrefAlign {
104+
align: AbiAlign {
107105
abi: $SOME_ALIGN,
108-
pref: $SOME_ALIGN,
109106
},
110107
backend_repr: Scalar(
111108
Initialized {
@@ -151,9 +148,8 @@ error: fn_abi_of(TestFnPtr) = FnAbi {
151148
ty: u8,
152149
layout: Layout {
153150
size: Size(1 bytes),
154-
align: AbiAndPrefAlign {
151+
align: AbiAlign {
155152
abi: $SOME_ALIGN,
156-
pref: $SOME_ALIGN,
157153
},
158154
backend_repr: Scalar(
159155
Initialized {
@@ -201,9 +197,8 @@ error: fn_abi_of(test_generic) = FnAbi {
201197
ty: *const T,
202198
layout: Layout {
203199
size: $SOME_SIZE,
204-
align: AbiAndPrefAlign {
200+
align: AbiAlign {
205201
abi: $SOME_ALIGN,
206-
pref: $SOME_ALIGN,
207202
},
208203
backend_repr: Scalar(
209204
Initialized {
@@ -241,9 +236,8 @@ error: fn_abi_of(test_generic) = FnAbi {
241236
ty: (),
242237
layout: Layout {
243238
size: Size(0 bytes),
244-
align: AbiAndPrefAlign {
239+
align: AbiAlign {
245240
abi: $SOME_ALIGN,
246-
pref: $SOME_ALIGN,
247241
},
248242
backend_repr: Memory {
249243
sized: true,
@@ -288,9 +282,8 @@ error: ABIs are not compatible
288282
ty: u8,
289283
layout: Layout {
290284
size: Size(1 bytes),
291-
align: AbiAndPrefAlign {
285+
align: AbiAlign {
292286
abi: $SOME_ALIGN,
293-
pref: $SOME_ALIGN,
294287
},
295288
backend_repr: Scalar(
296289
Initialized {
@@ -327,9 +320,8 @@ error: ABIs are not compatible
327320
ty: (),
328321
layout: Layout {
329322
size: Size(0 bytes),
330-
align: AbiAndPrefAlign {
323+
align: AbiAlign {
331324
abi: $SOME_ALIGN,
332-
pref: $SOME_ALIGN,
333325
},
334326
backend_repr: Memory {
335327
sized: true,
@@ -362,9 +354,8 @@ error: ABIs are not compatible
362354
ty: u32,
363355
layout: Layout {
364356
size: $SOME_SIZE,
365-
align: AbiAndPrefAlign {
357+
align: AbiAlign {
366358
abi: $SOME_ALIGN,
367-
pref: $SOME_ALIGN,
368359
},
369360
backend_repr: Scalar(
370361
Initialized {
@@ -401,9 +392,8 @@ error: ABIs are not compatible
401392
ty: (),
402393
layout: Layout {
403394
size: Size(0 bytes),
404-
align: AbiAndPrefAlign {
395+
align: AbiAlign {
405396
abi: $SOME_ALIGN,
406-
pref: $SOME_ALIGN,
407397
},
408398
backend_repr: Memory {
409399
sized: true,
@@ -442,9 +432,8 @@ error: ABIs are not compatible
442432
ty: [u8; 32],
443433
layout: Layout {
444434
size: Size(32 bytes),
445-
align: AbiAndPrefAlign {
435+
align: AbiAlign {
446436
abi: $SOME_ALIGN,
447-
pref: $SOME_ALIGN,
448437
},
449438
backend_repr: Memory {
450439
sized: true,
@@ -482,9 +471,8 @@ error: ABIs are not compatible
482471
ty: (),
483472
layout: Layout {
484473
size: Size(0 bytes),
485-
align: AbiAndPrefAlign {
474+
align: AbiAlign {
486475
abi: $SOME_ALIGN,
487-
pref: $SOME_ALIGN,
488476
},
489477
backend_repr: Memory {
490478
sized: true,
@@ -517,9 +505,8 @@ error: ABIs are not compatible
517505
ty: [u32; 32],
518506
layout: Layout {
519507
size: Size(128 bytes),
520-
align: AbiAndPrefAlign {
508+
align: AbiAlign {
521509
abi: $SOME_ALIGN,
522-
pref: $SOME_ALIGN,
523510
},
524511
backend_repr: Memory {
525512
sized: true,
@@ -557,9 +544,8 @@ error: ABIs are not compatible
557544
ty: (),
558545
layout: Layout {
559546
size: Size(0 bytes),
560-
align: AbiAndPrefAlign {
547+
align: AbiAlign {
561548
abi: $SOME_ALIGN,
562-
pref: $SOME_ALIGN,
563549
},
564550
backend_repr: Memory {
565551
sized: true,
@@ -598,9 +584,8 @@ error: ABIs are not compatible
598584
ty: f32,
599585
layout: Layout {
600586
size: $SOME_SIZE,
601-
align: AbiAndPrefAlign {
587+
align: AbiAlign {
602588
abi: $SOME_ALIGN,
603-
pref: $SOME_ALIGN,
604589
},
605590
backend_repr: Scalar(
606591
Initialized {
@@ -636,9 +621,8 @@ error: ABIs are not compatible
636621
ty: (),
637622
layout: Layout {
638623
size: Size(0 bytes),
639-
align: AbiAndPrefAlign {
624+
align: AbiAlign {
640625
abi: $SOME_ALIGN,
641-
pref: $SOME_ALIGN,
642626
},
643627
backend_repr: Memory {
644628
sized: true,
@@ -671,9 +655,8 @@ error: ABIs are not compatible
671655
ty: u32,
672656
layout: Layout {
673657
size: $SOME_SIZE,
674-
align: AbiAndPrefAlign {
658+
align: AbiAlign {
675659
abi: $SOME_ALIGN,
676-
pref: $SOME_ALIGN,
677660
},
678661
backend_repr: Scalar(
679662
Initialized {
@@ -710,9 +693,8 @@ error: ABIs are not compatible
710693
ty: (),
711694
layout: Layout {
712695
size: Size(0 bytes),
713-
align: AbiAndPrefAlign {
696+
align: AbiAlign {
714697
abi: $SOME_ALIGN,
715-
pref: $SOME_ALIGN,
716698
},
717699
backend_repr: Memory {
718700
sized: true,
@@ -751,9 +733,8 @@ error: ABIs are not compatible
751733
ty: i32,
752734
layout: Layout {
753735
size: $SOME_SIZE,
754-
align: AbiAndPrefAlign {
736+
align: AbiAlign {
755737
abi: $SOME_ALIGN,
756-
pref: $SOME_ALIGN,
757738
},
758739
backend_repr: Scalar(
759740
Initialized {
@@ -790,9 +771,8 @@ error: ABIs are not compatible
790771
ty: (),
791772
layout: Layout {
792773
size: Size(0 bytes),
793-
align: AbiAndPrefAlign {
774+
align: AbiAlign {
794775
abi: $SOME_ALIGN,
795-
pref: $SOME_ALIGN,
796776
},
797777
backend_repr: Memory {
798778
sized: true,
@@ -825,9 +805,8 @@ error: ABIs are not compatible
825805
ty: u32,
826806
layout: Layout {
827807
size: $SOME_SIZE,
828-
align: AbiAndPrefAlign {
808+
align: AbiAlign {
829809
abi: $SOME_ALIGN,
830-
pref: $SOME_ALIGN,
831810
},
832811
backend_repr: Scalar(
833812
Initialized {
@@ -864,9 +843,8 @@ error: ABIs are not compatible
864843
ty: (),
865844
layout: Layout {
866845
size: Size(0 bytes),
867-
align: AbiAndPrefAlign {
846+
align: AbiAlign {
868847
abi: $SOME_ALIGN,
869-
pref: $SOME_ALIGN,
870848
},
871849
backend_repr: Memory {
872850
sized: true,
@@ -925,9 +903,8 @@ error: fn_abi_of(assoc_test) = FnAbi {
925903
ty: &S,
926904
layout: Layout {
927905
size: $SOME_SIZE,
928-
align: AbiAndPrefAlign {
906+
align: AbiAlign {
929907
abi: $SOME_ALIGN,
930-
pref: $SOME_ALIGN,
931908
},
932909
backend_repr: Scalar(
933910
Initialized {
@@ -977,9 +954,8 @@ error: fn_abi_of(assoc_test) = FnAbi {
977954
ty: (),
978955
layout: Layout {
979956
size: Size(0 bytes),
980-
align: AbiAndPrefAlign {
957+
align: AbiAlign {
981958
abi: $SOME_ALIGN,
982-
pref: $SOME_ALIGN,
983959
},
984960
backend_repr: Memory {
985961
sized: true,

‎tests/ui/abi/sysv64-zst.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
55
ty: (),
66
layout: Layout {
77
size: Size(0 bytes),
8-
align: AbiAndPrefAlign {
8+
align: AbiAlign {
99
abi: $SOME_ALIGN,
10-
pref: $SOME_ALIGN,
1110
},
1211
backend_repr: Memory {
1312
sized: true,
@@ -34,9 +33,8 @@ error: fn_abi_of(pass_zst) = FnAbi {
3433
ty: (),
3534
layout: Layout {
3635
size: Size(0 bytes),
37-
align: AbiAndPrefAlign {
36+
align: AbiAlign {
3837
abi: $SOME_ALIGN,
39-
pref: $SOME_ALIGN,
4038
},
4139
backend_repr: Memory {
4240
sized: true,

‎tests/ui/intrinsics/intrinsic-alignment.rs

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,34 @@ use std::intrinsics as rusti;
2323
mod m {
2424
#[cfg(target_arch = "x86")]
2525
pub fn main() {
26-
unsafe {
27-
assert_eq!(crate::rusti::pref_align_of::<u64>(), 8);
28-
assert_eq!(crate::rusti::min_align_of::<u64>(), 4);
29-
}
26+
assert_eq!(crate::rusti::min_align_of::<u64>(), 4);
3027
}
3128

3229
#[cfg(not(target_arch = "x86"))]
3330
pub fn main() {
34-
unsafe {
35-
assert_eq!(crate::rusti::pref_align_of::<u64>(), 8);
36-
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
37-
}
31+
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
3832
}
3933
}
4034

4135
#[cfg(target_env = "sgx")]
4236
mod m {
4337
#[cfg(target_arch = "x86_64")]
4438
pub fn main() {
45-
unsafe {
46-
assert_eq!(crate::rusti::pref_align_of::<u64>(), 8);
47-
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
48-
}
39+
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
4940
}
5041
}
5142

5243
#[cfg(target_os = "windows")]
5344
mod m {
5445
pub fn main() {
55-
unsafe {
56-
assert_eq!(crate::rusti::pref_align_of::<u64>(), 8);
57-
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
58-
}
46+
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
5947
}
6048
}
6149

6250
#[cfg(target_family = "wasm")]
6351
mod m {
6452
pub fn main() {
65-
unsafe {
66-
assert_eq!(crate::rusti::pref_align_of::<u64>(), 8);
67-
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
68-
}
53+
assert_eq!(crate::rusti::min_align_of::<u64>(), 8);
6954
}
7055
}
7156

‎tests/ui/layout/debug.stderr

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ LL | union EmptyUnion {}
66

77
error: layout_of(E) = Layout {
88
size: Size(12 bytes),
9-
align: AbiAndPrefAlign {
9+
align: AbiAlign {
1010
abi: Align(4 bytes),
11-
pref: $SOME_ALIGN,
1211
},
1312
backend_repr: Memory {
1413
sized: true,
@@ -45,9 +44,8 @@ error: layout_of(E) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(4 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(1 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Memory {
5351
sized: true,
@@ -67,9 +65,8 @@ error: layout_of(E) = Layout {
6765
},
6866
Layout {
6967
size: Size(12 bytes),
70-
align: AbiAndPrefAlign {
68+
align: AbiAlign {
7169
abi: Align(4 bytes),
72-
pref: $SOME_ALIGN,
7370
},
7471
backend_repr: Memory {
7572
sized: true,
@@ -108,9 +105,8 @@ LL | enum E { Foo, Bar(!, i32, i32) }
108105

109106
error: layout_of(S) = Layout {
110107
size: Size(8 bytes),
111-
align: AbiAndPrefAlign {
108+
align: AbiAlign {
112109
abi: Align(4 bytes),
113-
pref: $SOME_ALIGN,
114110
},
115111
backend_repr: ScalarPair(
116112
Initialized {
@@ -156,9 +152,8 @@ LL | struct S { f1: i32, f2: (), f3: i32 }
156152

157153
error: layout_of(U) = Layout {
158154
size: Size(8 bytes),
159-
align: AbiAndPrefAlign {
155+
align: AbiAlign {
160156
abi: Align(4 bytes),
161-
pref: $SOME_ALIGN,
162157
},
163158
backend_repr: Memory {
164159
sized: true,
@@ -182,9 +177,8 @@ LL | union U { f1: (i32, i32), f3: i32 }
182177

183178
error: layout_of(Result<i32, i32>) = Layout {
184179
size: Size(8 bytes),
185-
align: AbiAndPrefAlign {
180+
align: AbiAlign {
186181
abi: Align(4 bytes),
187-
pref: $SOME_ALIGN,
188182
},
189183
backend_repr: ScalarPair(
190184
Initialized {
@@ -234,9 +228,8 @@ error: layout_of(Result<i32, i32>) = Layout {
234228
variants: [
235229
Layout {
236230
size: Size(8 bytes),
237-
align: AbiAndPrefAlign {
231+
align: AbiAlign {
238232
abi: Align(4 bytes),
239-
pref: $SOME_ALIGN,
240233
},
241234
backend_repr: ScalarPair(
242235
Initialized {
@@ -273,9 +266,8 @@ error: layout_of(Result<i32, i32>) = Layout {
273266
},
274267
Layout {
275268
size: Size(8 bytes),
276-
align: AbiAndPrefAlign {
269+
align: AbiAlign {
277270
abi: Align(4 bytes),
278-
pref: $SOME_ALIGN,
279271
},
280272
backend_repr: ScalarPair(
281273
Initialized {
@@ -323,9 +315,8 @@ LL | type Test = Result<i32, i32>;
323315

324316
error: layout_of(i32) = Layout {
325317
size: Size(4 bytes),
326-
align: AbiAndPrefAlign {
318+
align: AbiAlign {
327319
abi: Align(4 bytes),
328-
pref: $SOME_ALIGN,
329320
},
330321
backend_repr: Scalar(
331322
Initialized {
@@ -353,9 +344,8 @@ LL | type T = impl std::fmt::Debug;
353344

354345
error: layout_of(V) = Layout {
355346
size: Size(2 bytes),
356-
align: AbiAndPrefAlign {
347+
align: AbiAlign {
357348
abi: Align(2 bytes),
358-
pref: $SOME_ALIGN,
359349
},
360350
backend_repr: Memory {
361351
sized: true,
@@ -379,9 +369,8 @@ LL | pub union V {
379369

380370
error: layout_of(W) = Layout {
381371
size: Size(2 bytes),
382-
align: AbiAndPrefAlign {
372+
align: AbiAlign {
383373
abi: Align(2 bytes),
384-
pref: $SOME_ALIGN,
385374
},
386375
backend_repr: Memory {
387376
sized: true,
@@ -405,9 +394,8 @@ LL | pub union W {
405394

406395
error: layout_of(Y) = Layout {
407396
size: Size(0 bytes),
408-
align: AbiAndPrefAlign {
397+
align: AbiAlign {
409398
abi: Align(2 bytes),
410-
pref: $SOME_ALIGN,
411399
},
412400
backend_repr: Memory {
413401
sized: true,
@@ -431,9 +419,8 @@ LL | pub union Y {
431419

432420
error: layout_of(P1) = Layout {
433421
size: Size(4 bytes),
434-
align: AbiAndPrefAlign {
422+
align: AbiAlign {
435423
abi: Align(1 bytes),
436-
pref: $SOME_ALIGN,
437424
},
438425
backend_repr: Memory {
439426
sized: true,
@@ -457,9 +444,8 @@ LL | union P1 { x: u32 }
457444

458445
error: layout_of(P2) = Layout {
459446
size: Size(8 bytes),
460-
align: AbiAndPrefAlign {
447+
align: AbiAlign {
461448
abi: Align(1 bytes),
462-
pref: $SOME_ALIGN,
463449
},
464450
backend_repr: Memory {
465451
sized: true,
@@ -483,9 +469,8 @@ LL | union P2 { x: (u32, u32) }
483469

484470
error: layout_of(P3) = Layout {
485471
size: Size(16 bytes),
486-
align: AbiAndPrefAlign {
472+
align: AbiAlign {
487473
abi: Align(1 bytes),
488-
pref: $SOME_ALIGN,
489474
},
490475
backend_repr: Memory {
491476
sized: true,
@@ -509,9 +494,8 @@ LL | union P3 { x: F32x4 }
509494

510495
error: layout_of(P4) = Layout {
511496
size: Size(12 bytes),
512-
align: AbiAndPrefAlign {
497+
align: AbiAlign {
513498
abi: Align(1 bytes),
514-
pref: $SOME_ALIGN,
515499
},
516500
backend_repr: Memory {
517501
sized: true,
@@ -535,9 +519,8 @@ LL | union P4 { x: E }
535519

536520
error: layout_of(P5) = Layout {
537521
size: Size(1 bytes),
538-
align: AbiAndPrefAlign {
522+
align: AbiAlign {
539523
abi: Align(1 bytes),
540-
pref: $SOME_ALIGN,
541524
},
542525
backend_repr: Scalar(
543526
Union {
@@ -566,9 +549,8 @@ LL | union P5 { zst: [u16; 0], byte: u8 }
566549

567550
error: layout_of(MaybeUninit<u8>) = Layout {
568551
size: Size(1 bytes),
569-
align: AbiAndPrefAlign {
552+
align: AbiAlign {
570553
abi: Align(1 bytes),
571-
pref: $SOME_ALIGN,
572554
},
573555
backend_repr: Scalar(
574556
Union {

‎tests/ui/layout/enum.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN }
1+
error: align: AbiAlign { abi: Align(2 bytes) }
22
--> $DIR/enum.rs:9:1
33
|
44
LL | enum UninhabitedVariantAlign {

‎tests/ui/layout/hexagon-enum.stderr

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(A) = Layout {
22
size: Size(1 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(1 bytes),
5-
pref: Align(1 bytes),
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(A) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(1 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(1 bytes),
50-
pref: Align(1 bytes),
5149
},
5250
backend_repr: Memory {
5351
sized: true,
@@ -78,9 +76,8 @@ LL | enum A { Apple }
7876

7977
error: layout_of(B) = Layout {
8078
size: Size(1 bytes),
81-
align: AbiAndPrefAlign {
79+
align: AbiAlign {
8280
abi: Align(1 bytes),
83-
pref: Align(1 bytes),
8481
},
8582
backend_repr: Scalar(
8683
Initialized {
@@ -123,9 +120,8 @@ error: layout_of(B) = Layout {
123120
variants: [
124121
Layout {
125122
size: Size(1 bytes),
126-
align: AbiAndPrefAlign {
123+
align: AbiAlign {
127124
abi: Align(1 bytes),
128-
pref: Align(1 bytes),
129125
},
130126
backend_repr: Memory {
131127
sized: true,
@@ -156,9 +152,8 @@ LL | enum B { Banana = 255, }
156152

157153
error: layout_of(C) = Layout {
158154
size: Size(2 bytes),
159-
align: AbiAndPrefAlign {
155+
align: AbiAlign {
160156
abi: Align(2 bytes),
161-
pref: Align(2 bytes),
162157
},
163158
backend_repr: Scalar(
164159
Initialized {
@@ -201,9 +196,8 @@ error: layout_of(C) = Layout {
201196
variants: [
202197
Layout {
203198
size: Size(2 bytes),
204-
align: AbiAndPrefAlign {
199+
align: AbiAlign {
205200
abi: Align(2 bytes),
206-
pref: Align(2 bytes),
207201
},
208202
backend_repr: Memory {
209203
sized: true,
@@ -234,9 +228,8 @@ LL | enum C { Chaenomeles = 256, }
234228

235229
error: layout_of(P) = Layout {
236230
size: Size(4 bytes),
237-
align: AbiAndPrefAlign {
231+
align: AbiAlign {
238232
abi: Align(4 bytes),
239-
pref: Align(4 bytes),
240233
},
241234
backend_repr: Scalar(
242235
Initialized {
@@ -279,9 +272,8 @@ error: layout_of(P) = Layout {
279272
variants: [
280273
Layout {
281274
size: Size(4 bytes),
282-
align: AbiAndPrefAlign {
275+
align: AbiAlign {
283276
abi: Align(4 bytes),
284-
pref: Align(4 bytes),
285277
},
286278
backend_repr: Memory {
287279
sized: true,
@@ -312,9 +304,8 @@ LL | enum P { Peach = 0x1000_0000isize, }
312304

313305
error: layout_of(T) = Layout {
314306
size: Size(4 bytes),
315-
align: AbiAndPrefAlign {
307+
align: AbiAlign {
316308
abi: Align(4 bytes),
317-
pref: Align(4 bytes),
318309
},
319310
backend_repr: Scalar(
320311
Initialized {
@@ -357,9 +348,8 @@ error: layout_of(T) = Layout {
357348
variants: [
358349
Layout {
359350
size: Size(4 bytes),
360-
align: AbiAndPrefAlign {
351+
align: AbiAlign {
361352
abi: Align(4 bytes),
362-
pref: Align(4 bytes),
363353
},
364354
backend_repr: Memory {
365355
sized: true,

‎tests/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(MissingPayloadField) = Layout {
22
size: Size(2 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(1 bytes),
5-
pref: $PREF_ALIGN,
65
},
76
backend_repr: ScalarPair(
87
Initialized {
@@ -51,9 +50,8 @@ error: layout_of(MissingPayloadField) = Layout {
5150
variants: [
5251
Layout {
5352
size: Size(2 bytes),
54-
align: AbiAndPrefAlign {
53+
align: AbiAlign {
5554
abi: Align(1 bytes),
56-
pref: $PREF_ALIGN,
5755
},
5856
backend_repr: ScalarPair(
5957
Initialized {
@@ -89,9 +87,8 @@ error: layout_of(MissingPayloadField) = Layout {
8987
},
9088
Layout {
9189
size: Size(1 bytes),
92-
align: AbiAndPrefAlign {
90+
align: AbiAlign {
9391
abi: Align(1 bytes),
94-
pref: $PREF_ALIGN,
9592
},
9693
backend_repr: Memory {
9794
sized: true,
@@ -122,9 +119,8 @@ LL | pub enum MissingPayloadField {
122119

123120
error: layout_of(CommonPayloadField) = Layout {
124121
size: Size(2 bytes),
125-
align: AbiAndPrefAlign {
122+
align: AbiAlign {
126123
abi: Align(1 bytes),
127-
pref: $PREF_ALIGN,
128124
},
129125
backend_repr: ScalarPair(
130126
Initialized {
@@ -174,9 +170,8 @@ error: layout_of(CommonPayloadField) = Layout {
174170
variants: [
175171
Layout {
176172
size: Size(2 bytes),
177-
align: AbiAndPrefAlign {
173+
align: AbiAlign {
178174
abi: Align(1 bytes),
179-
pref: $PREF_ALIGN,
180175
},
181176
backend_repr: ScalarPair(
182177
Initialized {
@@ -213,9 +208,8 @@ error: layout_of(CommonPayloadField) = Layout {
213208
},
214209
Layout {
215210
size: Size(2 bytes),
216-
align: AbiAndPrefAlign {
211+
align: AbiAlign {
217212
abi: Align(1 bytes),
218-
pref: $PREF_ALIGN,
219213
},
220214
backend_repr: ScalarPair(
221215
Initialized {
@@ -263,9 +257,8 @@ LL | pub enum CommonPayloadField {
263257

264258
error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
265259
size: Size(2 bytes),
266-
align: AbiAndPrefAlign {
260+
align: AbiAlign {
267261
abi: Align(1 bytes),
268-
pref: $PREF_ALIGN,
269262
},
270263
backend_repr: ScalarPair(
271264
Initialized {
@@ -314,9 +307,8 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
314307
variants: [
315308
Layout {
316309
size: Size(2 bytes),
317-
align: AbiAndPrefAlign {
310+
align: AbiAlign {
318311
abi: Align(1 bytes),
319-
pref: $PREF_ALIGN,
320312
},
321313
backend_repr: ScalarPair(
322314
Initialized {
@@ -352,9 +344,8 @@ error: layout_of(CommonPayloadFieldIsMaybeUninit) = Layout {
352344
},
353345
Layout {
354346
size: Size(2 bytes),
355-
align: AbiAndPrefAlign {
347+
align: AbiAlign {
356348
abi: Align(1 bytes),
357-
pref: $PREF_ALIGN,
358349
},
359350
backend_repr: ScalarPair(
360351
Initialized {
@@ -401,9 +392,8 @@ LL | pub enum CommonPayloadFieldIsMaybeUninit {
401392

402393
error: layout_of(NicheFirst) = Layout {
403394
size: Size(2 bytes),
404-
align: AbiAndPrefAlign {
395+
align: AbiAlign {
405396
abi: Align(1 bytes),
406-
pref: $PREF_ALIGN,
407397
},
408398
backend_repr: ScalarPair(
409399
Initialized {
@@ -456,9 +446,8 @@ error: layout_of(NicheFirst) = Layout {
456446
variants: [
457447
Layout {
458448
size: Size(2 bytes),
459-
align: AbiAndPrefAlign {
449+
align: AbiAlign {
460450
abi: Align(1 bytes),
461-
pref: $PREF_ALIGN,
462451
},
463452
backend_repr: ScalarPair(
464453
Initialized {
@@ -506,9 +495,8 @@ error: layout_of(NicheFirst) = Layout {
506495
},
507496
Layout {
508497
size: Size(0 bytes),
509-
align: AbiAndPrefAlign {
498+
align: AbiAlign {
510499
abi: Align(1 bytes),
511-
pref: $PREF_ALIGN,
512500
},
513501
backend_repr: Memory {
514502
sized: true,
@@ -528,9 +516,8 @@ error: layout_of(NicheFirst) = Layout {
528516
},
529517
Layout {
530518
size: Size(0 bytes),
531-
align: AbiAndPrefAlign {
519+
align: AbiAlign {
532520
abi: Align(1 bytes),
533-
pref: $PREF_ALIGN,
534521
},
535522
backend_repr: Memory {
536523
sized: true,
@@ -561,9 +548,8 @@ LL | pub enum NicheFirst {
561548

562549
error: layout_of(NicheSecond) = Layout {
563550
size: Size(2 bytes),
564-
align: AbiAndPrefAlign {
551+
align: AbiAlign {
565552
abi: Align(1 bytes),
566-
pref: $PREF_ALIGN,
567553
},
568554
backend_repr: ScalarPair(
569555
Initialized {
@@ -616,9 +602,8 @@ error: layout_of(NicheSecond) = Layout {
616602
variants: [
617603
Layout {
618604
size: Size(2 bytes),
619-
align: AbiAndPrefAlign {
605+
align: AbiAlign {
620606
abi: Align(1 bytes),
621-
pref: $PREF_ALIGN,
622607
},
623608
backend_repr: ScalarPair(
624609
Initialized {
@@ -666,9 +651,8 @@ error: layout_of(NicheSecond) = Layout {
666651
},
667652
Layout {
668653
size: Size(0 bytes),
669-
align: AbiAndPrefAlign {
654+
align: AbiAlign {
670655
abi: Align(1 bytes),
671-
pref: $PREF_ALIGN,
672656
},
673657
backend_repr: Memory {
674658
sized: true,
@@ -688,9 +672,8 @@ error: layout_of(NicheSecond) = Layout {
688672
},
689673
Layout {
690674
size: Size(0 bytes),
691-
align: AbiAndPrefAlign {
675+
align: AbiAlign {
692676
abi: Align(1 bytes),
693-
pref: $PREF_ALIGN,
694677
},
695678
backend_repr: Memory {
696679
sized: true,

‎tests/ui/layout/issue-96185-overaligned-enum.stderr

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Aligned1) = Layout {
22
size: Size(8 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(8 bytes),
5-
pref: $PREF_ALIGN,
65
},
76
backend_repr: Memory {
87
sized: true,
@@ -39,9 +38,8 @@ error: layout_of(Aligned1) = Layout {
3938
variants: [
4039
Layout {
4140
size: Size(8 bytes),
42-
align: AbiAndPrefAlign {
41+
align: AbiAlign {
4342
abi: Align(8 bytes),
44-
pref: $PREF_ALIGN,
4543
},
4644
backend_repr: Memory {
4745
sized: true,
@@ -63,9 +61,8 @@ error: layout_of(Aligned1) = Layout {
6361
},
6462
Layout {
6563
size: Size(8 bytes),
66-
align: AbiAndPrefAlign {
64+
align: AbiAlign {
6765
abi: Align(8 bytes),
68-
pref: $PREF_ALIGN,
6966
},
7067
backend_repr: Memory {
7168
sized: true,
@@ -100,9 +97,8 @@ LL | pub enum Aligned1 {
10097

10198
error: layout_of(Aligned2) = Layout {
10299
size: Size(1 bytes),
103-
align: AbiAndPrefAlign {
100+
align: AbiAlign {
104101
abi: Align(1 bytes),
105-
pref: $PREF_ALIGN,
106102
},
107103
backend_repr: Scalar(
108104
Initialized {
@@ -145,9 +141,8 @@ error: layout_of(Aligned2) = Layout {
145141
variants: [
146142
Layout {
147143
size: Size(1 bytes),
148-
align: AbiAndPrefAlign {
144+
align: AbiAlign {
149145
abi: Align(1 bytes),
150-
pref: $PREF_ALIGN,
151146
},
152147
backend_repr: Memory {
153148
sized: true,
@@ -169,9 +164,8 @@ error: layout_of(Aligned2) = Layout {
169164
},
170165
Layout {
171166
size: Size(1 bytes),
172-
align: AbiAndPrefAlign {
167+
align: AbiAlign {
173168
abi: Align(1 bytes),
174-
pref: $PREF_ALIGN,
175169
},
176170
backend_repr: Memory {
177171
sized: true,

‎tests/ui/layout/thumb-enum.stderr

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(A) = Layout {
22
size: Size(1 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(1 bytes),
5-
pref: Align(4 bytes),
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(A) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(1 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(1 bytes),
50-
pref: Align(4 bytes),
5149
},
5250
backend_repr: Memory {
5351
sized: true,
@@ -78,9 +76,8 @@ LL | enum A { Apple }
7876

7977
error: layout_of(B) = Layout {
8078
size: Size(1 bytes),
81-
align: AbiAndPrefAlign {
79+
align: AbiAlign {
8280
abi: Align(1 bytes),
83-
pref: Align(4 bytes),
8481
},
8582
backend_repr: Scalar(
8683
Initialized {
@@ -123,9 +120,8 @@ error: layout_of(B) = Layout {
123120
variants: [
124121
Layout {
125122
size: Size(1 bytes),
126-
align: AbiAndPrefAlign {
123+
align: AbiAlign {
127124
abi: Align(1 bytes),
128-
pref: Align(4 bytes),
129125
},
130126
backend_repr: Memory {
131127
sized: true,
@@ -156,9 +152,8 @@ LL | enum B { Banana = 255, }
156152

157153
error: layout_of(C) = Layout {
158154
size: Size(2 bytes),
159-
align: AbiAndPrefAlign {
155+
align: AbiAlign {
160156
abi: Align(2 bytes),
161-
pref: Align(4 bytes),
162157
},
163158
backend_repr: Scalar(
164159
Initialized {
@@ -201,9 +196,8 @@ error: layout_of(C) = Layout {
201196
variants: [
202197
Layout {
203198
size: Size(2 bytes),
204-
align: AbiAndPrefAlign {
199+
align: AbiAlign {
205200
abi: Align(2 bytes),
206-
pref: Align(4 bytes),
207201
},
208202
backend_repr: Memory {
209203
sized: true,
@@ -234,9 +228,8 @@ LL | enum C { Chaenomeles = 256, }
234228

235229
error: layout_of(P) = Layout {
236230
size: Size(4 bytes),
237-
align: AbiAndPrefAlign {
231+
align: AbiAlign {
238232
abi: Align(4 bytes),
239-
pref: Align(4 bytes),
240233
},
241234
backend_repr: Scalar(
242235
Initialized {
@@ -279,9 +272,8 @@ error: layout_of(P) = Layout {
279272
variants: [
280273
Layout {
281274
size: Size(4 bytes),
282-
align: AbiAndPrefAlign {
275+
align: AbiAlign {
283276
abi: Align(4 bytes),
284-
pref: Align(4 bytes),
285277
},
286278
backend_repr: Memory {
287279
sized: true,
@@ -312,9 +304,8 @@ LL | enum P { Peach = 0x1000_0000isize, }
312304

313305
error: layout_of(T) = Layout {
314306
size: Size(4 bytes),
315-
align: AbiAndPrefAlign {
307+
align: AbiAlign {
316308
abi: Align(4 bytes),
317-
pref: Align(4 bytes),
318309
},
319310
backend_repr: Scalar(
320311
Initialized {
@@ -357,9 +348,8 @@ error: layout_of(T) = Layout {
357348
variants: [
358349
Layout {
359350
size: Size(4 bytes),
360-
align: AbiAndPrefAlign {
351+
align: AbiAlign {
361352
abi: Align(4 bytes),
362-
pref: Align(4 bytes),
363353
},
364354
backend_repr: Memory {
365355
sized: true,

‎tests/ui/layout/zero-sized-array-enum-niche.stderr

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Result<[u32; 0], bool>) = Layout {
22
size: Size(4 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(4 bytes),
5-
pref: $PREF_ALIGN,
65
},
76
backend_repr: Memory {
87
sized: true,
@@ -39,9 +38,8 @@ error: layout_of(Result<[u32; 0], bool>) = Layout {
3938
variants: [
4039
Layout {
4140
size: Size(4 bytes),
42-
align: AbiAndPrefAlign {
41+
align: AbiAlign {
4342
abi: Align(4 bytes),
44-
pref: $PREF_ALIGN,
4543
},
4644
backend_repr: Memory {
4745
sized: true,
@@ -65,9 +63,8 @@ error: layout_of(Result<[u32; 0], bool>) = Layout {
6563
},
6664
Layout {
6765
size: Size(2 bytes),
68-
align: AbiAndPrefAlign {
66+
align: AbiAlign {
6967
abi: Align(1 bytes),
70-
pref: $PREF_ALIGN,
7168
},
7269
backend_repr: Memory {
7370
sized: true,
@@ -111,9 +108,8 @@ LL | type AlignedResult = Result<[u32; 0], bool>;
111108

112109
error: layout_of(MultipleAlignments) = Layout {
113110
size: Size(4 bytes),
114-
align: AbiAndPrefAlign {
111+
align: AbiAlign {
115112
abi: Align(4 bytes),
116-
pref: $PREF_ALIGN,
117113
},
118114
backend_repr: Memory {
119115
sized: true,
@@ -150,9 +146,8 @@ error: layout_of(MultipleAlignments) = Layout {
150146
variants: [
151147
Layout {
152148
size: Size(2 bytes),
153-
align: AbiAndPrefAlign {
149+
align: AbiAlign {
154150
abi: Align(2 bytes),
155-
pref: $PREF_ALIGN,
156151
},
157152
backend_repr: Memory {
158153
sized: true,
@@ -176,9 +171,8 @@ error: layout_of(MultipleAlignments) = Layout {
176171
},
177172
Layout {
178173
size: Size(4 bytes),
179-
align: AbiAndPrefAlign {
174+
align: AbiAlign {
180175
abi: Align(4 bytes),
181-
pref: $PREF_ALIGN,
182176
},
183177
backend_repr: Memory {
184178
sized: true,
@@ -202,9 +196,8 @@ error: layout_of(MultipleAlignments) = Layout {
202196
},
203197
Layout {
204198
size: Size(2 bytes),
205-
align: AbiAndPrefAlign {
199+
align: AbiAlign {
206200
abi: Align(1 bytes),
207-
pref: $PREF_ALIGN,
208201
},
209202
backend_repr: Memory {
210203
sized: true,
@@ -248,9 +241,8 @@ LL | enum MultipleAlignments {
248241

249242
error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout {
250243
size: Size(4 bytes),
251-
align: AbiAndPrefAlign {
244+
align: AbiAlign {
252245
abi: Align(4 bytes),
253-
pref: $PREF_ALIGN,
254246
},
255247
backend_repr: Memory {
256248
sized: true,
@@ -287,9 +279,8 @@ error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout {
287279
variants: [
288280
Layout {
289281
size: Size(4 bytes),
290-
align: AbiAndPrefAlign {
282+
align: AbiAlign {
291283
abi: Align(4 bytes),
292-
pref: $PREF_ALIGN,
293284
},
294285
backend_repr: Memory {
295286
sized: true,
@@ -313,9 +304,8 @@ error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout {
313304
},
314305
Layout {
315306
size: Size(3 bytes),
316-
align: AbiAndPrefAlign {
307+
align: AbiAlign {
317308
abi: Align(1 bytes),
318-
pref: $PREF_ALIGN,
319309
},
320310
backend_repr: Memory {
321311
sized: true,
@@ -359,9 +349,8 @@ LL | type NicheLosesToTagged = Result<[u32; 0], Packed<std::num::NonZero<u16>>>;
359349

360350
error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout {
361351
size: Size(4 bytes),
362-
align: AbiAndPrefAlign {
352+
align: AbiAlign {
363353
abi: Align(4 bytes),
364-
pref: $PREF_ALIGN,
365354
},
366355
backend_repr: Memory {
367356
sized: true,
@@ -402,9 +391,8 @@ error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout {
402391
variants: [
403392
Layout {
404393
size: Size(0 bytes),
405-
align: AbiAndPrefAlign {
394+
align: AbiAlign {
406395
abi: Align(4 bytes),
407-
pref: $PREF_ALIGN,
408396
},
409397
backend_repr: Memory {
410398
sized: true,
@@ -428,9 +416,8 @@ error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout {
428416
},
429417
Layout {
430418
size: Size(2 bytes),
431-
align: AbiAndPrefAlign {
419+
align: AbiAlign {
432420
abi: Align(1 bytes),
433-
pref: $PREF_ALIGN,
434421
},
435422
backend_repr: Memory {
436423
sized: true,

‎tests/ui/repr/repr-c-dead-variants.aarch64-unknown-linux-gnu.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Univariant) = Layout {
22
size: Size(4 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(4 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(Univariant) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(4 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(4 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Scalar(
5351
Initialized {
@@ -88,9 +86,8 @@ LL | enum Univariant {
8886

8987
error: layout_of(TwoVariants) = Layout {
9088
size: Size(8 bytes),
91-
align: AbiAndPrefAlign {
89+
align: AbiAlign {
9290
abi: Align(4 bytes),
93-
pref: $SOME_ALIGN,
9491
},
9592
backend_repr: ScalarPair(
9693
Initialized {
@@ -139,9 +136,8 @@ error: layout_of(TwoVariants) = Layout {
139136
variants: [
140137
Layout {
141138
size: Size(8 bytes),
142-
align: AbiAndPrefAlign {
139+
align: AbiAlign {
143140
abi: Align(4 bytes),
144-
pref: $SOME_ALIGN,
145141
},
146142
backend_repr: ScalarPair(
147143
Initialized {
@@ -177,9 +173,8 @@ error: layout_of(TwoVariants) = Layout {
177173
},
178174
Layout {
179175
size: Size(8 bytes),
180-
align: AbiAndPrefAlign {
176+
align: AbiAlign {
181177
abi: Align(4 bytes),
182-
pref: $SOME_ALIGN,
183178
},
184179
backend_repr: ScalarPair(
185180
Initialized {
@@ -226,9 +221,8 @@ LL | enum TwoVariants {
226221

227222
error: layout_of(DeadBranchHasOtherField) = Layout {
228223
size: Size(16 bytes),
229-
align: AbiAndPrefAlign {
224+
align: AbiAlign {
230225
abi: Align(8 bytes),
231-
pref: $SOME_ALIGN,
232226
},
233227
backend_repr: Memory {
234228
sized: true,
@@ -265,9 +259,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
265259
variants: [
266260
Layout {
267261
size: Size(16 bytes),
268-
align: AbiAndPrefAlign {
262+
align: AbiAlign {
269263
abi: Align(8 bytes),
270-
pref: $SOME_ALIGN,
271264
},
272265
backend_repr: Memory {
273266
sized: true,
@@ -295,9 +288,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
295288
},
296289
Layout {
297290
size: Size(16 bytes),
298-
align: AbiAndPrefAlign {
291+
align: AbiAlign {
299292
abi: Align(8 bytes),
300-
pref: $SOME_ALIGN,
301293
},
302294
backend_repr: Memory {
303295
sized: true,

‎tests/ui/repr/repr-c-dead-variants.armebv7r-none-eabi.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Univariant) = Layout {
22
size: Size(1 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(1 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(Univariant) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(1 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(1 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Scalar(
5351
Initialized {
@@ -88,9 +86,8 @@ LL | enum Univariant {
8886

8987
error: layout_of(TwoVariants) = Layout {
9088
size: Size(2 bytes),
91-
align: AbiAndPrefAlign {
89+
align: AbiAlign {
9290
abi: Align(1 bytes),
93-
pref: $SOME_ALIGN,
9491
},
9592
backend_repr: ScalarPair(
9693
Initialized {
@@ -139,9 +136,8 @@ error: layout_of(TwoVariants) = Layout {
139136
variants: [
140137
Layout {
141138
size: Size(2 bytes),
142-
align: AbiAndPrefAlign {
139+
align: AbiAlign {
143140
abi: Align(1 bytes),
144-
pref: $SOME_ALIGN,
145141
},
146142
backend_repr: ScalarPair(
147143
Initialized {
@@ -177,9 +173,8 @@ error: layout_of(TwoVariants) = Layout {
177173
},
178174
Layout {
179175
size: Size(2 bytes),
180-
align: AbiAndPrefAlign {
176+
align: AbiAlign {
181177
abi: Align(1 bytes),
182-
pref: $SOME_ALIGN,
183178
},
184179
backend_repr: ScalarPair(
185180
Initialized {
@@ -226,9 +221,8 @@ LL | enum TwoVariants {
226221

227222
error: layout_of(DeadBranchHasOtherField) = Layout {
228223
size: Size(16 bytes),
229-
align: AbiAndPrefAlign {
224+
align: AbiAlign {
230225
abi: Align(8 bytes),
231-
pref: $SOME_ALIGN,
232226
},
233227
backend_repr: Memory {
234228
sized: true,
@@ -265,9 +259,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
265259
variants: [
266260
Layout {
267261
size: Size(16 bytes),
268-
align: AbiAndPrefAlign {
262+
align: AbiAlign {
269263
abi: Align(8 bytes),
270-
pref: $SOME_ALIGN,
271264
},
272265
backend_repr: Memory {
273266
sized: true,
@@ -295,9 +288,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
295288
},
296289
Layout {
297290
size: Size(16 bytes),
298-
align: AbiAndPrefAlign {
291+
align: AbiAlign {
299292
abi: Align(8 bytes),
300-
pref: $SOME_ALIGN,
301293
},
302294
backend_repr: Memory {
303295
sized: true,

‎tests/ui/repr/repr-c-dead-variants.i686-pc-windows-msvc.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Univariant) = Layout {
22
size: Size(4 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(4 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(Univariant) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(4 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(4 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Scalar(
5351
Initialized {
@@ -88,9 +86,8 @@ LL | enum Univariant {
8886

8987
error: layout_of(TwoVariants) = Layout {
9088
size: Size(8 bytes),
91-
align: AbiAndPrefAlign {
89+
align: AbiAlign {
9290
abi: Align(4 bytes),
93-
pref: $SOME_ALIGN,
9491
},
9592
backend_repr: ScalarPair(
9693
Initialized {
@@ -139,9 +136,8 @@ error: layout_of(TwoVariants) = Layout {
139136
variants: [
140137
Layout {
141138
size: Size(8 bytes),
142-
align: AbiAndPrefAlign {
139+
align: AbiAlign {
143140
abi: Align(4 bytes),
144-
pref: $SOME_ALIGN,
145141
},
146142
backend_repr: ScalarPair(
147143
Initialized {
@@ -177,9 +173,8 @@ error: layout_of(TwoVariants) = Layout {
177173
},
178174
Layout {
179175
size: Size(8 bytes),
180-
align: AbiAndPrefAlign {
176+
align: AbiAlign {
181177
abi: Align(4 bytes),
182-
pref: $SOME_ALIGN,
183178
},
184179
backend_repr: ScalarPair(
185180
Initialized {
@@ -226,9 +221,8 @@ LL | enum TwoVariants {
226221

227222
error: layout_of(DeadBranchHasOtherField) = Layout {
228223
size: Size(16 bytes),
229-
align: AbiAndPrefAlign {
224+
align: AbiAlign {
230225
abi: Align(8 bytes),
231-
pref: $SOME_ALIGN,
232226
},
233227
backend_repr: Memory {
234228
sized: true,
@@ -265,9 +259,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
265259
variants: [
266260
Layout {
267261
size: Size(16 bytes),
268-
align: AbiAndPrefAlign {
262+
align: AbiAlign {
269263
abi: Align(8 bytes),
270-
pref: $SOME_ALIGN,
271264
},
272265
backend_repr: Memory {
273266
sized: true,
@@ -295,9 +288,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
295288
},
296289
Layout {
297290
size: Size(16 bytes),
298-
align: AbiAndPrefAlign {
291+
align: AbiAlign {
299292
abi: Align(8 bytes),
300-
pref: $SOME_ALIGN,
301293
},
302294
backend_repr: Memory {
303295
sized: true,

‎tests/ui/repr/repr-c-dead-variants.x86_64-unknown-linux-gnu.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(Univariant) = Layout {
22
size: Size(4 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(4 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(Univariant) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(4 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(4 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Scalar(
5351
Initialized {
@@ -88,9 +86,8 @@ LL | enum Univariant {
8886

8987
error: layout_of(TwoVariants) = Layout {
9088
size: Size(8 bytes),
91-
align: AbiAndPrefAlign {
89+
align: AbiAlign {
9290
abi: Align(4 bytes),
93-
pref: $SOME_ALIGN,
9491
},
9592
backend_repr: ScalarPair(
9693
Initialized {
@@ -139,9 +136,8 @@ error: layout_of(TwoVariants) = Layout {
139136
variants: [
140137
Layout {
141138
size: Size(8 bytes),
142-
align: AbiAndPrefAlign {
139+
align: AbiAlign {
143140
abi: Align(4 bytes),
144-
pref: $SOME_ALIGN,
145141
},
146142
backend_repr: ScalarPair(
147143
Initialized {
@@ -177,9 +173,8 @@ error: layout_of(TwoVariants) = Layout {
177173
},
178174
Layout {
179175
size: Size(8 bytes),
180-
align: AbiAndPrefAlign {
176+
align: AbiAlign {
181177
abi: Align(4 bytes),
182-
pref: $SOME_ALIGN,
183178
},
184179
backend_repr: ScalarPair(
185180
Initialized {
@@ -226,9 +221,8 @@ LL | enum TwoVariants {
226221

227222
error: layout_of(DeadBranchHasOtherField) = Layout {
228223
size: Size(16 bytes),
229-
align: AbiAndPrefAlign {
224+
align: AbiAlign {
230225
abi: Align(8 bytes),
231-
pref: $SOME_ALIGN,
232226
},
233227
backend_repr: Memory {
234228
sized: true,
@@ -265,9 +259,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
265259
variants: [
266260
Layout {
267261
size: Size(16 bytes),
268-
align: AbiAndPrefAlign {
262+
align: AbiAlign {
269263
abi: Align(8 bytes),
270-
pref: $SOME_ALIGN,
271264
},
272265
backend_repr: Memory {
273266
sized: true,
@@ -295,9 +288,8 @@ error: layout_of(DeadBranchHasOtherField) = Layout {
295288
},
296289
Layout {
297290
size: Size(16 bytes),
298-
align: AbiAndPrefAlign {
291+
align: AbiAlign {
299292
abi: Align(8 bytes),
300-
pref: $SOME_ALIGN,
301293
},
302294
backend_repr: Memory {
303295
sized: true,

‎tests/ui/repr/repr-c-int-dead-variants.stderr

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(UnivariantU8) = Layout {
22
size: Size(1 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(1 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -45,9 +44,8 @@ error: layout_of(UnivariantU8) = Layout {
4544
variants: [
4645
Layout {
4746
size: Size(1 bytes),
48-
align: AbiAndPrefAlign {
47+
align: AbiAlign {
4948
abi: Align(1 bytes),
50-
pref: $SOME_ALIGN,
5149
},
5250
backend_repr: Scalar(
5351
Initialized {
@@ -88,9 +86,8 @@ LL | enum UnivariantU8 {
8886

8987
error: layout_of(TwoVariantsU8) = Layout {
9088
size: Size(2 bytes),
91-
align: AbiAndPrefAlign {
89+
align: AbiAlign {
9290
abi: Align(1 bytes),
93-
pref: $SOME_ALIGN,
9491
},
9592
backend_repr: ScalarPair(
9693
Initialized {
@@ -139,9 +136,8 @@ error: layout_of(TwoVariantsU8) = Layout {
139136
variants: [
140137
Layout {
141138
size: Size(2 bytes),
142-
align: AbiAndPrefAlign {
139+
align: AbiAlign {
143140
abi: Align(1 bytes),
144-
pref: $SOME_ALIGN,
145141
},
146142
backend_repr: ScalarPair(
147143
Initialized {
@@ -177,9 +173,8 @@ error: layout_of(TwoVariantsU8) = Layout {
177173
},
178174
Layout {
179175
size: Size(2 bytes),
180-
align: AbiAndPrefAlign {
176+
align: AbiAlign {
181177
abi: Align(1 bytes),
182-
pref: $SOME_ALIGN,
183178
},
184179
backend_repr: ScalarPair(
185180
Initialized {
@@ -226,9 +221,8 @@ LL | enum TwoVariantsU8 {
226221

227222
error: layout_of(DeadBranchHasOtherFieldU8) = Layout {
228223
size: Size(16 bytes),
229-
align: AbiAndPrefAlign {
224+
align: AbiAlign {
230225
abi: Align(8 bytes),
231-
pref: $SOME_ALIGN,
232226
},
233227
backend_repr: Memory {
234228
sized: true,
@@ -265,9 +259,8 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout {
265259
variants: [
266260
Layout {
267261
size: Size(16 bytes),
268-
align: AbiAndPrefAlign {
262+
align: AbiAlign {
269263
abi: Align(8 bytes),
270-
pref: $SOME_ALIGN,
271264
},
272265
backend_repr: Memory {
273266
sized: true,
@@ -295,9 +288,8 @@ error: layout_of(DeadBranchHasOtherFieldU8) = Layout {
295288
},
296289
Layout {
297290
size: Size(16 bytes),
298-
align: AbiAndPrefAlign {
291+
align: AbiAlign {
299292
abi: Align(8 bytes),
300-
pref: $SOME_ALIGN,
301293
},
302294
backend_repr: Memory {
303295
sized: true,

‎tests/ui/type/pattern_types/or_patterns.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ LL | let _: NonNegOneI8 = -128;
4141

4242
error: layout_of((i8) is (i8::MIN..=-1 | 1..)) = Layout {
4343
size: Size(1 bytes),
44-
align: AbiAndPrefAlign {
44+
align: AbiAlign {
4545
abi: Align(1 bytes),
46-
pref: $SOME_ALIGN,
4746
},
4847
backend_repr: Scalar(
4948
Initialized {
@@ -80,9 +79,8 @@ LL | type NonNullI8 = pattern_type!(i8 is ..0 | 1..);
8079

8180
error: layout_of((i8) is (i8::MIN..=-2 | 0..)) = Layout {
8281
size: Size(1 bytes),
83-
align: AbiAndPrefAlign {
82+
align: AbiAlign {
8483
abi: Align(1 bytes),
85-
pref: $SOME_ALIGN,
8684
},
8785
backend_repr: Scalar(
8886
Initialized {

‎tests/ui/type/pattern_types/range_patterns.stderr

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
error: layout_of(NonZero<u32>) = Layout {
22
size: Size(4 bytes),
3-
align: AbiAndPrefAlign {
3+
align: AbiAlign {
44
abi: Align(4 bytes),
5-
pref: $SOME_ALIGN,
65
},
76
backend_repr: Scalar(
87
Initialized {
@@ -46,9 +45,8 @@ LL | type X = std::num::NonZeroU32;
4645

4746
error: layout_of((u32) is 1..) = Layout {
4847
size: Size(4 bytes),
49-
align: AbiAndPrefAlign {
48+
align: AbiAlign {
5049
abi: Align(4 bytes),
51-
pref: $SOME_ALIGN,
5250
},
5351
backend_repr: Scalar(
5452
Initialized {
@@ -85,9 +83,8 @@ LL | type Y = pattern_type!(u32 is 1..);
8583

8684
error: layout_of(Option<(u32) is 1..>) = Layout {
8785
size: Size(4 bytes),
88-
align: AbiAndPrefAlign {
86+
align: AbiAlign {
8987
abi: Align(4 bytes),
90-
pref: $SOME_ALIGN,
9188
},
9289
backend_repr: Scalar(
9390
Initialized {
@@ -125,9 +122,8 @@ error: layout_of(Option<(u32) is 1..>) = Layout {
125122
variants: [
126123
Layout {
127124
size: Size(0 bytes),
128-
align: AbiAndPrefAlign {
125+
align: AbiAlign {
129126
abi: Align(1 bytes),
130-
pref: $SOME_ALIGN,
131127
},
132128
backend_repr: Memory {
133129
sized: true,
@@ -147,9 +143,8 @@ error: layout_of(Option<(u32) is 1..>) = Layout {
147143
},
148144
Layout {
149145
size: Size(4 bytes),
150-
align: AbiAndPrefAlign {
146+
align: AbiAlign {
151147
abi: Align(4 bytes),
152-
pref: $SOME_ALIGN,
153148
},
154149
backend_repr: Scalar(
155150
Initialized {
@@ -199,9 +194,8 @@ LL | type Z = Option<pattern_type!(u32 is 1..)>;
199194

200195
error: layout_of(Option<NonZero<u32>>) = Layout {
201196
size: Size(4 bytes),
202-
align: AbiAndPrefAlign {
197+
align: AbiAlign {
203198
abi: Align(4 bytes),
204-
pref: $SOME_ALIGN,
205199
},
206200
backend_repr: Scalar(
207201
Initialized {
@@ -239,9 +233,8 @@ error: layout_of(Option<NonZero<u32>>) = Layout {
239233
variants: [
240234
Layout {
241235
size: Size(0 bytes),
242-
align: AbiAndPrefAlign {
236+
align: AbiAlign {
243237
abi: Align(1 bytes),
244-
pref: $SOME_ALIGN,
245238
},
246239
backend_repr: Memory {
247240
sized: true,
@@ -261,9 +254,8 @@ error: layout_of(Option<NonZero<u32>>) = Layout {
261254
},
262255
Layout {
263256
size: Size(4 bytes),
264-
align: AbiAndPrefAlign {
257+
align: AbiAlign {
265258
abi: Align(4 bytes),
266-
pref: $SOME_ALIGN,
267259
},
268260
backend_repr: Scalar(
269261
Initialized {
@@ -313,9 +305,8 @@ LL | type A = Option<std::num::NonZeroU32>;
313305

314306
error: layout_of(NonZeroU32New) = Layout {
315307
size: Size(4 bytes),
316-
align: AbiAndPrefAlign {
308+
align: AbiAlign {
317309
abi: Align(4 bytes),
318-
pref: $SOME_ALIGN,
319310
},
320311
backend_repr: Scalar(
321312
Initialized {
@@ -387,9 +378,8 @@ LL | type WRAP2 = pattern_type!(u32 is 5..2);
387378

388379
error: layout_of((i8) is -10..=10) = Layout {
389380
size: Size(1 bytes),
390-
align: AbiAndPrefAlign {
381+
align: AbiAlign {
391382
abi: Align(1 bytes),
392-
pref: $SOME_ALIGN,
393383
},
394384
backend_repr: Scalar(
395385
Initialized {
@@ -426,9 +416,8 @@ LL | type SIGN = pattern_type!(i8 is -10..=10);
426416

427417
error: layout_of((i8) is i8::MIN..=0) = Layout {
428418
size: Size(1 bytes),
429-
align: AbiAndPrefAlign {
419+
align: AbiAlign {
430420
abi: Align(1 bytes),
431-
pref: $SOME_ALIGN,
432421
},
433422
backend_repr: Scalar(
434423
Initialized {

0 commit comments

Comments
 (0)
Please sign in to comment.