summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type/type-ascription-soundness.rs
blob: 08316cdcd35ec21c619c873b5677da12868ef859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Type ascription doesn't lead to unsoundness

#![feature(type_ascription)]

fn main() {
    let arr = &[1u8, 2, 3];
    let ref x = type_ascribe!(arr, &[u8]);      //~ ERROR mismatched types
    let ref mut x = type_ascribe!(arr, &[u8]);  //~ ERROR mismatched types
    match type_ascribe!(arr, &[u8]) {           //~ ERROR mismatched types
        ref x => {}
    }
    let _len = type_ascribe!(arr, &[u8]).len();              //~ ERROR mismatched types
}