An unused output of some macros in std (e.g., format!()
) should produce a unused_must_use warning.
#126475
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
The
format!()
macro could probably expand to code containingstd::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
Anything else?
No response
The text was updated successfully, but these errors were encountered: