-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #56491 - euclio:assert-error, r=estebank
emit error with span for empty asserts Fixes #55547.
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
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,4 @@ | ||
fn main() { | ||
assert!(); //~ ERROR requires a boolean expression | ||
debug_assert!(); //~ ERROR requires a boolean expression | ||
} |
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,16 @@ | ||
error: macro requires a boolean expression as an argument | ||
--> $DIR/assert.rs:2:5 | ||
| | ||
LL | assert!(); //~ ERROR requires a boolean expression | ||
| ^^^^^^^^^^ boolean expression required | ||
|
||
error: macro requires a boolean expression as an argument | ||
--> $DIR/assert.rs:3:5 | ||
| | ||
LL | debug_assert!(); //~ ERROR requires a boolean expression | ||
| ^^^^^^^^^^^^^^^^ boolean expression required | ||
| | ||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) | ||
|
||
error: aborting due to 2 previous errors | ||
|