-
Notifications
You must be signed in to change notification settings - Fork 13.4k
write!
is somehow masking the #[must_use]
on its result
#55516
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
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? |
bors
added a commit
that referenced
this issue
Nov 4, 2018
enforce unused-must-use lint in macros Fixes #55516 by turning on the UNUSED_MUST_USE lint within macros.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
Uh oh!
There was an error while loading. Please reload this page.
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: