Skip to content

Commit 264c149

Browse files
committed
Add test showing how byte slices are printed in MIR
1 parent e694b63 commit 264c149

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/test/mir-opt/byte_slice.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-flags: -Z mir-opt-level=0
2+
3+
fn main() {
4+
let x = b"foo";
5+
let y = [5u8, b'x'];
6+
}
7+
8+
// END RUST SOURCE
9+
// START rustc.main.EraseRegions.after.mir
10+
// ...
11+
// _1 = const Scalar(Ptr(Pointer { alloc_id: AllocId(0), offset: Size { raw: 0 }, tag: () })) : &[u8; 3];
12+
// ...
13+
// _2 = [const 5u8, const 120u8];
14+
// ...
15+
// END rustc.main.EraseRegions.after.mir

0 commit comments

Comments
 (0)