-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Later versions of rust mistake macros like https://crates.io/crates/contracts requires
as a panic message.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=babeae07316ceb37dd7291ff889e9ea3
<code>
The current output is:
warning: panic message contains braces
--> src/main.rs:4:16
|
4 | #[requires(key.starts_with('{'))]
| ^^^
|
= note: `#[warn(non_fmt_panic)]` on by default
= note: this message is not used as a format string, but will be in Rust 2021
help: add a "{}" format string to use the message literally
|
4 | #[requires("{}", key.starts_with('{'))]
| ^^^^^
Ideally the output should look like:
Nothing, it's not a panic message, it's an expression.
<proposed output>
Metadata
Metadata
Assignees
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.