Skip to content

Commit

Permalink
Add a test for rust-lang#26577
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Feb 27, 2019
1 parent 0976e5e commit 42a89c6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/ui/block-expression-remove-semicolon.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fn foo() -> i32 {
0
}

fn main() {
let x: i32 = {
//~^ ERROR mismatched types
foo(); //~ HELP consider removing this semicolon
};
}
17 changes: 17 additions & 0 deletions src/test/ui/block-expression-remove-semicolon.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 42a89c6

Please sign in to comment.