summaryrefslogtreecommitdiffstats
path: root/tests/ui/mir/unsize-trait.rs
blob: 45b5308c0938f58ff5d8fbb40b75d9857854e9d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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]]);
}