Code
fn main() {
format!("{}", 1);
}
Current output
Desired output
warning: unused return value of `format!()` that must be used
Rationale 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
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