Add a test for #26577

This commit is contained in:
varkor 2019-02-25 23:56:53 +00:00
parent 5917d9fc62
commit b4b8a6e0bb
2 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,10 @@
fn foo() -> i32 {
0
}
fn main() {
let x: i32 = {
//~^ ERROR mismatched types
foo(); //~ HELP consider removing this semicolon
};
}

View file

@ -0,0 +1,17 @@
error[E0308]: mismatched types
--> $DIR/block-expression-remove-semicolon.rs:6:18
|
LL | let x: i32 = {
| __________________^
LL | | //~^ ERROR mismatched types
LL | | foo(); //~ HELP consider removing this semicolon
| | - help: consider removing this semicolon
LL | | };
| |_____^ expected i32, found ()
|
= note: expected type `i32`
found type `()`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.