forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not consider using a semicolon inside of a different-crate macro
Fixes rust-lang#81943
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fn f<F: Fn(i32)>(f: F) { f(0); } | ||
fn main() { | ||
f(|x| dbg!(x)); //~ERROR | ||
f(|x| match x { tmp => { tmp } }); //~ERROR | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-81943.rs:3:9 | ||
| | ||
LL | f(|x| dbg!(x)); | ||
| ^^^^^^^ expected `()`, found `i32` | ||
| | ||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-81943.rs:4:28 | ||
| | ||
LL | f(|x| match x { tmp => { tmp } }); | ||
| -------------------^^^----- help: consider using a semicolon here | ||
| | | | ||
| | expected `()`, found `i32` | ||
| expected this to be `()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |