Skip to content

Commit 16f276b

Browse files
committed
Add a test for rust-lang#26577
1 parent caa0799 commit 16f276b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fn foo() -> i32 {
2+
0
3+
}
4+
5+
fn main() {
6+
let x: i32 = {
7+
//~^ ERROR mismatched types
8+
foo(); //~ HELP consider removing this semicolon
9+
};
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/block-expression-remove-semicolon.rs:6:18
3+
|
4+
LL | let x: i32 = {
5+
| __________________^
6+
LL | | //~^ ERROR mismatched types
7+
LL | | foo(); //~ HELP consider removing this semicolon
8+
| | - help: consider removing this semicolon
9+
LL | | };
10+
| |_____^ expected i32, found ()
11+
|
12+
= note: expected type `i32`
13+
found type `()`
14+
15+
error: aborting due to previous error
16+
17+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)