Add test.
This commit is contained in:
parent
0fbfc3e769
commit
5d7234abb6
1 changed files with 15 additions and 0 deletions
15
tests/ui/mir/unsize-trait.rs
Normal file
15
tests/ui/mir/unsize-trait.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Check that the interpreter does not ICE when trying to unsize `B` to `[u8]`.
|
||||
// This is a `build` test to ensure that const-prop-lint runs.
|
||||
// build-pass
|
||||
|
||||
#![feature(unsize)]
|
||||
|
||||
fn foo<B>(buffer: &mut [B; 2])
|
||||
where B: std::marker::Unsize<[u8]>,
|
||||
{
|
||||
let buffer: &[u8] = &buffer[0];
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo(&mut [[0], [5]]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue