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

22 lines
770 B
Rust
Raw Normal View History

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