mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Make mir dumps more readable
This commit is contained in:
parent
7877d86163
commit
fd6713fce1
@ -1740,6 +1740,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write {
|
||||
" as ",
|
||||
)?;
|
||||
}
|
||||
ty::Pat(base_ty, pat) => {
|
||||
self.pretty_print_const_scalar_int(int, *base_ty, print_ty)?;
|
||||
p!(write(" is {pat:?}"));
|
||||
}
|
||||
// Nontrivial types with scalar bit representation
|
||||
_ => {
|
||||
let print = |this: &mut Self| {
|
||||
|
@ -3,9 +3,9 @@
|
||||
fn main() -> () {
|
||||
let mut _0: ();
|
||||
scope 1 {
|
||||
debug x => const {transmute(0x00000002): (u32) is 1..=};
|
||||
debug x => const 2_u32 is 1..=;
|
||||
scope 2 {
|
||||
debug y => const {transmute(0x00000000): (u32) is 1..=};
|
||||
debug y => const 0_u32 is 1..=;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@ use std::pat::pattern_type;
|
||||
|
||||
// EMIT_MIR pattern_types.main.PreCodegen.after.mir
|
||||
fn main() {
|
||||
// CHECK: debug x => const {transmute(0x00000002): (u32) is 1..=}
|
||||
// CHECK: debug x => const 2_u32 is 1..=
|
||||
let x: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(2) };
|
||||
// CHECK: debug y => const {transmute(0x00000000): (u32) is 1..=}
|
||||
// CHECK: debug y => const 0_u32 is 1..=
|
||||
let y: pattern_type!(u32 is 1..) = unsafe { std::mem::transmute(0) };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user