rust/tests/ui/parser/issues/issue-65257-invalid-var-decl-recovery.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
770 B
Rust
Raw Normal View History

2019-12-03 11:08:19 -06:00
fn main() {
auto n = 0;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP write `let` instead of `auto` to introduce a new variable
2019-12-03 11:08:19 -06:00
auto m;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP write `let` instead of `auto` to introduce a new variable
2019-12-03 11:08:19 -06:00
m = 0;
var n = 0;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP write `let` instead of `var` to introduce a new variable
2019-12-03 11:08:19 -06:00
var m;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP write `let` instead of `var` to introduce a new variable
2019-12-03 11:08:19 -06:00
m = 0;
mut n = 0;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP missing keyword
2019-12-03 11:08:19 -06:00
mut var;//~ ERROR invalid variable declaration
2019-12-04 05:15:01 -06:00
//~^ HELP missing keyword
2019-12-03 11:08:19 -06:00
var = 0;
let _recovery_witness: () = 0; //~ ERROR mismatched types
}