diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-04 12:15:01 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-20 22:53:40 +0100 |
| commit | 621661f8a63f2118f3add5c3d686d9a2b6f62e5e (patch) | |
| tree | 47dc0c057e2d7614102bb4406977e82f6b846230 /src/test/ui/parser | |
| parent | 49826845a9a32a1b0d4e5180e0c6f0bdf06f1196 (diff) | |
tweak var/auto/mut recovery
Diffstat (limited to 'src/test/ui/parser')
| -rw-r--r-- | src/test/ui/parser/issue-65257-invalid-var-decl-recovery.rs | 12 | ||||
| -rw-r--r-- | src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr | 44 |
2 files changed, 32 insertions, 24 deletions
diff --git a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.rs b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.rs index 7efc4174874..c1826f8caae 100644 --- a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.rs +++ b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.rs @@ -1,20 +1,20 @@ fn main() { auto n = 0;//~ ERROR invalid variable declaration - //~^ HELP to introduce a variable, write `let` instead of `auto` + //~^ HELP write `let` instead of `auto` to introduce a new variable auto m;//~ ERROR invalid variable declaration - //~^ HELP to introduce a variable, write `let` instead of `auto` + //~^ HELP write `let` instead of `auto` to introduce a new variable m = 0; var n = 0;//~ ERROR invalid variable declaration - //~^ HELP to introduce a variable, write `let` instead of `var` + //~^ HELP write `let` instead of `var` to introduce a new variable var m;//~ ERROR invalid variable declaration - //~^ HELP to introduce a variable, write `let` instead of `var` + //~^ HELP write `let` instead of `var` to introduce a new variable m = 0; mut n = 0;//~ ERROR invalid variable declaration - //~^ HELP missing `let` + //~^ HELP missing keyword mut var;//~ ERROR invalid variable declaration - //~^ HELP missing `let` + //~^ HELP missing keyword var = 0; let _recovery_witness: () = 0; //~ ERROR mismatched types diff --git a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr index 429c12265bd..ad72dd30542 100644 --- a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr +++ b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr @@ -2,49 +2,57 @@ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:2:5 | LL | auto n = 0; - | ----^^^^^^ - | | - | help: to introduce a variable, write `let` instead of `auto` + | ^^^^ + | +help: write `let` instead of `auto` to introduce a new variable + | +LL | let n = 0; + | ^^^ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:4:5 | LL | auto m; - | ----^^ - | | - | help: to introduce a variable, write `let` instead of `auto` + | ^^^^ + | +help: write `let` instead of `auto` to introduce a new variable + | +LL | let m; + | ^^^ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:8:5 | LL | var n = 0; - | ---^^^^^^ - | | - | help: to introduce a variable, write `let` instead of `var` + | ^^^ + | +help: write `let` instead of `var` to introduce a new variable + | +LL | let n = 0; + | ^^^ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:10:5 | LL | var m; - | ---^^ - | | - | help: to introduce a variable, write `let` instead of `var` + | ^^^ + | +help: write `let` instead of `var` to introduce a new variable + | +LL | let m; + | ^^^ error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5 | LL | mut n = 0; - | ---^^^^^^ - | | - | help: missing `let` + | ^^^ help: missing keyword: `let mut` error: invalid variable declaration --> $DIR/issue-65257-invalid-var-decl-recovery.rs:16:5 | LL | mut var; - | ---^^^^ - | | - | help: missing `let` + | ^^^ help: missing keyword: `let mut` error[E0308]: mismatched types --> $DIR/issue-65257-invalid-var-decl-recovery.rs:20:33 |
