Skip to content

Commit 5d7234a

Browse files
committed
Add test.
1 parent 0fbfc3e commit 5d7234a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ui/mir/unsize-trait.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Check that the interpreter does not ICE when trying to unsize `B` to `[u8]`.
2+
// This is a `build` test to ensure that const-prop-lint runs.
3+
// build-pass
4+
5+
#![feature(unsize)]
6+
7+
fn foo<B>(buffer: &mut [B; 2])
8+
where B: std::marker::Unsize<[u8]>,
9+
{
10+
let buffer: &[u8] = &buffer[0];
11+
}
12+
13+
fn main() {
14+
foo(&mut [[0], [5]]);
15+
}

0 commit comments

Comments
 (0)