Add test.

This commit is contained in:
Camille GILLOT 2023-03-05 20:55:29 +00:00
parent 0fbfc3e769
commit 5d7234abb6

View 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]]);
}