Add test showing how byte slices are printed in MIR
This commit is contained in:
parent
e694b63cd1
commit
264c149c89
15
src/test/mir-opt/byte_slice.rs
Normal file
15
src/test/mir-opt/byte_slice.rs
Normal 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
|
Loading…
Reference in New Issue
Block a user