10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 139b49b + 409d994 commit bf40327Copy full SHA for bf40327
tests/ui/panic-handler/weak-lang-item-2.rs
@@ -1,15 +1,15 @@
1
// run-pass
2
// aux-build:weak-lang-items.rs
3
4
-// ignore-emscripten no threads support
5
// pretty-expanded FIXME #23616
6
7
extern crate weak_lang_items as other;
8
9
-use std::thread;
10
-
11
fn main() {
12
- let _ = thread::spawn(move|| {
13
- other::foo()
14
- });
+ // The goal of the test is just to make sure other::foo() is referenced at link time. Since
+ // the function panics, to prevent it from running we gate it behind an always-false `if` that
+ // is not going to be optimized away.
+ if std::hint::black_box(false) {
+ other::foo();
+ }
15
}
0 commit comments