提交 b4b8a6e0 编写于 作者: V varkor

Add a test for #26577

上级 5917d9fc
fn foo() -> i32 {
0
}
fn main() {
let x: i32 = {
//~^ ERROR mismatched types
foo(); //~ HELP consider removing this semicolon
};
}
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`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册