-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #123172 - cuviper:beta-next, r=cuviper
[beta] backports - Do not eat nested expressions' results in `MayContainYieldPoint` format args visitor #122680 - Fix heading anchors in doc pages. #122693 - Make `#[diagnostic::on_unimplemented]` format string parsing more robust #122402 r? cuviper
- Loading branch information
Showing
7 changed files
with
427 additions
and
56 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
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
45 changes: 45 additions & 0 deletions
45
tests/ui/diagnostic_namespace/on_unimplemented/broken_format.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#[diagnostic::on_unimplemented(message = "{{Test } thing")] | ||
//~^WARN unmatched `}` found | ||
//~|WARN unmatched `}` found | ||
trait ImportantTrait1 {} | ||
|
||
#[diagnostic::on_unimplemented(message = "Test {}")] | ||
//~^WARN positional format arguments are not allowed here | ||
//~|WARN positional format arguments are not allowed here | ||
trait ImportantTrait2 {} | ||
|
||
#[diagnostic::on_unimplemented(message = "Test {1:}")] | ||
//~^WARN positional format arguments are not allowed here | ||
//~|WARN positional format arguments are not allowed here | ||
trait ImportantTrait3 {} | ||
|
||
#[diagnostic::on_unimplemented(message = "Test {Self:123}")] | ||
//~^WARN invalid format specifier | ||
//~|WARN invalid format specifier | ||
trait ImportantTrait4 {} | ||
|
||
#[diagnostic::on_unimplemented(message = "Test {Self:!}")] | ||
//~^WARN expected `'}'`, found `'!'` | ||
//~|WARN expected `'}'`, found `'!'` | ||
//~|WARN unmatched `}` found | ||
//~|WARN unmatched `}` found | ||
trait ImportantTrait5 {} | ||
|
||
fn check_1(_: impl ImportantTrait1) {} | ||
fn check_2(_: impl ImportantTrait2) {} | ||
fn check_3(_: impl ImportantTrait3) {} | ||
fn check_4(_: impl ImportantTrait4) {} | ||
fn check_5(_: impl ImportantTrait5) {} | ||
|
||
fn main() { | ||
check_1(()); | ||
//~^ERROR {{Test } thing | ||
check_2(()); | ||
//~^ERROR Test {} | ||
check_3(()); | ||
//~^ERROR Test {1} | ||
check_4(()); | ||
//~^ERROR Test () | ||
check_5(()); | ||
//~^ERROR Test {Self:!} | ||
} |
Oops, something went wrong.