Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spurious test failure with panic=abort #113568

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/ui/panic-handler/weak-lang-item-2.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// run-pass
// aux-build:weak-lang-items.rs

// ignore-emscripten no threads support
// pretty-expanded FIXME #23616

extern crate weak_lang_items as other;

use std::thread;

fn main() {
let _ = thread::spawn(move|| {
other::foo()
});
// 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();
}
}