forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#126774 - nnethercote:fix-126751, r=oli-obk Fix another assertion failure for some Expect diagnostics. Very similar to rust-lang#126719. So much so that I added a new case to the test from that PR rather than creating a new one. r? `@oli-obk`
- Loading branch information
Showing
3 changed files
with
28 additions
and
6 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
12 changes: 12 additions & 0 deletions
12
tests/ui/lint/expect-future_breakage-crash-issue-126521.rs
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 |
---|---|---|
@@ -1,11 +1,23 @@ | ||
// This test covers similar crashes from both #126521 and #126751. | ||
|
||
macro_rules! foo { | ||
($val:ident) => { | ||
true; | ||
}; | ||
} | ||
|
||
macro_rules! bar { | ||
($val:ident) => { | ||
(5_i32.overflowing_sub(3)); | ||
}; | ||
} | ||
|
||
fn main() { | ||
#[expect(semicolon_in_expressions_from_macros)] | ||
//~^ ERROR the `#[expect]` attribute is an experimental feature | ||
let _ = foo!(x); | ||
|
||
#[expect(semicolon_in_expressions_from_macros)] | ||
//~^ ERROR the `#[expect]` attribute is an experimental feature | ||
let _ = bar!(x); | ||
} |
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