mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Add test.
This commit is contained in:
parent
0fbfc3e769
commit
5d7234abb6
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…
Reference in New Issue
Block a user