]> git.proxmox.com Git - rustc.git/blob - tests/ui/mir/unsize-trait.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / ui / mir / unsize-trait.rs
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 }