-
- Notifications
You must be signed in to change notification settings - Fork 14.1k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Code
fn main() { format!("{}", 1); }Current output
No errors or warningsDesired output
warning: unused return value of `format!()` that must be usedRationale and extra context
The format!() macro could probably expand to code containing std::hint::must_use.
List of macros with similar issues:
cfg!()column!(),line!(),file!(),module_path!()concat!(),stringify!()env!(),option_env!()format!(),format_args!()include_bytes!(),include_str!()matches!()vec!()pin::pin!()
Other cases
No response
Rust Version
Nightly rust on playground: 1.81.0-nightly (2024-06-13 f1586001ace26df7cafe)Anything else?
No response
joboet
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.