Adjust according to petrochenkov's review comments

This commit is contained in:
mibac138 2020-05-20 22:09:03 +02:00
parent 6ad24baf06
commit 98532a3090
4 changed files with 27 additions and 91 deletions

View file

@ -1,8 +0,0 @@
#![allow(bare_trait_objects)]
fn main() {
let a: i8 += 1;
//~^ ERROR expected trait, found builtin type `i8`
//~| ERROR can't reassign to an uninitialized variable
let _ = a;
}

View file

@ -1,16 +0,0 @@
error[E0067]: can't reassign to an uninitialized variable
--> $DIR/let-binop-plus.rs:4:16
|
LL | let a: i8 += 1;
| ^ help: 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 2 previous errors
Some errors have detailed explanations: E0067, E0404.
For more information about an error, try `rustc --explain E0067`.

View file

@ -1,39 +1,20 @@
error[E0067]: can't reassign to an uninitialized variable
error: can't reassign to an uninitialized variable
--> $DIR/let-binop.rs:2:15
|
LL | let a: i8 *= 1;
| ^^ help: initialize the variable
error[E0067]: can't reassign to an uninitialized variable
error: can't reassign to an uninitialized variable
--> $DIR/let-binop.rs:4:11
|
LL | let b += 1;
| ^^
|
help: initialize the variable
|
LL | let b = 1;
| ^
help: otherwise, reassign to a previously initialized variable
|
LL | b += 1;
| --
| ^^ help: initialize the variable
error[E0067]: can't reassign to an uninitialized variable
error: can't reassign to an uninitialized variable
--> $DIR/let-binop.rs:6:11
|
LL | let c *= 1;
| ^^
|
help: initialize the variable
|
LL | let c = 1;
| ^
help: otherwise, reassign to a previously initialized variable
|
LL | c *= 1;
| --
| ^^ help: initialize the variable
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0067`.