Skip to content

Commit 30fd32e

Browse files
committed
Make the compile test use a const instead
1 parent 20d0225 commit 30fd32e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

library/std/tests/sync/barrier.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ fn test_barrier() {
3535
assert!(leader_found);
3636
}
3737

38-
#[expect(dead_code, reason = "this is essentially a compile pass test")]
39-
fn check_barrier_is_ref_unwind_safe() {
40-
let barrier = Arc::new(Barrier::new(10));
41-
42-
fn check<T: RefUnwindSafe>(_: T) {}
43-
44-
check(barrier);
45-
}
38+
/// Asserts that `Barrier` is ref unwind safe.
39+
///
40+
/// See <https://github.com/rust-lang/rust/issues/146087>.
41+
const _: () = {
42+
const fn check_ref_unwind_safe<T: RefUnwindSafe>() {}
43+
check_ref_unwind_safe::<Barrier>();
44+
};

0 commit comments

Comments
 (0)