unused_must_use lint after write!
fails to note its origin
#54288
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Consider the following code (play):
It generates the following warning:
which is almost, but not quite, what I expect to see.
Namely, I expect to see this:
which includes the useful
note: #[warn(unused_must_use)] on by default
As far as I can tell, the choice whether or not to include that note is based on the presence/absence of the earlier
write!
invocation.(Hypothesis: perhaps there is an occurrence of an unused must_use within that macros expansion that we are silencing, but even though it is silenced, it is erroneously counted in whatever mechanism we are using to avoid printing out multiple redundant instances of notes like
note: #[warn(unused_must_use)] on by default
?)The text was updated successfully, but these errors were encountered: