Add test showing how byte slices are printed in MIR

This commit is contained in:
Oliver Scherer 2019-04-11 11:11:11 +02:00
parent e694b63cd1
commit 264c149c89
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// compile-flags: -Z mir-opt-level=0
fn main() {
let x = b"foo";
let y = [5u8, b'x'];
}
// END RUST SOURCE
// START rustc.main.EraseRegions.after.mir
// ...
// _1 = const Scalar(Ptr(Pointer { alloc_id: AllocId(0), offset: Size { raw: 0 }, tag: () })) : &[u8; 3];
// ...
// _2 = [const 5u8, const 120u8];
// ...
// END rustc.main.EraseRegions.after.mir