]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coercion/coercion-slice.rs
Rollup merge of #101388 - compiler-errors:issue-101376, r=fee1-dead
[rust.git] / src / test / ui / coercion / coercion-slice.rs
1 // Tests that we forbid coercion from `[T; n]` to `&[T]`
2
3 fn main() {
4     let _: &[i32] = [0];
5     //~^ ERROR mismatched types
6     //~| expected `&[i32]`, found array `[{integer}; 1]`
7 }