Skip to content

Commit bf25c7d

Browse files
committed
Remove rustc_layout_scalar_valid_range attr from debuginfo
1 parent 39240fc commit bf25c7d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/debuginfo/msvc-pretty-enums.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232

233233
//@ cdb-command: dx c_style_i128_d
234234
//@ cdb-check: c_style_i128_d : D [Type: enum2$<msvc_pretty_enums::CStyleI128>]
235-
#![feature(rustc_attrs)]
235+
#![feature(pattern_types, pattern_type_macro)]
236236

237237
use std::num::NonZero;
238238

@@ -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+
std::pat::pattern_type!(u128 is 340282366920938463463374607431768211454..=u128::MAX | 0..=1),
276+
);
277277

278278
enum Wrapping128Niche {
279279
X(Wrapping128),
@@ -325,8 +325,9 @@ 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 = Wrapping128Niche::X(Wrapping128(unsafe {
329+
std::mem::transmute(340282366920938463463374607431768211454_u128)
330+
}));
330331
let wrapping_niche128_none1 = Wrapping128Niche::Y;
331332
let wrapping_niche128_none2 = Wrapping128Niche::Z;
332333

0 commit comments

Comments
 (0)