Error recovery for let with +=
This commit is contained in:
parent
48ff12acb1
commit
05d6531998
3 changed files with 42 additions and 35 deletions
|
|
@ -3,5 +3,6 @@
|
|||
fn main() {
|
||||
let a: i8 += 1;
|
||||
//~^ ERROR expected trait, found builtin type `i8`
|
||||
//~| ERROR can't reassign to a uninitialized variable
|
||||
let _ = a;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
error[E0067]: can't reassign to a uninitialized variable
|
||||
--> $DIR/let-binop-plus.rs:4:16
|
||||
|
|
||||
LL | let a: i8 += 1;
|
||||
| ^ help: replace with `=` to initialize the variable
|
||||
|
||||
error[E0404]: expected trait, found builtin type `i8`
|
||||
--> $DIR/let-binop-plus.rs:4:12
|
||||
|
|
||||
LL | let a: i8 += 1;
|
||||
| ^^ not a trait
|
||||
|
||||
error: aborting due to previous error
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0404`.
|
||||
Some errors have detailed explanations: E0067, E0404.
|
||||
For more information about an error, try `rustc --explain E0067`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue