diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 8c50bcd5b613e..06d8f099c33fa 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -451,6 +451,15 @@ impl Config { self.target_cfg().panic == PanicStrategy::Unwind } + pub fn has_threads(&self) -> bool { + // Wasm targets don't have threads unless `-threads` is in the target + // name, such as `wasm32-wasip1-threads`. + if self.target.starts_with("wasm") { + return self.target.contains("threads"); + } + true + } + pub fn has_asm_support(&self) -> bool { static ASM_SUPPORTED_ARCHS: &[&str] = &[ "x86", "x86_64", "arm", "aarch64", "riscv32", diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 6de445a57830f..f15761354f7ab 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -787,6 +787,7 @@ const DIAGNOSTICS_DIRECTIVE_NAMES: &[&str] = &[ "needs-sanitizer-shadow-call-stack", "needs-sanitizer-support", "needs-sanitizer-thread", + "needs-threads", "needs-unwind", "needs-xray", "no-prefer-dynamic", diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index 3978658815053..d7c74038aea04 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -84,6 +84,11 @@ pub(super) fn handle_needs( condition: config.run_enabled(), ignore_reason: "ignored when running the resulting test binaries is disabled", }, + Need { + name: "needs-threads", + condition: config.has_threads(), + ignore_reason: "ignored on targets without threading support", + }, Need { name: "needs-unwind", condition: config.can_unwind(), diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index eff76a38d2e5c..815ac3839df82 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -592,3 +592,23 @@ fn ignore_mode() { assert!(!check_ignore(&config, &format!("//@ ignore-mode-{other}"))); } } + +#[test] +fn threads_support() { + let threads = [ + ("x86_64-unknown-linux-gnu", true), + ("aarch64-apple-darwin", true), + ("wasm32-unknown-unknown", false), + ("wasm64-unknown-unknown", false), + #[cfg(not(bootstrap))] + ("wasm32-wasip1", false), + #[cfg(not(bootstrap))] + ("wasm32-wasip1-threads", true), + ("wasm32-wasi-preview1-threads", true), + ]; + for (target, has_threads) in threads { + let config = cfg().target(target).build(); + assert_eq!(config.has_threads(), has_threads); + assert_eq!(check_ignore(&config, "//@ needs-threads"), !has_threads) + } +} diff --git a/tests/codegen/cffi/c-variadic.rs b/tests/codegen/cffi/c-variadic.rs index 74aed36a8a1a5..914d1623ed230 100644 --- a/tests/codegen/cffi/c-variadic.rs +++ b/tests/codegen/cffi/c-variadic.rs @@ -1,4 +1,4 @@ -//@ ignore-wasm32-bare compiled with panic=abort by default +//@ needs-unwind //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 // diff --git a/tests/ui/abi/extern/extern-call-deep2.rs b/tests/ui/abi/extern/extern-call-deep2.rs index 80c492e302216..c021bc223482d 100644 --- a/tests/ui/abi/extern/extern-call-deep2.rs +++ b/tests/ui/abi/extern/extern-call-deep2.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(rustc_private)] extern crate libc; diff --git a/tests/ui/abi/extern/extern-call-scrub.rs b/tests/ui/abi/extern/extern-call-scrub.rs index 873f5d2e7748f..7edf8975ad816 100644 --- a/tests/ui/abi/extern/extern-call-scrub.rs +++ b/tests/ui/abi/extern/extern-call-scrub.rs @@ -4,7 +4,7 @@ // make sure the stack pointers are maintained properly in both // directions -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(rustc_private)] extern crate libc; diff --git a/tests/ui/abi/foreign/foreign-call-no-runtime.rs b/tests/ui/abi/foreign/foreign-call-no-runtime.rs index 7f847d55721c3..42d8d7b1d2596 100644 --- a/tests/ui/abi/foreign/foreign-call-no-runtime.rs +++ b/tests/ui/abi/foreign/foreign-call-no-runtime.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(rustc_private)] diff --git a/tests/ui/box/unit/unique-send-2.rs b/tests/ui/box/unit/unique-send-2.rs index 20474fee4d8d5..d3cbeefab3766 100644 --- a/tests/ui/box/unit/unique-send-2.rs +++ b/tests/ui/box/unit/unique-send-2.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/codegen/init-large-type.rs b/tests/ui/codegen/init-large-type.rs index 34b40693ab12c..b9fc6612e1687 100644 --- a/tests/ui/codegen/init-large-type.rs +++ b/tests/ui/codegen/init-large-type.rs @@ -7,8 +7,7 @@ // optimisation. //@ pretty-expanded FIXME #23616 -//@ ignore-emscripten no threads support - +//@ needs-threads #![feature(intrinsics)] use std::{mem, thread}; diff --git a/tests/ui/codegen/issue-28950.rs b/tests/ui/codegen/issue-28950.rs index 8e55172af6d73..0a706c588d564 100644 --- a/tests/ui/codegen/issue-28950.rs +++ b/tests/ui/codegen/issue-28950.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads +//@ needs-threads //@ compile-flags: -O // Tests that the `vec!` macro does not overflow the stack when it is diff --git a/tests/ui/coroutine/smoke.rs b/tests/ui/coroutine/smoke.rs index 0ed56982c9b74..17d98a52a1c49 100644 --- a/tests/ui/coroutine/smoke.rs +++ b/tests/ui/coroutine/smoke.rs @@ -3,7 +3,7 @@ //@ revisions: default nomiropt //@[nomiropt]compile-flags: -Z mir-opt-level=0 -//@ ignore-emscripten no threads support +//@ needs-threads //@ compile-flags: --test #![feature(coroutines, coroutine_trait)] diff --git a/tests/ui/cross-crate/cci_capture_clause.rs b/tests/ui/cross-crate/cci_capture_clause.rs index 99736ad185de4..73e1020d7cfcb 100644 --- a/tests/ui/cross-crate/cci_capture_clause.rs +++ b/tests/ui/cross-crate/cci_capture_clause.rs @@ -5,7 +5,7 @@ // that use capture clauses. //@ pretty-expanded FIXME #23616 -//@ ignore-emscripten no threads support +//@ needs-threads extern crate cci_capture_clause; diff --git a/tests/ui/hashmap/hashmap-memory.rs b/tests/ui/hashmap/hashmap-memory.rs index 0b1e09f53446c..6db5d2e7bef35 100644 --- a/tests/ui/hashmap/hashmap-memory.rs +++ b/tests/ui/hashmap/hashmap-memory.rs @@ -4,7 +4,7 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] #![allow(unused_mut)] -//@ ignore-emscripten No support for threads +//@ needs-threads /** A somewhat reduced test case to expose some Valgrind issues. diff --git a/tests/ui/issues/issue-16560.rs b/tests/ui/issues/issue-16560.rs index 37b536e644d86..d9a7aa9101d3f 100644 --- a/tests/ui/issues/issue-16560.rs +++ b/tests/ui/issues/issue-16560.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_variables)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::mem; diff --git a/tests/ui/issues/issue-21291.rs b/tests/ui/issues/issue-21291.rs index 357d5520028fb..06f50ac6996df 100644 --- a/tests/ui/issues/issue-21291.rs +++ b/tests/ui/issues/issue-21291.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads // Regression test for unwrapping the result of `join`, issue #21291 diff --git a/tests/ui/issues/issue-22864-2.rs b/tests/ui/issues/issue-22864-2.rs index 1b702f4f509c3..d98dbeda46b5d 100644 --- a/tests/ui/issues/issue-22864-2.rs +++ b/tests/ui/issues/issue-22864-2.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads pub fn main() { let f = || || 0; diff --git a/tests/ui/issues/issue-59020.rs b/tests/ui/issues/issue-59020.rs index 5692afe811e83..2a34ba52b8831 100644 --- a/tests/ui/issues/issue-59020.rs +++ b/tests/ui/issues/issue-59020.rs @@ -1,6 +1,6 @@ //@ edition:2018 //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::time::Duration; diff --git a/tests/ui/logging-only-prints-once.rs b/tests/ui/logging-only-prints-once.rs index 75ef0a274ee48..5377d5eeae2bc 100644 --- a/tests/ui/logging-only-prints-once.rs +++ b/tests/ui/logging-only-prints-once.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-windows -//@ ignore-emscripten no threads support +//@ needs-threads use std::cell::Cell; use std::fmt; diff --git a/tests/ui/lto/lto-still-runs-thread-dtors.rs b/tests/ui/lto/lto-still-runs-thread-dtors.rs index a93d7cf35cc75..504923a93c279 100644 --- a/tests/ui/lto/lto-still-runs-thread-dtors.rs +++ b/tests/ui/lto/lto-still-runs-thread-dtors.rs @@ -1,7 +1,7 @@ //@ run-pass //@ compile-flags: -C lto //@ no-prefer-dynamic -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/macros/macro-with-braces-in-expr-position.rs b/tests/ui/macros/macro-with-braces-in-expr-position.rs index febfa7241f214..4607349e96368 100644 --- a/tests/ui/macros/macro-with-braces-in-expr-position.rs +++ b/tests/ui/macros/macro-with-braces-in-expr-position.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/moves/moves-based-on-type-capture-clause.rs b/tests/ui/moves/moves-based-on-type-capture-clause.rs index baf52ffb5154c..46759f6646818 100644 --- a/tests/ui/moves/moves-based-on-type-capture-clause.rs +++ b/tests/ui/moves/moves-based-on-type-capture-clause.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/panics/panic-handler-chain.rs b/tests/ui/panics/panic-handler-chain.rs index eb23849f3ac83..fea71ad9ec4e3 100644 --- a/tests/ui/panics/panic-handler-chain.rs +++ b/tests/ui/panics/panic-handler-chain.rs @@ -1,9 +1,8 @@ //@ run-pass //@ needs-unwind +//@ needs-threads #![allow(stable_features)] -//@ ignore-emscripten no threads support - #![feature(std_panic)] use std::sync::atomic::{AtomicUsize, Ordering}; diff --git a/tests/ui/panics/panic-task-name-none.rs b/tests/ui/panics/panic-task-name-none.rs index 7eb974bde4c55..8695771ff5eaa 100644 --- a/tests/ui/panics/panic-task-name-none.rs +++ b/tests/ui/panics/panic-task-name-none.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread '' panicked //@ error-pattern:test -//@ ignore-emscripten Needs threads +//@ needs-threads use std::thread; diff --git a/tests/ui/panics/panic-task-name-owned.rs b/tests/ui/panics/panic-task-name-owned.rs index 9a680676dc0fe..42ae33b5d351b 100644 --- a/tests/ui/panics/panic-task-name-owned.rs +++ b/tests/ui/panics/panic-task-name-owned.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'owned name' panicked //@ error-pattern:test -//@ ignore-emscripten Needs threads. +//@ needs-threads use std::thread::Builder; diff --git a/tests/ui/process-termination/process-termination-blocking-io.rs b/tests/ui/process-termination/process-termination-blocking-io.rs index c21edff25cf7c..f725a95894162 100644 --- a/tests/ui/process-termination/process-termination-blocking-io.rs +++ b/tests/ui/process-termination/process-termination-blocking-io.rs @@ -2,7 +2,7 @@ // https://github.com/fortanix/rust-sgx/issues/109 //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::{net::TcpListener, sync::mpsc, thread}; diff --git a/tests/ui/process-termination/process-termination-simple.rs b/tests/ui/process-termination/process-termination-simple.rs index 63eb2c747068b..8f5f185b7f9b9 100644 --- a/tests/ui/process-termination/process-termination-simple.rs +++ b/tests/ui/process-termination/process-termination-simple.rs @@ -1,7 +1,7 @@ // program should terminate when std::process::exit is called from any thread //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::{process, thread}; diff --git a/tests/ui/structs-enums/ivec-tag.rs b/tests/ui/structs-enums/ivec-tag.rs index 9185a0cbb6e93..2a0b6dd1ed482 100644 --- a/tests/ui/structs-enums/ivec-tag.rs +++ b/tests/ui/structs-enums/ivec-tag.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/test-attrs/test-filter-multiple.rs b/tests/ui/test-attrs/test-filter-multiple.rs index 0347ce457ae66..05fc022834aea 100644 --- a/tests/ui/test-attrs/test-filter-multiple.rs +++ b/tests/ui/test-attrs/test-filter-multiple.rs @@ -3,7 +3,7 @@ //@ run-flags: --test-threads=1 test1 test2 //@ check-run-results //@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ ignore-emscripten no threads support +//@ needs-threads #[test] fn test1() {} diff --git a/tests/ui/test-attrs/test-type.rs b/tests/ui/test-attrs/test-type.rs index 8f75ff309e0ea..7db7e31d01daa 100644 --- a/tests/ui/test-attrs/test-type.rs +++ b/tests/ui/test-attrs/test-type.rs @@ -2,7 +2,7 @@ //@ run-flags: --test-threads=1 //@ check-run-results //@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ ignore-emscripten no threads support +//@ needs-threads //@ run-pass #[test] diff --git a/tests/ui/thread-local/tls.rs b/tests/ui/thread-local/tls.rs index 17096319d237c..fa6a722b291d7 100644 --- a/tests/ui/thread-local/tls.rs +++ b/tests/ui/thread-local/tls.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads //@ compile-flags: -O //@ ignore-nto Doesn't work without emulated TLS enabled (in LLVM) diff --git a/tests/ui/threads-sendsync/child-outlives-parent.rs b/tests/ui/threads-sendsync/child-outlives-parent.rs index 2fb4a6f637a2b..213fd008cd3de 100644 --- a/tests/ui/threads-sendsync/child-outlives-parent.rs +++ b/tests/ui/threads-sendsync/child-outlives-parent.rs @@ -2,7 +2,7 @@ // Reported as issue #126, child leaks the string. //@ pretty-expanded FIXME #23616 -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/clone-with-exterior.rs b/tests/ui/threads-sendsync/clone-with-exterior.rs index 58529e4a7887c..67790367e27e4 100644 --- a/tests/ui/threads-sendsync/clone-with-exterior.rs +++ b/tests/ui/threads-sendsync/clone-with-exterior.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/comm.rs b/tests/ui/threads-sendsync/comm.rs index 589859e60a66a..0c37fda8a3931 100644 --- a/tests/ui/threads-sendsync/comm.rs +++ b/tests/ui/threads-sendsync/comm.rs @@ -1,13 +1,13 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; pub fn main() { let (tx, rx) = channel(); - let t = thread::spawn(move|| { child(&tx) }); + let t = thread::spawn(move || { child(&tx) }); let y = rx.recv().unwrap(); println!("received"); println!("{}", y); diff --git a/tests/ui/threads-sendsync/eprint-on-tls-drop.rs b/tests/ui/threads-sendsync/eprint-on-tls-drop.rs index 3ff9fb10f2419..82abf21df3f41 100644 --- a/tests/ui/threads-sendsync/eprint-on-tls-drop.rs +++ b/tests/ui/threads-sendsync/eprint-on-tls-drop.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes +//@ needs-threads //@ ignore-sgx no processes use std::cell::RefCell; diff --git a/tests/ui/threads-sendsync/issue-24313.rs b/tests/ui/threads-sendsync/issue-24313.rs index 17e027520c15f..1ea862f1e7d6b 100644 --- a/tests/ui/threads-sendsync/issue-24313.rs +++ b/tests/ui/threads-sendsync/issue-24313.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads +//@ needs-threads //@ ignore-sgx no processes use std::thread; diff --git a/tests/ui/threads-sendsync/issue-29488.rs b/tests/ui/threads-sendsync/issue-29488.rs index c848e7b50bb73..fbbd6b02a067d 100644 --- a/tests/ui/threads-sendsync/issue-29488.rs +++ b/tests/ui/threads-sendsync/issue-29488.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/issue-43733-2.rs b/tests/ui/threads-sendsync/issue-43733-2.rs index 5a9ee015cb9dd..372ebf2cff97f 100644 --- a/tests/ui/threads-sendsync/issue-43733-2.rs +++ b/tests/ui/threads-sendsync/issue-43733-2.rs @@ -1,4 +1,4 @@ -//@ ignore-wasm32 +//@ needs-threads //@ dont-check-compiler-stderr #![feature(cfg_target_thread_local, thread_local_internals)] diff --git a/tests/ui/threads-sendsync/issue-43733.rs b/tests/ui/threads-sendsync/issue-43733.rs index 12207f4e6aa02..c90f60887cfd2 100644 --- a/tests/ui/threads-sendsync/issue-43733.rs +++ b/tests/ui/threads-sendsync/issue-43733.rs @@ -1,4 +1,4 @@ -//@ ignore-wasm32 +//@ needs-threads #![feature(thread_local)] #![feature(cfg_target_thread_local, thread_local_internals)] diff --git a/tests/ui/threads-sendsync/issue-4446.rs b/tests/ui/threads-sendsync/issue-4446.rs index b5e3a20ccde1e..aa2de51974b37 100644 --- a/tests/ui/threads-sendsync/issue-4446.rs +++ b/tests/ui/threads-sendsync/issue-4446.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::channel; use std::thread; diff --git a/tests/ui/threads-sendsync/issue-4448.rs b/tests/ui/threads-sendsync/issue-4448.rs index 0f3bf65c441f0..b8324a8c43fb5 100644 --- a/tests/ui/threads-sendsync/issue-4448.rs +++ b/tests/ui/threads-sendsync/issue-4448.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::channel; use std::thread; diff --git a/tests/ui/threads-sendsync/issue-8827.rs b/tests/ui/threads-sendsync/issue-8827.rs index b7deef0f34dd1..fa07a4ebc7d6d 100644 --- a/tests/ui/threads-sendsync/issue-8827.rs +++ b/tests/ui/threads-sendsync/issue-8827.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Receiver}; diff --git a/tests/ui/threads-sendsync/issue-9396.rs b/tests/ui/threads-sendsync/issue-9396.rs index 6228f4ba706b7..6b5907e5c1d09 100644 --- a/tests/ui/threads-sendsync/issue-9396.rs +++ b/tests/ui/threads-sendsync/issue-9396.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] #![allow(deprecated)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{TryRecvError, channel}; use std::thread; diff --git a/tests/ui/threads-sendsync/mpsc_stress.rs b/tests/ui/threads-sendsync/mpsc_stress.rs index 68c401512817c..f5354c60bfce9 100644 --- a/tests/ui/threads-sendsync/mpsc_stress.rs +++ b/tests/ui/threads-sendsync/mpsc_stress.rs @@ -1,6 +1,6 @@ //@ run-pass //@ compile-flags:--test -//@ ignore-emscripten +//@ needs-threads use std::sync::mpsc::channel; use std::sync::mpsc::TryRecvError; diff --git a/tests/ui/threads-sendsync/send-resource.rs b/tests/ui/threads-sendsync/send-resource.rs index 32910c5f7d177..3e1532b3132ee 100644 --- a/tests/ui/threads-sendsync/send-resource.rs +++ b/tests/ui/threads-sendsync/send-resource.rs @@ -4,7 +4,7 @@ #![allow(non_camel_case_types)] //@ pretty-expanded FIXME #23616 -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::channel; diff --git a/tests/ui/threads-sendsync/sendfn-spawn-with-fn-arg.rs b/tests/ui/threads-sendsync/sendfn-spawn-with-fn-arg.rs index 5306d69a7d2cc..63cf3ff40490d 100644 --- a/tests/ui/threads-sendsync/sendfn-spawn-with-fn-arg.rs +++ b/tests/ui/threads-sendsync/sendfn-spawn-with-fn-arg.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/spawn-fn.rs b/tests/ui/threads-sendsync/spawn-fn.rs index 863c22f70d6be..e4d83b53f3cfa 100644 --- a/tests/ui/threads-sendsync/spawn-fn.rs +++ b/tests/ui/threads-sendsync/spawn-fn.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/spawn-types.rs b/tests/ui/threads-sendsync/spawn-types.rs index 9c1b6550d9b1e..2a7a9e2f49732 100644 --- a/tests/ui/threads-sendsync/spawn-types.rs +++ b/tests/ui/threads-sendsync/spawn-types.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(non_camel_case_types)] -//@ ignore-emscripten no threads support +//@ needs-threads /* Make sure we can spawn tasks that take different types of diff --git a/tests/ui/threads-sendsync/spawn.rs b/tests/ui/threads-sendsync/spawn.rs index 2c06fc2837f34..c7b344b9f7581 100644 --- a/tests/ui/threads-sendsync/spawn.rs +++ b/tests/ui/threads-sendsync/spawn.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/spawn2.rs b/tests/ui/threads-sendsync/spawn2.rs index cfe907ea6d9a3..8278fec1885b9 100644 --- a/tests/ui/threads-sendsync/spawn2.rs +++ b/tests/ui/threads-sendsync/spawn2.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/spawning-with-debug.rs b/tests/ui/threads-sendsync/spawning-with-debug.rs index 58f1743527c88..90a81c1e53bcb 100644 --- a/tests/ui/threads-sendsync/spawning-with-debug.rs +++ b/tests/ui/threads-sendsync/spawning-with-debug.rs @@ -3,7 +3,7 @@ #![allow(unused_mut)] //@ ignore-windows //@ exec-env:RUST_LOG=debug -//@ ignore-emscripten no threads support +//@ needs-threads // regression test for issue #10405, make sure we don't call println! too soon. diff --git a/tests/ui/threads-sendsync/task-comm-0.rs b/tests/ui/threads-sendsync/task-comm-0.rs index 06ce739b8e597..50f2b59189481 100644 --- a/tests/ui/threads-sendsync/task-comm-0.rs +++ b/tests/ui/threads-sendsync/task-comm-0.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-comm-1.rs b/tests/ui/threads-sendsync/task-comm-1.rs index 77ca940e947b9..41592bd916b4e 100644 --- a/tests/ui/threads-sendsync/task-comm-1.rs +++ b/tests/ui/threads-sendsync/task-comm-1.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-10.rs b/tests/ui/threads-sendsync/task-comm-10.rs index 6f043b64a092e..844652c0dde49 100644 --- a/tests/ui/threads-sendsync/task-comm-10.rs +++ b/tests/ui/threads-sendsync/task-comm-10.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] #![allow(unused_mut)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-comm-11.rs b/tests/ui/threads-sendsync/task-comm-11.rs index 51f134344354c..199082fda96de 100644 --- a/tests/ui/threads-sendsync/task-comm-11.rs +++ b/tests/ui/threads-sendsync/task-comm-11.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] //@ pretty-expanded FIXME #23616 -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-12.rs b/tests/ui/threads-sendsync/task-comm-12.rs index cb1fb774f1073..7be7ec4c988b1 100644 --- a/tests/ui/threads-sendsync/task-comm-12.rs +++ b/tests/ui/threads-sendsync/task-comm-12.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] #![allow(unused_mut)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-13.rs b/tests/ui/threads-sendsync/task-comm-13.rs index 6b5384e3f08a8..414e6e0db76da 100644 --- a/tests/ui/threads-sendsync/task-comm-13.rs +++ b/tests/ui/threads-sendsync/task-comm-13.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_variables)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-14.rs b/tests/ui/threads-sendsync/task-comm-14.rs index 65cc750a7c39e..54deb221294ae 100644 --- a/tests/ui/threads-sendsync/task-comm-14.rs +++ b/tests/ui/threads-sendsync/task-comm-14.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_parens)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-15.rs b/tests/ui/threads-sendsync/task-comm-15.rs index 844a18b61589a..f487bf3cc84b3 100644 --- a/tests/ui/threads-sendsync/task-comm-15.rs +++ b/tests/ui/threads-sendsync/task-comm-15.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads //@ pretty-expanded FIXME #23616 use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-comm-17.rs b/tests/ui/threads-sendsync/task-comm-17.rs index 14ef4dd3edecc..687322d4dc963 100644 --- a/tests/ui/threads-sendsync/task-comm-17.rs +++ b/tests/ui/threads-sendsync/task-comm-17.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads //@ pretty-expanded FIXME #23616 // Issue #922 diff --git a/tests/ui/threads-sendsync/task-comm-3.rs b/tests/ui/threads-sendsync/task-comm-3.rs index 1f2a6406d79bd..26f3eaf9dc6c4 100644 --- a/tests/ui/threads-sendsync/task-comm-3.rs +++ b/tests/ui/threads-sendsync/task-comm-3.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-comm-7.rs b/tests/ui/threads-sendsync/task-comm-7.rs index f6e77986e16c3..d9b322daa66bf 100644 --- a/tests/ui/threads-sendsync/task-comm-7.rs +++ b/tests/ui/threads-sendsync/task-comm-7.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(unused_must_use)] #![allow(unused_assignments)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/task-comm-9.rs b/tests/ui/threads-sendsync/task-comm-9.rs index f8fe680e5e013..3e617e4a40c28 100644 --- a/tests/ui/threads-sendsync/task-comm-9.rs +++ b/tests/ui/threads-sendsync/task-comm-9.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::{channel, Sender}; diff --git a/tests/ui/threads-sendsync/task-life-0.rs b/tests/ui/threads-sendsync/task-life-0.rs index a4652197afc7e..d3eca5d371fb8 100644 --- a/tests/ui/threads-sendsync/task-life-0.rs +++ b/tests/ui/threads-sendsync/task-life-0.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads //@ pretty-expanded FIXME #23616 use std::thread; diff --git a/tests/ui/threads-sendsync/task-spawn-barefn.rs b/tests/ui/threads-sendsync/task-spawn-barefn.rs index 2c957878c95f6..a97e92206e206 100644 --- a/tests/ui/threads-sendsync/task-spawn-barefn.rs +++ b/tests/ui/threads-sendsync/task-spawn-barefn.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:Ensure that the child thread runs by panicking -//@ ignore-emscripten Needs threads. +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/task-spawn-move-and-copy.rs b/tests/ui/threads-sendsync/task-spawn-move-and-copy.rs index 442955421d83e..ea1c6a9b1081b 100644 --- a/tests/ui/threads-sendsync/task-spawn-move-and-copy.rs +++ b/tests/ui/threads-sendsync/task-spawn-move-and-copy.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; use std::sync::mpsc::channel; diff --git a/tests/ui/threads-sendsync/task-stderr.rs b/tests/ui/threads-sendsync/task-stderr.rs index 0f215a2b763ac..cad10c7a7922c 100644 --- a/tests/ui/threads-sendsync/task-stderr.rs +++ b/tests/ui/threads-sendsync/task-stderr.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind #![feature(internal_output_capture)] diff --git a/tests/ui/threads-sendsync/tcp-stress.rs b/tests/ui/threads-sendsync/tcp-stress.rs index 488cab4014085..429a465731408 100644 --- a/tests/ui/threads-sendsync/tcp-stress.rs +++ b/tests/ui/threads-sendsync/tcp-stress.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-android needs extra network permissions -//@ ignore-emscripten no threads or sockets support +//@ needs-threads //@ ignore-netbsd system ulimit (Too many open files) //@ ignore-openbsd system ulimit (Too many open files) diff --git a/tests/ui/threads-sendsync/test-tasks-invalid-value.rs b/tests/ui/threads-sendsync/test-tasks-invalid-value.rs index 4b38b9ce2c9bc..127086743ca82 100644 --- a/tests/ui/threads-sendsync/test-tasks-invalid-value.rs +++ b/tests/ui/threads-sendsync/test-tasks-invalid-value.rs @@ -5,7 +5,7 @@ //@ error-pattern:should be a positive integer //@ compile-flags: --test //@ exec-env:RUST_TEST_THREADS=foo -//@ ignore-emscripten +//@ needs-threads #[test] fn do_nothing() {} diff --git a/tests/ui/threads-sendsync/threads.rs b/tests/ui/threads-sendsync/threads.rs index 7b7e52abab459..f3ed7890364b5 100644 --- a/tests/ui/threads-sendsync/threads.rs +++ b/tests/ui/threads-sendsync/threads.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs b/tests/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs index 66fd6169db0e5..8417665941232 100644 --- a/tests/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs +++ b/tests/ui/threads-sendsync/tls-dtors-are-run-in-a-static-binary.rs @@ -1,6 +1,6 @@ //@ run-pass //@ no-prefer-dynamic -//@ ignore-emscripten no threads support +//@ needs-threads static mut HIT: bool = false; diff --git a/tests/ui/threads-sendsync/tls-init-on-init.rs b/tests/ui/threads-sendsync/tls-init-on-init.rs index ba5e4698e63dd..fd764669e7f61 100644 --- a/tests/ui/threads-sendsync/tls-init-on-init.rs +++ b/tests/ui/threads-sendsync/tls-init-on-init.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(stable_features)] -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(thread_local_try_with)] diff --git a/tests/ui/threads-sendsync/tls-try-with.rs b/tests/ui/threads-sendsync/tls-try-with.rs index d9af1caf74117..72cee219a0abd 100644 --- a/tests/ui/threads-sendsync/tls-try-with.rs +++ b/tests/ui/threads-sendsync/tls-try-with.rs @@ -1,7 +1,7 @@ //@ run-pass #![allow(stable_features)] -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(thread_local_try_with)] diff --git a/tests/ui/threads-sendsync/unwind-resource.rs b/tests/ui/threads-sendsync/unwind-resource.rs index ea9e0c7514ce1..3b1ab57b46e3e 100644 --- a/tests/ui/threads-sendsync/unwind-resource.rs +++ b/tests/ui/threads-sendsync/unwind-resource.rs @@ -2,7 +2,7 @@ //@ needs-unwind #![allow(non_camel_case_types)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::mpsc::{channel, Sender}; use std::thread; diff --git a/tests/ui/threads-sendsync/yield.rs b/tests/ui/threads-sendsync/yield.rs index 4d89b10af9578..99d14bd92eaa5 100644 --- a/tests/ui/threads-sendsync/yield.rs +++ b/tests/ui/threads-sendsync/yield.rs @@ -2,7 +2,7 @@ #![allow(unused_must_use)] #![allow(unused_mut)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/threads-sendsync/yield1.rs b/tests/ui/threads-sendsync/yield1.rs index b003a70f47eee..c965d2fc3033e 100644 --- a/tests/ui/threads-sendsync/yield1.rs +++ b/tests/ui/threads-sendsync/yield1.rs @@ -2,7 +2,7 @@ #![allow(unused_must_use)] #![allow(unused_mut)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/traits/bound/in-arc.rs b/tests/ui/traits/bound/in-arc.rs index 40a6115e8381e..2616ad84ff874 100644 --- a/tests/ui/traits/bound/in-arc.rs +++ b/tests/ui/traits/bound/in-arc.rs @@ -3,7 +3,7 @@ // Tests that a heterogeneous list of existential `dyn` types can be put inside an Arc // and shared between threads as long as all types fulfill Send. -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::Arc; use std::sync::mpsc::channel;