-
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
Enforce must_use
on associated types and RPITITs that have a must-use trait in bounds
#118504
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with T-lang approval
We discussed this in today's @rust-lang/lang meeting and agreed that this seemed like a clearly correct bugfix. Ship it. |
@bors r=WaffleLapkin |
@rustbot labels -I-lang-nominated As joshtriplett said, the consensus was to do this. Removing the nomination. |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#117981 (Remove deprecated `--check-cfg` syntax) - rust-lang#118177 (Suppress warnings in LLVM wrapper when targeting MSVC) - rust-lang#118317 (tip for define macro name after `macro_rules!`) - rust-lang#118504 (Enforce `must_use` on associated types and RPITITs that have a must-use trait in bounds) - rust-lang#118660 (rustc_arena: add `alloc_str`) - rust-lang#118681 (Fix is_foreign_item for StableMIR instance ) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#118504 - compiler-errors:must-use, r=WaffleLapkin Enforce `must_use` on associated types and RPITITs that have a must-use trait in bounds Warn when an RPITIT or (un-normalized) associated type with a `#[must_use]` trait in its bounds is unused. This is pending T-lang approval, since it changes the semantics of the `#[must_use]` attribute slightly, but I think it strictly catches more strange errors. I could also limit this to just RPITITs, but that seems less useful. Fixes rust-lang#118444
Warn when an RPITIT or (un-normalized) associated type with a
#[must_use]
trait in its bounds is unused.This is pending T-lang approval, since it changes the semantics of the
#[must_use]
attribute slightly, but I think it strictly catches more strange errors.I could also limit this to just RPITITs, but that seems less useful.
Fixes #118444