about summary refs log tree commit diff
path: root/tests/ui/coercion/coercion-slice.rs
blob: a0795e8316f2986b0d67c0d0a900376e9297e8b7 (plain)
1
2
3
4
5
6
7
8
// Tests that we forbid coercion from `[T; n]` to `&[T]`

fn main() {
    let _: &[i32] = [0];
    //~^ ERROR mismatched types
    //~| NOTE expected `&[i32]`, found `[{integer}; 1]`
    //~| NOTE expected due to this
}