Skip to content

Commit 82f6bb3

Browse files
committed
Remove rustc_layout_scalar_valid_range attr from debuginfo
1 parent c018998 commit 82f6bb3

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/debuginfo/msvc-pretty-enums.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ enum NicheLayoutWithFields3 {
270270
F,
271271
}
272272

273-
#[rustc_layout_scalar_valid_range_start(340282366920938463463374607431768211454)]
274-
#[rustc_layout_scalar_valid_range_end(1)]
275273
#[repr(transparent)]
276-
struct Wrapping128(u128);
274+
struct Wrapping128(
275+
pattern_type!(u128 is 340282366920938463463374607431768211454..=u128::MAX | 0..=1),
276+
);
277277

278278
enum Wrapping128Niche {
279279
X(Wrapping128),
@@ -325,8 +325,11 @@ fn main() {
325325
let niche128_some = NonZero::new(123456i128);
326326
let niche128_none: Option<NonZero<i128>> = None;
327327

328-
let wrapping_niche128_untagged =
329-
unsafe { Wrapping128Niche::X(Wrapping128(340282366920938463463374607431768211454)) };
328+
let wrapping_niche128_untagged = unsafe {
329+
Wrapping128Niche::X(Wrapping128(unsafe {
330+
std::mem::transmute(340282366920938463463374607431768211454)
331+
}))
332+
};
330333
let wrapping_niche128_none1 = Wrapping128Niche::Y;
331334
let wrapping_niche128_none2 = Wrapping128Niche::Z;
332335

0 commit comments

Comments
 (0)