]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type/type-ascription-soundness.rs
Auto merge of #99443 - jam1garner:mips-virt-feature, r=nagisa
[rust.git] / src / test / ui / type / type-ascription-soundness.rs
1 // Type ascription doesn't lead to unsoundness
2
3 #![feature(type_ascription)]
4
5 fn main() {
6     let arr = &[1u8, 2, 3];
7     let ref x = arr: &[u8]; //~ ERROR mismatched types
8     let ref mut x = arr: &[u8]; //~ ERROR mismatched types
9     match arr: &[u8] { //~ ERROR mismatched types
10         ref x => {}
11     }
12     let _len = (arr: &[u8]).len(); //~ ERROR mismatched types
13 }