Repository navigation
Conversation
Collaborator
|
Some changes occurred in cc @Amanieu, @folkertdev, @sayantn |
Member
Author
|
@bors try jobs=test-i686-gnu-1,test-i686-gnu-2 |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
std: Clean up and improve errors for `is_*_feature_detected` macros try-job: test-i686-gnu-1 try-job: test-i686-gnu-2
2 tasks
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
tgross35
force-pushed
the
std_detect-updates
branch
from
October 27, 2026 02:35
8dd794c to
d4b8215
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
std: Clean up and improve errors for `is_*_feature_detected` macros try-job: test-i686-gnu-1
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
tgross35
force-pushed
the
std_detect-updates
branch
from
October 27, 2026 04:57
d4b8215 to
97f8d9c
Compare
This comment has been minimized.
This comment has been minimized.
tgross35
force-pushed
the
std_detect-updates
branch
from
October 27, 2026 05:49
97f8d9c to
d9777f8
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
std: Clean up and improve errors for `is_*_feature_detected` macros try-job: test-i686-gnu-1
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
tgross35
force-pushed
the
std_detect-updates
branch
from
October 27, 2026 08:17
d9777f8 to
84f7df7
Compare
This comment has been minimized.
This comment has been minimized.
It can be a bit tricky to follow these macros, but we still want to provide good diagnostics. Add tests making sure these don't change.
Because of rewrapping, this prints as:
error: This macro cannot be used on the current target.
You can prevent it from being used in other architectures by
guarding it behind a cfg(any(target_arch = "aarch64", target_arch = "arm64ec")).
Bridge newlines so it instead prints as this:
error: This macro cannot be used on the current target. You can prevent
it from being used in other architectures by guarding it behind
a `cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))`.
We have a handful of `#[unstable]` gates that aren't even being used, because all that matters is the re-export in `std`. For example, the RISC-V macro appears unstable, but has actually been stable since 1.78 <https://doc.rust-lang.org/1.78.0/std/arch/macro.is_riscv_feature_detected.html>.
tgross35
force-pushed
the
std_detect-updates
branch
from
October 27, 2026 08:33
84f7df7 to
51ff312
Compare
Member
Author
|
@bors try jobs=test-i686-gnu-1 |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
std: Clean up and improve errors for `is_*_feature_detected` macros try-job: test-i686-gnu-1
Contributor
Member
Author
|
@rustbot ready |
Rather than transmuting discriminants, use the macros to generate a list of all features that we can iterate instead. This also allows us to remove the sentinel `_last` entry.
Contributor
|
I appreciate the added commentary. My brain still hurts following this, but less than I think it would have otherwise. Playing around with this, I don't see any obvious user-visible changes here other than better error messages, so 👍. @bors r+ rollup=iffy |
Contributor
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 4, 2026
…nGnome std: Clean up and improve errors for `is_*_feature_detected` macros This includes a handful of small changes around the internals of our feature detection macros: * Add UI tests, since this macro is pretty UI-forward but not yet covered anywhere * Remove misleading feature gates that aren't even being checked, e.g. what showed up in rust-lang#111192 (comment). * Clean up some errors and improve the comments around all of this This is done in a handful of separate commits, the messages have some more details.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
Rollup of 9 pull requests Successful merges: - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165330 (Impl read_le/read_be for f16 and f128) - #165414 (Remove unusued query key impl) - #165440 (docker: bump node to v24.22.2 in shared script)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
Rollup of 9 pull requests Successful merges: - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165330 (Impl read_le/read_be for f16 and f128) - #165414 (Remove unusued query key impl) - #165440 (docker: bump node to v24.22.2 in shared script)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
Rollup of 9 pull requests Successful merges: - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165330 (Impl read_le/read_be for f16 and f128) - #165414 (Remove unusued query key impl) - #165440 (docker: bump node to v24.22.2 in shared script)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Nov 4, 2026
…nGnome std: Clean up and improve errors for `is_*_feature_detected` macros This includes a handful of small changes around the internals of our feature detection macros: * Add UI tests, since this macro is pretty UI-forward but not yet covered anywhere * Remove misleading feature gates that aren't even being checked, e.g. what showed up in rust-lang#111192 (comment). * Clean up some errors and improve the comments around all of this This is done in a handful of separate commits, the messages have some more details.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
…uwer Rollup of 17 pull requests Successful merges: - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets ) - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #165376 (Add `Forget` trait feature gate) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165201 (Move a bunch of methods out of `AttributeExt`) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165257 (Revert FCW on lint attributes on macro calls) - #165330 (Impl read_le/read_be for f16 and f128) - #165364 (Update books) - #165414 (Remove unusued query key impl) - #165424 (Update amdgpu datalayout for LLVM 24) - #165440 (docker: bump node to v24.22.2 in shared script) - #165443 (Add `Discriminant::ord`) - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
…uwer Rollup of 17 pull requests Successful merges: - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets ) - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #165376 (Add `Forget` trait feature gate) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165201 (Move a bunch of methods out of `AttributeExt`) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165257 (Revert FCW on lint attributes on macro calls) - #165330 (Impl read_le/read_be for f16 and f128) - #165364 (Update books) - #165414 (Remove unusued query key impl) - #165424 (Update amdgpu datalayout for LLVM 24) - #165440 (docker: bump node to v24.22.2 in shared script) - #165443 (Add `Discriminant::ord`) - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 4, 2026
…uwer Rollup of 17 pull requests Successful merges: - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets ) - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros) - #165376 (Add `Forget` trait feature gate) - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs) - #165201 (Move a bunch of methods out of `AttributeExt`) - #165268 (Fix constant-pattern equality suggestion spans in macros) - #165318 (Fix explicit destructor-call suggestion spans in macros) - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc)) - #165001 (Document allocator swap in BinaryHeap::append) - #165257 (Revert FCW on lint attributes on macro calls) - #165330 (Impl read_le/read_be for f16 and f128) - #165364 (Update books) - #165414 (Remove unusued query key impl) - #165424 (Update amdgpu datalayout for LLVM 24) - #165440 (docker: bump node to v24.22.2 in shared script) - #165443 (Add `Discriminant::ord`) - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
View all comments
This includes a handful of small changes around the internals of our feature detection macros:
This is done in a handful of separate commits, the messages have some more details.
r? libs