-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Lint #[must_use]
attributes applied to methods in trait impls
#136923
Conversation
The `#[must_use]` attribute has no effect when applied to methods in trait implementations.
r? @davidtwco rustbot has assigned @davidtwco. Use |
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. |
This comment has been minimized.
This comment has been minimized.
28aed9d
to
bb641bf
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
The `#[must_use]` attribute has no effect when applied to methods in trait implementations.
bb641bf
to
eaf1377
Compare
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.
LGTM with nit fixed
The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This case was not linted before.
eaf1377
to
e639e88
Compare
@bors r+ |
…=davidtwco Lint `#[must_use]` attributes applied to methods in trait impls The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused `#[must_use]` lint, and cleans the extra attributes in portable-simd and Clippy.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#120580 (Add `MAX_LEN_UTF8` and `MAX_LEN_UTF16` Constants) - rust-lang#132268 (Impl TryFrom<Vec<u8>> for String) - rust-lang#136093 (Match Ergonomics 2024: update old-edition behavior of feature gates) - rust-lang#136344 (Suggest replacing `.` with `::` in more error diagnostics.) - rust-lang#136690 (Use more explicit and reliable ptr select in sort impls) - rust-lang#136815 (CI: Stop /msys64/bin from being prepended to PATH in msys2 shell) - rust-lang#136923 (Lint `#[must_use]` attributes applied to methods in trait impls) - rust-lang#137155 (Organize `OsString`/`OsStr` shims) - rust-lang#137225 (vectorcall ABI: require SSE2) Failed merges: - rust-lang#136780 (std: move stdio to `sys`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#120580 (Add `MAX_LEN_UTF8` and `MAX_LEN_UTF16` Constants) - rust-lang#132268 (Impl TryFrom<Vec<u8>> for String) - rust-lang#136093 (Match Ergonomics 2024: update old-edition behavior of feature gates) - rust-lang#136344 (Suggest replacing `.` with `::` in more error diagnostics.) - rust-lang#136690 (Use more explicit and reliable ptr select in sort impls) - rust-lang#136815 (CI: Stop /msys64/bin from being prepended to PATH in msys2 shell) - rust-lang#136923 (Lint `#[must_use]` attributes applied to methods in trait impls) - rust-lang#137155 (Organize `OsString`/`OsStr` shims) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwco Lint `#[must_use]` attributes applied to methods in trait impls The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused `#[must_use]` lint, and cleans the extra attributes in portable-simd and Clippy.
# Objective - Fixed CI compilation failure on Rust Nightly 1.87 due to [this PR](rust-lang/rust#136923) ## Solution - Removed unused `#[must_use]` ## Testing - cargo +nightly check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
…=davidtwco Lint `#[must_use]` attributes applied to methods in trait impls The `#[must_use]` attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused `#[must_use]` lint, and cleans the extra attributes in portable-simd and Clippy.
The
#[must_use]
attribute has no effect when applied to methods in trait implementations. This PR adds it to the unused#[must_use]
lint, and cleans the extra attributes in portable-simd and Clippy.