]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issues/issue-65257-invalid-var-decl-recovery.rs
Rollup merge of #90023 - b-naber:postpone_const_eval_infer_vars, r=nikomatsakis
[rust.git] / src / test / ui / parser / issues / issue-65257-invalid-var-decl-recovery.rs
1 fn main() {
2     auto n = 0;//~ ERROR invalid variable declaration
3     //~^ HELP write `let` instead of `auto` to introduce a new variable
4     auto m;//~ ERROR invalid variable declaration
5     //~^ HELP write `let` instead of `auto` to introduce a new variable
6     m = 0;
7
8     var n = 0;//~ ERROR invalid variable declaration
9     //~^ HELP write `let` instead of `var` to introduce a new variable
10     var m;//~ ERROR invalid variable declaration
11     //~^ HELP write `let` instead of `var` to introduce a new variable
12     m = 0;
13
14     mut n = 0;//~ ERROR invalid variable declaration
15     //~^ HELP missing keyword
16     mut var;//~ ERROR invalid variable declaration
17     //~^ HELP missing keyword
18     var = 0;
19
20     let _recovery_witness: () = 0; //~ ERROR mismatched types
21 }