fix cfg for poison test macro#146439
Merged
bors merged 2 commits intorust-lang:masterfrom Sep 12, 2025
Merged
Conversation
RalfJung
reviewed
Sep 11, 2025
0d7beed to
bc57350
Compare
RalfJung
reviewed
Sep 11, 2025
library/std/tests/sync/lib.rs
Outdated
Comment on lines
62
to
63
| /// Important: If you want to add attributes to both tests, use `cfg()` instead of `cfg_attr()`. | ||
| /// See <https://github.com/rust-lang/rust/pull/146433> for more information. |
Member
There was a problem hiding this comment.
cfg can't add attributes to both tests. All it can do is remove both tests.
Member
There was a problem hiding this comment.
Note that cfg(not($cond)) and cfg_attr($cond, ignore) are not equivalent! The former removes the test entirely, the latter marks it as ignored by adding the #[ignore] attribute, conditionally. This will result in different output when the tests are run (ignore tests are listed there).
Contributor
Author
There was a problem hiding this comment.
Oh that makes a lot more sense now 🤦
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
bc57350 to
18d0dcb
Compare
RalfJung
reviewed
Sep 11, 2025
Co-authored-by: Ralf Jung <post@ralfj.de>
Member
|
Thanks! @bors r+ rollup |
Collaborator
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 12, 2025
…r=RalfJung fix cfg for poison test macro Fixes test regression in rust-lang#144648 Continuation of rust-lang#146433 I think this is right? Not really sure how to test this myself to be honest. r? `@RalfJung` I'll also leave the improvement to the test macro for a separate PR (described [here](rust-lang#146433 (comment))) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the `cfg()` and not `cfg_attr()`?
bors
added a commit
that referenced
this pull request
Sep 12, 2025
Rollup of 16 pull requests Successful merges: - #145660 (initial implementation of the darwin_objc unstable feature) - #145895 (thread parking: fix docs and examples) - #146308 (support integer literals in `${concat()}`) - #146323 (check before test for hardware capabilites in bits 32~63 of usize) - #146332 (tidy: make behavior of extra-checks more uniform) - #146338 (Extends AArch64 branch protection support to include GCS) - #146374 (Update `browser-ui-test` version to `0.22.2`) - #146413 (Improve suggestion in case a bare URL is surrounded by brackets) - #146426 (Bump miow to 0.60.1) - #146432 (Implement `Socket::take_error` for Hermit) - #146433 (rwlock tests: fix miri macos test regression) - #146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - #146439 (fix cfg for poison test macro) - #146448 ([rustdoc] Correctly handle literal search on paths) - #146449 (Fix `libgccjit` symlink when we build GCC locally) - #146455 (test: remove an outdated normalization for rustc versions) Failed merges: - #146389 (Convert `no_std` and `no_core` to the new attribute infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Sep 12, 2025
…r=RalfJung fix cfg for poison test macro Fixes test regression in rust-lang#144648 Continuation of rust-lang#146433 I think this is right? Not really sure how to test this myself to be honest. r? ``@RalfJung`` I'll also leave the improvement to the test macro for a separate PR (described [here](rust-lang#146433 (comment))) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the `cfg()` and not `cfg_attr()`?
bors
added a commit
that referenced
this pull request
Sep 12, 2025
Rollup of 16 pull requests Successful merges: - #144549 (match clang's `va_arg` assembly on arm targets) - #145660 (initial implementation of the darwin_objc unstable feature) - #145895 (thread parking: fix docs and examples) - #146308 (support integer literals in `${concat()}`) - #146323 (check before test for hardware capabilites in bits 32~63 of usize) - #146332 (tidy: make behavior of extra-checks more uniform) - #146374 (Update `browser-ui-test` version to `0.22.2`) - #146413 (Improve suggestion in case a bare URL is surrounded by brackets) - #146426 (Bump miow to 0.60.1) - #146432 (Implement `Socket::take_error` for Hermit) - #146433 (rwlock tests: fix miri macos test regression) - #146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - #146439 (fix cfg for poison test macro) - #146448 ([rustdoc] Correctly handle literal search on paths) - #146449 (Fix `libgccjit` symlink when we build GCC locally) - #146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
that referenced
this pull request
Sep 12, 2025
Rollup of 15 pull requests Successful merges: - #144549 (match clang's `va_arg` assembly on arm targets) - #145895 (thread parking: fix docs and examples) - #146308 (support integer literals in `${concat()}`) - #146323 (check before test for hardware capabilites in bits 32~63 of usize) - #146332 (tidy: make behavior of extra-checks more uniform) - #146374 (Update `browser-ui-test` version to `0.22.2`) - #146413 (Improve suggestion in case a bare URL is surrounded by brackets) - #146426 (Bump miow to 0.60.1) - #146432 (Implement `Socket::take_error` for Hermit) - #146433 (rwlock tests: fix miri macos test regression) - #146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - #146439 (fix cfg for poison test macro) - #146448 ([rustdoc] Correctly handle literal search on paths) - #146449 (Fix `libgccjit` symlink when we build GCC locally) - #146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
that referenced
this pull request
Sep 12, 2025
Rollup merge of #146439 - connortsui20:fix-sync-macro-attr, r=RalfJung fix cfg for poison test macro Fixes test regression in #144648 Continuation of #146433 I think this is right? Not really sure how to test this myself to be honest. r? ```@RalfJung``` I'll also leave the improvement to the test macro for a separate PR (described [here](#146433 (comment))) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the `cfg()` and not `cfg_attr()`?
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Sep 13, 2025
Rollup of 15 pull requests Successful merges: - rust-lang/rust#144549 (match clang's `va_arg` assembly on arm targets) - rust-lang/rust#145895 (thread parking: fix docs and examples) - rust-lang/rust#146308 (support integer literals in `${concat()}`) - rust-lang/rust#146323 (check before test for hardware capabilites in bits 32~63 of usize) - rust-lang/rust#146332 (tidy: make behavior of extra-checks more uniform) - rust-lang/rust#146374 (Update `browser-ui-test` version to `0.22.2`) - rust-lang/rust#146413 (Improve suggestion in case a bare URL is surrounded by brackets) - rust-lang/rust#146426 (Bump miow to 0.60.1) - rust-lang/rust#146432 (Implement `Socket::take_error` for Hermit) - rust-lang/rust#146433 (rwlock tests: fix miri macos test regression) - rust-lang/rust#146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - rust-lang/rust#146439 (fix cfg for poison test macro) - rust-lang/rust#146448 ([rustdoc] Correctly handle literal search on paths) - rust-lang/rust#146449 (Fix `libgccjit` symlink when we build GCC locally) - rust-lang/rust#146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Oct 9, 2025
…r=RalfJung fix cfg for poison test macro Fixes test regression in rust-lang#144648 Continuation of rust-lang#146433 I think this is right? Not really sure how to test this myself to be honest. r? ```@RalfJung``` I'll also leave the improvement to the test macro for a separate PR (described [here](rust-lang#146433 (comment))) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the `cfg()` and not `cfg_attr()`?
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Oct 9, 2025
Rollup of 15 pull requests Successful merges: - rust-lang#144549 (match clang's `va_arg` assembly on arm targets) - rust-lang#145895 (thread parking: fix docs and examples) - rust-lang#146308 (support integer literals in `${concat()}`) - rust-lang#146323 (check before test for hardware capabilites in bits 32~63 of usize) - rust-lang#146332 (tidy: make behavior of extra-checks more uniform) - rust-lang#146374 (Update `browser-ui-test` version to `0.22.2`) - rust-lang#146413 (Improve suggestion in case a bare URL is surrounded by brackets) - rust-lang#146426 (Bump miow to 0.60.1) - rust-lang#146432 (Implement `Socket::take_error` for Hermit) - rust-lang#146433 (rwlock tests: fix miri macos test regression) - rust-lang#146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - rust-lang#146439 (fix cfg for poison test macro) - rust-lang#146448 ([rustdoc] Correctly handle literal search on paths) - rust-lang#146449 (Fix `libgccjit` symlink when we build GCC locally) - rust-lang#146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
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.
Fixes test regression in #144648
Continuation of #146433
I think this is right? Not really sure how to test this myself to be honest.
r? @RalfJung
I'll also leave the improvement to the test macro for a separate PR (described here) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the
cfg()and notcfg_attr()?