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