-
Notifications
You must be signed in to change notification settings - Fork 14k
Remove more #[must_use] from portable-simd
#148841
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
Merged
Merged
+0
−4
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warning: `#[must_use]` attribute cannot be used on trait methods in impl blocks
--> crates/core_simd/src/masks/bitmask.rs:173:5
|
173 | #[must_use = "method returns a new mask and does not mutate the original value"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, traits, and unions
= note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default
warning: `#[must_use]` attribute cannot be used on trait methods in impl blocks
--> crates/core_simd/src/masks/bitmask.rs:190:5
|
190 | #[must_use = "method returns a new mask and does not mutate the original value"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, traits, and unions
warning: `#[must_use]` attribute cannot be used on trait methods in impl blocks
--> crates/core_simd/src/masks/bitmask.rs:206:5
|
206 | #[must_use = "method returns a new mask and does not mutate the original value"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, traits, and unions
warning: `#[must_use]` attribute cannot be used on trait methods in impl blocks
--> crates/core_simd/src/masks/bitmask.rs:222:5
|
222 | #[must_use = "method returns a new mask and does not mutate the original value"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= help: `#[must_use]` can be applied to data types, foreign functions, functions, inherent methods, provided trait methods, required trait methods, traits, and unions
Collaborator
|
Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead. |
Collaborator
|
rustbot has assigned @Mark-Simulacrum. Use |
programmerjake
approved these changes
Nov 11, 2025
Member
|
@bors r+ |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 11, 2025
Remove more `#[must_use]` from portable-simd These lines were missed in <https://github.com/rust-lang/rust/commit/f3515fb127ae07f1b13340dde0c61a20291eb304>/rust-lang/rust#136923 because core_simd/src/masks/bitmask.rs is only conditionally compiled. https://github.com/rust-lang/rust/blob/25d319a0f656ee8faa7a534da299e76e96068a40/library/portable-simd/crates/core_simd/src/masks.rs#L9-L13 Removing them unblocks bootstrapping rustc in an environment where avx512f is enabled. Without this change: ```console error: `#[must_use]` attribute cannot be used on trait methods in impl blocks --> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:173:5 | 173 | #[must_use = "method returns a new mask and does not mutate the original value"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = help: `#[must_use]` can be applied to data types, functions, unions, required trait methods, provided trait methods, inherent methods, foreign functions, and traits = note: `-D unused-attributes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_attributes)]` ``` To reproduce: `RUSTC_BOOTSTRAP=1 RUSTFLAGS=-Ctarget-feature=+avx512f cargo +nightly check --manifest-path=library/portable-simd/crates/core_simd/Cargo.toml --target=x86_64-unknown-linux-gnu --no-default-features`
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 11, 2025
Remove more `#[must_use]` from portable-simd These lines were missed in <https://github.com/rust-lang/rust/commit/f3515fb127ae07f1b13340dde0c61a20291eb304>/rust-lang/rust#136923 because core_simd/src/masks/bitmask.rs is only conditionally compiled. https://github.com/rust-lang/rust/blob/25d319a0f656ee8faa7a534da299e76e96068a40/library/portable-simd/crates/core_simd/src/masks.rs#L9-L13 Removing them unblocks bootstrapping rustc in an environment where avx512f is enabled. Without this change: ```console error: `#[must_use]` attribute cannot be used on trait methods in impl blocks --> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:173:5 | 173 | #[must_use = "method returns a new mask and does not mutate the original value"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = help: `#[must_use]` can be applied to data types, functions, unions, required trait methods, provided trait methods, inherent methods, foreign functions, and traits = note: `-D unused-attributes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_attributes)]` ``` To reproduce: `RUSTC_BOOTSTRAP=1 RUSTFLAGS=-Ctarget-feature=+avx512f cargo +nightly check --manifest-path=library/portable-simd/crates/core_simd/Cargo.toml --target=x86_64-unknown-linux-gnu --no-default-features`
bors
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup of 12 pull requests Successful merges: - #146627 (Simplify `jemalloc` setup) - #147753 (Suggest add bounding value for RangeTo) - #147974 (Improve diagnostics for buffer reuse with borrowed references) - #148080 ([rustdoc] Fix invalid jump to def macro link generation) - #148424 (bootstrap: Add snapshot tests for path-to-step handling) - #148500 (Update git index before running diff-index) - #148536 (cmse: add test for `async` and `const` functions) - #148770 (implement `feature(c_variadic_naked_functions)`) - #148819 (Remove specialized warning for removed target) - #148830 (miri subtree update) - #148833 (Update rustbook dependencies) - #148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup of 16 pull requests Successful merges: - #146627 (Simplify `jemalloc` setup) - #147753 (Suggest add bounding value for RangeTo) - #147832 (rustdoc: Don't pass `RenderOptions` to `DocContext`) - #147974 (Improve diagnostics for buffer reuse with borrowed references) - #148080 ([rustdoc] Fix invalid jump to def macro link generation) - #148465 (Adjust spans into the `for` loops context before creating the new desugaring spans.) - #148500 (Update git index before running diff-index) - #148531 (rustc_target: introduce Abi, Env, Os) - #148536 (cmse: add test for `async` and `const` functions) - #148770 (implement `feature(c_variadic_naked_functions)`) - #148780 (fix filecheck typos in tests) - #148819 (Remove specialized warning for removed target) - #148830 (miri subtree update) - #148833 (Update rustbook dependencies) - #148834 (fix(rustdoc): Color doctest errors) - #148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Nov 12, 2025
Rollup merge of #148841 - dtolnay:simdmustuse, r=calebzulawski Remove more `#[must_use]` from portable-simd These lines were missed in <https://github.com/rust-lang/rust/commit/f3515fb127ae07f1b13340dde0c61a20291eb304>/rust-lang/rust#136923 because core_simd/src/masks/bitmask.rs is only conditionally compiled. https://github.com/rust-lang/rust/blob/25d319a0f656ee8faa7a534da299e76e96068a40/library/portable-simd/crates/core_simd/src/masks.rs#L9-L13 Removing them unblocks bootstrapping rustc in an environment where avx512f is enabled. Without this change: ```console error: `#[must_use]` attribute cannot be used on trait methods in impl blocks --> library/core/src/../../portable-simd/crates/core_simd/src/masks/bitmask.rs:173:5 | 173 | #[must_use = "method returns a new mask and does not mutate the original value"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = help: `#[must_use]` can be applied to data types, functions, unions, required trait methods, provided trait methods, inherent methods, foreign functions, and traits = note: `-D unused-attributes` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_attributes)]` ``` To reproduce: `RUSTC_BOOTSTRAP=1 RUSTFLAGS=-Ctarget-feature=+avx512f cargo +nightly check --manifest-path=library/portable-simd/crates/core_simd/Cargo.toml --target=x86_64-unknown-linux-gnu --no-default-features`
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Nov 12, 2025
Rollup of 16 pull requests Successful merges: - rust-lang/rust#146627 (Simplify `jemalloc` setup) - rust-lang/rust#147753 (Suggest add bounding value for RangeTo) - rust-lang/rust#147832 (rustdoc: Don't pass `RenderOptions` to `DocContext`) - rust-lang/rust#147974 (Improve diagnostics for buffer reuse with borrowed references) - rust-lang/rust#148080 ([rustdoc] Fix invalid jump to def macro link generation) - rust-lang/rust#148465 (Adjust spans into the `for` loops context before creating the new desugaring spans.) - rust-lang/rust#148500 (Update git index before running diff-index) - rust-lang/rust#148531 (rustc_target: introduce Abi, Env, Os) - rust-lang/rust#148536 (cmse: add test for `async` and `const` functions) - rust-lang/rust#148770 (implement `feature(c_variadic_naked_functions)`) - rust-lang/rust#148780 (fix filecheck typos in tests) - rust-lang/rust#148819 (Remove specialized warning for removed target) - rust-lang/rust#148830 (miri subtree update) - rust-lang/rust#148833 (Update rustbook dependencies) - rust-lang/rust#148834 (fix(rustdoc): Color doctest errors) - rust-lang/rust#148841 (Remove more `#[must_use]` from portable-simd) r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These lines were missed in f3515fb/#136923 because core_simd/src/masks/bitmask.rs is only conditionally compiled.
rust/library/portable-simd/crates/core_simd/src/masks.rs
Lines 9 to 13 in 25d319a
Removing them unblocks bootstrapping rustc in an environment where avx512f is enabled. Without this change:
To reproduce:
RUSTC_BOOTSTRAP=1 RUSTFLAGS=-Ctarget-feature=+avx512f cargo +nightly check --manifest-path=library/portable-simd/crates/core_simd/Cargo.toml --target=x86_64-unknown-linux-gnu --no-default-features