Rollup merge of #122109 - alexcrichton:compiletests-needs-threads, r=workingjubilee
compiletest: Add a `//@ needs-threads` directive This commit is extracted from #122036 and adds a new directive to the `compiletest` test runner, `//@ needs-threads`. This is intended to capture the need that a target must implement threading to execute a specific test, typically one that uses `std::thread`. This is primarily done for WebAssembly targets which currently do not have threads by default. This enables transitioning a lot of `//@ ignore-wasm*`-style ignores into a more self-documenting `//@ needs-threads` directive. Additionally the `wasm32-wasi-preview1-threads` target, for example, does actually have threads, but isn't tested in CI at this time. This change enables running these tests for that target, but not other wasm targets.
This commit is contained in:
commit
5642b04186
@ -451,6 +451,15 @@ pub fn can_unwind(&self) -> bool {
|
|||||||
self.target_cfg().panic == PanicStrategy::Unwind
|
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 {
|
pub fn has_asm_support(&self) -> bool {
|
||||||
static ASM_SUPPORTED_ARCHS: &[&str] = &[
|
static ASM_SUPPORTED_ARCHS: &[&str] = &[
|
||||||
"x86", "x86_64", "arm", "aarch64", "riscv32",
|
"x86", "x86_64", "arm", "aarch64", "riscv32",
|
||||||
|
@ -787,6 +787,7 @@ pub fn line_directive<'line>(
|
|||||||
"needs-sanitizer-shadow-call-stack",
|
"needs-sanitizer-shadow-call-stack",
|
||||||
"needs-sanitizer-support",
|
"needs-sanitizer-support",
|
||||||
"needs-sanitizer-thread",
|
"needs-sanitizer-thread",
|
||||||
|
"needs-threads",
|
||||||
"needs-unwind",
|
"needs-unwind",
|
||||||
"needs-xray",
|
"needs-xray",
|
||||||
"no-prefer-dynamic",
|
"no-prefer-dynamic",
|
||||||
|
@ -84,6 +84,11 @@ pub(super) fn handle_needs(
|
|||||||
condition: config.run_enabled(),
|
condition: config.run_enabled(),
|
||||||
ignore_reason: "ignored when running the resulting test binaries is disabled",
|
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 {
|
Need {
|
||||||
name: "needs-unwind",
|
name: "needs-unwind",
|
||||||
condition: config.can_unwind(),
|
condition: config.can_unwind(),
|
||||||
|
@ -592,3 +592,23 @@ fn ignore_mode() {
|
|||||||
assert!(!check_ignore(&config, &format!("//@ ignore-mode-{other}")));
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//@ ignore-wasm32-bare compiled with panic=abort by default
|
//@ needs-unwind
|
||||||
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
//@ compile-flags: -C no-prepopulate-passes -Copt-level=0
|
||||||
//
|
//
|
||||||
|
|
||||||
|
2
tests/ui/abi/extern/extern-call-deep2.rs
vendored
2
tests/ui/abi/extern/extern-call-deep2.rs
vendored
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
2
tests/ui/abi/extern/extern-call-scrub.rs
vendored
2
tests/ui/abi/extern/extern-call-scrub.rs
vendored
@ -4,7 +4,7 @@
|
|||||||
// make sure the stack pointers are maintained properly in both
|
// make sure the stack pointers are maintained properly in both
|
||||||
// directions
|
// directions
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
extern crate libc;
|
extern crate libc;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
#![feature(rustc_private)]
|
#![feature(rustc_private)]
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
// optimisation.
|
// optimisation.
|
||||||
|
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
#![feature(intrinsics)]
|
#![feature(intrinsics)]
|
||||||
|
|
||||||
use std::{mem, thread};
|
use std::{mem, thread};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads
|
//@ needs-threads
|
||||||
//@ compile-flags: -O
|
//@ compile-flags: -O
|
||||||
|
|
||||||
// Tests that the `vec!` macro does not overflow the stack when it is
|
// Tests that the `vec!` macro does not overflow the stack when it is
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
//@ revisions: default nomiropt
|
//@ revisions: default nomiropt
|
||||||
//@[nomiropt]compile-flags: -Z mir-opt-level=0
|
//@[nomiropt]compile-flags: -Z mir-opt-level=0
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ compile-flags: --test
|
//@ compile-flags: --test
|
||||||
|
|
||||||
#![feature(coroutines, coroutine_trait)]
|
#![feature(coroutines, coroutine_trait)]
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// that use capture clauses.
|
// that use capture clauses.
|
||||||
|
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
extern crate cci_capture_clause;
|
extern crate cci_capture_clause;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-emscripten No support for threads
|
//@ needs-threads
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A somewhat reduced test case to expose some Valgrind issues.
|
A somewhat reduced test case to expose some Valgrind issues.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
// Regression test for unwrapping the result of `join`, issue #21291
|
// Regression test for unwrapping the result of `join`, issue #21291
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let f = || || 0;
|
let f = || || 0;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ edition:2018
|
//@ edition:2018
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-windows
|
//@ ignore-windows
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ compile-flags: -C lto
|
//@ compile-flags: -C lto
|
||||||
//@ no-prefer-dynamic
|
//@ no-prefer-dynamic
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ needs-unwind
|
//@ needs-unwind
|
||||||
|
//@ needs-threads
|
||||||
#![allow(stable_features)]
|
#![allow(stable_features)]
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
|
||||||
|
|
||||||
#![feature(std_panic)]
|
#![feature(std_panic)]
|
||||||
|
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-fail
|
//@ run-fail
|
||||||
//@ error-pattern:thread '<unnamed>' panicked
|
//@ error-pattern:thread '<unnamed>' panicked
|
||||||
//@ error-pattern:test
|
//@ error-pattern:test
|
||||||
//@ ignore-emscripten Needs threads
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-fail
|
//@ run-fail
|
||||||
//@ error-pattern:thread 'owned name' panicked
|
//@ error-pattern:thread 'owned name' panicked
|
||||||
//@ error-pattern:test
|
//@ error-pattern:test
|
||||||
//@ ignore-emscripten Needs threads.
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread::Builder;
|
use std::thread::Builder;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// https://github.com/fortanix/rust-sgx/issues/109
|
// https://github.com/fortanix/rust-sgx/issues/109
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::{net::TcpListener, sync::mpsc, thread};
|
use std::{net::TcpListener, sync::mpsc, thread};
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// program should terminate when std::process::exit is called from any thread
|
// program should terminate when std::process::exit is called from any thread
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::{process, thread};
|
use std::{process, thread};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
//@ run-flags: --test-threads=1 test1 test2
|
//@ run-flags: --test-threads=1 test1 test2
|
||||||
//@ check-run-results
|
//@ check-run-results
|
||||||
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test1() {}
|
fn test1() {}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//@ run-flags: --test-threads=1
|
//@ run-flags: --test-threads=1
|
||||||
//@ check-run-results
|
//@ check-run-results
|
||||||
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
//@ normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ compile-flags: -O
|
//@ compile-flags: -O
|
||||||
//@ ignore-nto Doesn't work without emulated TLS enabled (in LLVM)
|
//@ ignore-nto Doesn't work without emulated TLS enabled (in LLVM)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Reported as issue #126, child leaks the string.
|
// Reported as issue #126, child leaks the string.
|
||||||
|
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let t = thread::spawn(move|| { child(&tx) });
|
let t = thread::spawn(move || { child(&tx) });
|
||||||
let y = rx.recv().unwrap();
|
let y = rx.recv().unwrap();
|
||||||
println!("received");
|
println!("received");
|
||||||
println!("{}", y);
|
println!("{}", y);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no processes
|
//@ needs-threads
|
||||||
//@ ignore-sgx no processes
|
//@ ignore-sgx no processes
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads
|
//@ needs-threads
|
||||||
//@ ignore-sgx no processes
|
//@ ignore-sgx no processes
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//@ ignore-wasm32
|
//@ needs-threads
|
||||||
//@ dont-check-compiler-stderr
|
//@ dont-check-compiler-stderr
|
||||||
#![feature(cfg_target_thread_local, thread_local_internals)]
|
#![feature(cfg_target_thread_local, thread_local_internals)]
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//@ ignore-wasm32
|
//@ needs-threads
|
||||||
#![feature(thread_local)]
|
#![feature(thread_local)]
|
||||||
#![feature(cfg_target_thread_local, thread_local_internals)]
|
#![feature(cfg_target_thread_local, thread_local_internals)]
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Receiver};
|
use std::sync::mpsc::{channel, Receiver};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(deprecated)]
|
#![allow(deprecated)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{TryRecvError, channel};
|
use std::sync::mpsc::{TryRecvError, channel};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ compile-flags:--test
|
//@ compile-flags:--test
|
||||||
//@ ignore-emscripten
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
use std::sync::mpsc::TryRecvError;
|
use std::sync::mpsc::TryRecvError;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Make sure we can spawn tasks that take different types of
|
Make sure we can spawn tasks that take different types of
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-windows
|
//@ ignore-windows
|
||||||
//@ exec-env:RUST_LOG=debug
|
//@ 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.
|
// regression test for issue #10405, make sure we don't call println! too soon.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_variables)]
|
#![allow(unused_variables)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_parens)]
|
#![allow(unused_parens)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
|
|
||||||
// Issue #922
|
// Issue #922
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(unused_assignments)]
|
#![allow(unused_assignments)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ pretty-expanded FIXME #23616
|
//@ pretty-expanded FIXME #23616
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-fail
|
//@ run-fail
|
||||||
//@ error-pattern:Ensure that the child thread runs by panicking
|
//@ error-pattern:Ensure that the child thread runs by panicking
|
||||||
//@ ignore-emscripten Needs threads.
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
//@ needs-unwind
|
//@ needs-unwind
|
||||||
|
|
||||||
#![feature(internal_output_capture)]
|
#![feature(internal_output_capture)]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ ignore-android needs extra network permissions
|
//@ ignore-android needs extra network permissions
|
||||||
//@ ignore-emscripten no threads or sockets support
|
//@ needs-threads
|
||||||
//@ ignore-netbsd system ulimit (Too many open files)
|
//@ ignore-netbsd system ulimit (Too many open files)
|
||||||
//@ ignore-openbsd system ulimit (Too many open files)
|
//@ ignore-openbsd system ulimit (Too many open files)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
//@ error-pattern:should be a positive integer
|
//@ error-pattern:should be a positive integer
|
||||||
//@ compile-flags: --test
|
//@ compile-flags: --test
|
||||||
//@ exec-env:RUST_TEST_THREADS=foo
|
//@ exec-env:RUST_TEST_THREADS=foo
|
||||||
//@ ignore-emscripten
|
//@ needs-threads
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn do_nothing() {}
|
fn do_nothing() {}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
//@ no-prefer-dynamic
|
//@ no-prefer-dynamic
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
static mut HIT: bool = false;
|
static mut HIT: bool = false;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(stable_features)]
|
#![allow(stable_features)]
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
#![feature(thread_local_try_with)]
|
#![feature(thread_local_try_with)]
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(stable_features)]
|
#![allow(stable_features)]
|
||||||
|
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
#![feature(thread_local_try_with)]
|
#![feature(thread_local_try_with)]
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//@ needs-unwind
|
//@ needs-unwind
|
||||||
|
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::sync::mpsc::{channel, Sender};
|
use std::sync::mpsc::{channel, Sender};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
//@ ignore-emscripten no threads support
|
//@ needs-threads
|
||||||
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// Tests that a heterogeneous list of existential `dyn` types can be put inside an Arc
|
// 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.
|
// 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::Arc;
|
||||||
use std::sync::mpsc::channel;
|
use std::sync::mpsc::channel;
|
||||||
|
Loading…
Reference in New Issue
Block a user