about summary refs log tree commit diff
path: root/library/std/tests/sync/lib.rs
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-09-12 20:02:17 +1000
committerGitHub <noreply@github.com>2025-09-12 20:02:17 +1000
commit2e51a389996f63f06b2346874de55ede682d7a76 (patch)
treedfabd96699110243e157edaec2d56a98b4cba744 /library/std/tests/sync/lib.rs
parent7e3aa413166e337f7d11911c0d54aac7b9356f2a (diff)
parent6354c51d2b6ddf61e791b1b89f395e2350f88817 (diff)
downloadrust-2e51a389996f63f06b2346874de55ede682d7a76.tar.gz
rust-2e51a389996f63f06b2346874de55ede682d7a76.zip
Rollup merge of #146439 - connortsui20:fix-sync-macro-attr, r=RalfJung
fix cfg for poison test macro

Fixes test regression in https://github.com/rust-lang/rust/pull/144648
Continuation of https://github.com/rust-lang/rust/pull/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](https://github.com/rust-lang/rust/pull/146433#issuecomment-3280210451)) 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()`?
Diffstat (limited to 'library/std/tests/sync/lib.rs')
-rw-r--r--library/std/tests/sync/lib.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/std/tests/sync/lib.rs b/library/std/tests/sync/lib.rs
index ac1dbebcc5c..23112e10284 100644
--- a/library/std/tests/sync/lib.rs
+++ b/library/std/tests/sync/lib.rs
@@ -58,6 +58,9 @@ fn result_unwrap<T, E: std::fmt::Debug>(x: Result<T, E>) -> T {
 /// a no-op (the identity function).
 ///
 /// The test names will be prefiex with `poison_` or `nonpoison_`.
+///
+/// Important: most attributes (except `cfg`) will not work properly! (They are only applied to the first test.)
+/// See <https://github.com/rust-lang/rust/pull/146433> for more information.
 macro_rules! nonpoison_and_poison_unwrap_test {
     (
         name: $name:ident,