-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write!
is somehow masking the #[must_use]
on its result
#55516
Comments
This code compiles with warnings in Rust 1.28.0, but no warnings in Rust 1.29.0 fn main() {
use std::fmt::Write;
let mut example = String::new();
write!(&mut example, "{}", 42);
}
Potentially related to #54288. |
Expanding the macro and compiling does have the warning: fn main() {
use std::fmt::Write;
let mut example = String::new();
(&mut example).write_fmt(format_args!("{}", 42));
}
|
Seems related to #52467. |
/cc @alexcrichton |
Ah oops, definitely a mistake! I believe a fix for this would be to set |
Will #55240 also be fixed by this? |
enforce unused-must-use lint in macros Fixes #55516 by turning on the UNUSED_MUST_USE lint within macros.
Hat tip to @shepmaster for finding this
play
is not triggering the
#[must_use]
lint onResult
.The text was updated successfully, but these errors were encountered: