]> git.lizzy.rs Git - rust.git/blob - src/test/ui/array-slice-vec/suggest-array-length.rs
Rollup merge of #100796 - TaKO8Ki:remove-unnecessary-string-searching, r=compiler...
[rust.git] / src / test / ui / array-slice-vec / suggest-array-length.rs
1 // run-rustfix
2 #![allow(unused_variables, dead_code, non_upper_case_globals)]
3
4 fn main() {
5     const Foo: [i32; _] = [1, 2, 3];
6     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
7     //~| ERROR using `_` for array lengths is unstable
8     let foo: [i32; _] = [1, 2, 3];
9     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
10     //~| ERROR using `_` for array lengths is unstable
11     let bar: [i32; _] = [0; 3];
12     //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
13     //~| ERROR using `_` for array lengths is unstable
14 }