1
Fork 0

Rollup merge of #135926 - jieyouxu:needs-subprocess-thread, r=oli-obk

Implement `needs-subprocess` directive, and cleanup a bunch of tests to use `needs-{subprocess,threads}`

### Summary

Closes #128295.

- Implements `//@ needs-subprocess` directive in compiletest as requested in #128295. However, compiletest is a host tool, so we can't just try to spawn process because that spawns the process on *host*, not the *target*, under cross-compilation scenarios.
    - The short-term solution is to add *Yet Another* list of allow-list targets.
    - The long-term solution is to first check if a `$target` supports std, then try to run a binary to do run-time capability detection *on the target*. But that is tricky because you have to build-and-run a binary *for the target*.
    - This PR picks the short-term solution, because the long-term solution is highly non-trivial, and it's already an improvement over individual `ignore-*`s all over the place.
    - Opened an issue about the long-term solution in #135928.
- Documents `//@ needs-subprocess` in rustc-dev-guide.
- Replace `ignore-{wasm,wasm32,emscripten,sgx}` with `needs-{subprocess,threads}` where suitable in tests.
- Some drive-by test changes as I was trying to figure out if I could use `needs-{subprocess,threads}` and found some bits needlessly distracting.

Count of tests that use `ignore-{wasm,wasm32,emscripten,sgx}` before and after this PR:

| State | `ignore-sgx` | `ignore-wasm` | `ignore-emscripten` |
| - | - | - | - |
| Before this PR | 96 | 88 | 207 |
| After this PR | 36 | 38 | 61 |

<details>
<summary>Commands used to find out locally</summary>

```
--- before

[17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-sgx" tests | wc -l
96
[17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-wasm" tests | wc -l
88
[17:40] Joe:rust (fresh) | rg --no-ignore -l "ignore-emscripten" tests | wc -l
207

--- after

[17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-sgx" tests | wc -l
36
[17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-wasm" tests | wc -l
38
[17:39] Joe:rust (needs-subprocess-thread) | rg --no-ignore -l "ignore-emscripten" tests | wc -l
61
```
</details>

### Review advice

- Best reviewed commit-by-commit.
- Non-trivial test changes (not mechanically simple replacements) are split into individual commits to help with review. Their individual commit messages give some basic description of the changes.
- I *could* split some test changes out into another PR, but I found that I needed to change some tests to `needs-threads`, some to `needs-subprocess`, and some needed to use *both*, so they might conflict and become very annoying.

---

r? ``@ghost`` (need to run try jobs)

try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: aarch64-gnu
try-job: test-various
try-job: armhf-gnu
This commit is contained in:
Matthias Krüger 2025-01-24 16:25:43 +01:00 committed by GitHub
commit e96bb6ae1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
214 changed files with 292 additions and 334 deletions

View file

@ -94,7 +94,7 @@ for more details.
| Directive | Explanation | Supported test suites | Possible values | | Directive | Explanation | Supported test suites | Possible values |
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|-----------------------------------------------------------------------------------------| |-----------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|-----------------------------------------------------------------------------------------|
| `check-run-results` | Check run test binary `run-{pass,fail}` output snapshot | `ui`, `crashes`, `incremental` if `run-pass` | N/A | | `check-run-results` | Check run test binary `run-{pass,fail}` output snapshot | `ui`, `crashes`, `incremental` if `run-pass` | N/A |
| `error-pattern` | Check that output contains a specific string | `ui`, `crashes`, `incremental` if `run-pass` | String | | `error-pattern` | Check that output contains a specific string | `ui`, `crashes`, `incremental` if `run-pass` | String |
| `regex-error-pattern` | Check that output contains a regex pattern | `ui`, `crashes`, `incremental` if `run-pass` | Regex | | `regex-error-pattern` | Check that output contains a regex pattern | `ui`, `crashes`, `incremental` if `run-pass` | Regex |
| `check-stdout` | Check `stdout` against `error-pattern`s from running test binary[^check_stdout] | `ui`, `crashes`, `incremental` | N/A | | `check-stdout` | Check `stdout` against `error-pattern`s from running test binary[^check_stdout] | `ui`, `crashes`, `incremental` | N/A |
| `normalize-stderr-32bit` | Normalize actual stderr (for 32-bit platforms) with a rule `"<raw>" -> "<normalized>"` before comparing against snapshot | `ui`, `incremental` | `"<RAW>" -> "<NORMALIZED>"`, `<RAW>`/`<NORMALIZED>` is regex capture and replace syntax | | `normalize-stderr-32bit` | Normalize actual stderr (for 32-bit platforms) with a rule `"<raw>" -> "<normalized>"` before comparing against snapshot | `ui`, `incremental` | `"<RAW>" -> "<NORMALIZED>"`, `<RAW>`/`<NORMALIZED>` is regex capture and replace syntax |
@ -176,6 +176,7 @@ settings:
- `needs-rust-lld` — ignores if the rust lld support is not enabled (`rust.lld = - `needs-rust-lld` — ignores if the rust lld support is not enabled (`rust.lld =
true` in `config.toml`) true` in `config.toml`)
- `needs-threads` — ignores if the target does not have threading support - `needs-threads` — ignores if the target does not have threading support
- `needs-subprocess` — ignores if the target does not have subprocess support
- `needs-symlink` — ignores if the target does not support symlinks. This can be - `needs-symlink` — ignores if the target does not support symlinks. This can be
the case on Windows if the developer did not enable privileged symlink the case on Windows if the developer did not enable privileged symlink
permissions. permissions.

View file

@ -488,6 +488,17 @@ impl Config {
git_merge_commit_email: &self.git_merge_commit_email, git_merge_commit_email: &self.git_merge_commit_email,
} }
} }
pub fn has_subprocess_support(&self) -> bool {
// FIXME(#135928): compiletest is always a **host** tool. Building and running an
// capability detection executable against the **target** is not trivial. The short term
// solution here is to hard-code some targets to allow/deny, unfortunately.
let unsupported_target = self.target_cfg().env == "sgx"
|| matches!(self.target_cfg().arch.as_str(), "wasm32" | "wasm64")
|| self.target_cfg().os == "emscripten";
!unsupported_target
}
} }
/// Known widths of `target_has_atomic`. /// Known widths of `target_has_atomic`.

View file

@ -152,6 +152,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"needs-sanitizer-support", "needs-sanitizer-support",
"needs-sanitizer-thread", "needs-sanitizer-thread",
"needs-std-debug-assertions", "needs-std-debug-assertions",
"needs-subprocess",
"needs-symlink", "needs-symlink",
"needs-target-has-atomic", "needs-target-has-atomic",
"needs-threads", "needs-threads",

View file

@ -94,6 +94,11 @@ pub(super) fn handle_needs(
condition: config.has_threads(), condition: config.has_threads(),
ignore_reason: "ignored on targets without threading support", ignore_reason: "ignored on targets without threading support",
}, },
Need {
name: "needs-subprocess",
condition: config.has_subprocess_support(),
ignore_reason: "ignored on targets without subprocess support",
},
Need { Need {
name: "needs-unwind", name: "needs-unwind",
condition: config.can_unwind(), condition: config.can_unwind(),
@ -351,6 +356,9 @@ fn find_dlltool(config: &Config) -> bool {
dlltool_found dlltool_found
} }
// FIXME(#135928): this is actually not quite right because this detection is run on the **host**.
// This however still helps the case of windows -> windows local development in case symlinks are
// not available.
#[cfg(windows)] #[cfg(windows)]
fn has_symlinks() -> bool { fn has_symlinks() -> bool {
if std::env::var_os("CI").is_some() { if std::env::var_os("CI").is_some() {

View file

@ -2204,7 +2204,6 @@ ui/issues/issue-3895.rs
ui/issues/issue-38954.rs ui/issues/issue-38954.rs
ui/issues/issue-38987.rs ui/issues/issue-38987.rs
ui/issues/issue-39089.rs ui/issues/issue-39089.rs
ui/issues/issue-39175.rs
ui/issues/issue-39211.rs ui/issues/issue-39211.rs
ui/issues/issue-39367.rs ui/issues/issue-39367.rs
ui/issues/issue-39548.rs ui/issues/issue-39548.rs

View file

@ -17,7 +17,7 @@ use ignore::Walk;
const ENTRY_LIMIT: u32 = 901; const ENTRY_LIMIT: u32 = 901;
// FIXME: The following limits should be reduced eventually. // FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: u32 = 1664; const ISSUES_ENTRY_LIMIT: u32 = 1662;
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files "rs", // test source files

View file

@ -5,8 +5,7 @@
// without #[repr(simd)] // without #[repr(simd)]
//@ run-pass //@ run-pass
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
#![feature(avx512_target_feature)] #![feature(avx512_target_feature)]

View file

@ -1,6 +1,5 @@
//@ run-pass //@ run-pass
//@ ignore-wasm32 can't run commands //@ needs-subprocess
//@ ignore-sgx no processes
//@ ignore-fuchsia must translate zircon signal to SIGSEGV/SIGBUS, FIXME (#58590) //@ ignore-fuchsia must translate zircon signal to SIGSEGV/SIGBUS, FIXME (#58590)
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -3,7 +3,7 @@
//@[aarch64] only-aarch64 //@[aarch64] only-aarch64
//@[x32] only-x86 //@[x32] only-x86
//@[x64] only-x86_64 //@[x64] only-x86_64
//@ ignore-sgx no processes //@ needs-subprocess
//@ ignore-musl FIXME #31506 //@ ignore-musl FIXME #31506
//@ ignore-fuchsia no exception handler registered for segfault //@ ignore-fuchsia no exception handler registered for segfault
//@ compile-flags: -C lto //@ compile-flags: -C lto

View file

@ -3,8 +3,7 @@
//@[aarch64] only-aarch64 //@[aarch64] only-aarch64
//@[x32] only-x86 //@[x32] only-x86
//@[x64] only-x86_64 //@[x64] only-x86_64
//@ ignore-emscripten no processes //@ needs-subprocess
//@ ignore-sgx no processes
//@ ignore-fuchsia no exception handler registered for segfault //@ ignore-fuchsia no exception handler registered for segfault
//@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino //@ ignore-nto Crash analysis impossible at SIGSEGV in QNX Neutrino
//@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't //@ ignore-ios Stack probes are enabled, but the SIGSEGV handler isn't

View file

@ -1,6 +1,5 @@
//@ run-pass //@ run-pass
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
use std::alloc::{Layout, handle_alloc_error}; use std::alloc::{Layout, handle_alloc_error};
use std::env; use std::env;

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:index out of bounds //@ error-pattern:index out of bounds
//@ ignore-emscripten no processes //@ needs-subprocess
use std::mem::size_of; use std::mem::size_of;

View file

@ -1,12 +1,12 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ needs-threads
#![allow(overflowing_literals)] #![allow(overflowing_literals)]
// Test that we cleanup a fixed size Box<[D; k]> properly when D has a // Test that we cleanup a fixed size Box<[D; k]> properly when D has a
// destructor. // destructor.
//@ ignore-emscripten no threads support
use std::thread; use std::thread;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};

View file

@ -1,12 +1,12 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ needs-threads
#![allow(overflowing_literals)] #![allow(overflowing_literals)]
// Test that we cleanup dynamic sized Box<[D]> properly when D has a // Test that we cleanup dynamic sized Box<[D]> properly when D has a
// destructor. // destructor.
//@ ignore-emscripten no threads support
use std::thread; use std::thread;
use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::atomic::{AtomicUsize, Ordering};

View file

@ -2,7 +2,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:index out of bounds //@ error-pattern:index out of bounds
//@ ignore-emscripten no processes //@ needs-subprocess
#[allow(unconditional_panic)] #[allow(unconditional_panic)]
fn main() { fn main() {

View file

@ -1,8 +1,8 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
#![allow(overflowing_literals)] //@ needs-threads
//@ ignore-emscripten no threads support #![allow(overflowing_literals)]
// Test that using the `vec!` macro nested within itself works when // Test that using the `vec!` macro nested within itself works when
// the contents implement Drop and we hit a panic in the middle of // the contents implement Drop and we hit a panic in the middle of

View file

@ -1,7 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ needs-threads
//@ ignore-emscripten no threads support
// Test that if a slicing expr[..] fails, the correct cleanups happen. // Test that if a slicing expr[..] fails, the correct cleanups happen.

View file

@ -1,7 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ needs-threads
//@ ignore-emscripten no threads support
// Test that if a slicing expr[..] fails, the correct cleanups happen. // Test that if a slicing expr[..] fails, the correct cleanups happen.

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:index out of bounds: the len is 1 but the index is 2 //@ error-pattern:index out of bounds: the len is 1 but the index is 2
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let v: Vec<isize> = vec![10]; let v: Vec<isize> = vec![10];

View file

@ -1,8 +1,7 @@
//@ run-pass //@ run-pass
//@ ignore-android FIXME #17520 //@ ignore-android FIXME #17520
//@ ignore-wasm32 spawning processes is not supported //@ needs-subprocess
//@ ignore-openbsd no support for libbacktrace without filename //@ ignore-openbsd no support for libbacktrace without filename
//@ ignore-sgx no processes
//@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test //@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
//@ ignore-fuchsia Backtraces not symbolized //@ ignore-fuchsia Backtraces not symbolized
//@ compile-flags:-g //@ compile-flags:-g

View file

@ -1,8 +1,7 @@
//@ run-pass //@ run-pass
//@ ignore-android FIXME #17520 //@ ignore-android FIXME #17520
//@ ignore-wasm32 spawning processes is not supported //@ needs-subprocess
//@ ignore-openbsd no support for libbacktrace without filename //@ ignore-openbsd no support for libbacktrace without filename
//@ ignore-sgx no processes
//@ ignore-fuchsia Backtraces not symbolized //@ ignore-fuchsia Backtraces not symbolized
//@ compile-flags:-g //@ compile-flags:-g
//@ compile-flags:-Cstrip=none //@ compile-flags:-Cstrip=none

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:quux //@ error-pattern:quux
//@ ignore-emscripten no processes //@ needs-subprocess
fn foo() -> ! { fn foo() -> ! {
panic!("quux"); panic!("quux");

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:quux //@ error-pattern:quux
//@ ignore-emscripten no processes //@ needs-subprocess
fn my_err(s: String) -> ! { fn my_err(s: String) -> ! {
println!("{}", s); println!("{}", s);

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:panic 1 //@ error-pattern:panic 1
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let x = 2; let x = 2;

View file

@ -3,7 +3,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
struct Parser<'i: 't, 't>(&'i u8, &'t u8); struct Parser<'i: 't, 't>(&'i u8, &'t u8);

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
use std::thread; use std::thread;

View file

@ -20,7 +20,7 @@
// It's unclear how likely such a bug is to recur, but it seems like a // It's unclear how likely such a bug is to recur, but it seems like a
// scenario worth testing. // scenario worth testing.
//@ ignore-emscripten no threads support //@ needs-threads
use std::thread; use std::thread;

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:oops //@ error-pattern:oops
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let func = || -> ! { let func = || -> ! {

View file

@ -1,8 +1,7 @@
//@ run-pass //@ run-pass
//@ ignore-windows - this is a unix-specific test //@ only-unix (this is a unix-specific test)
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
use std::env; use std::env;
use std::os::unix::process::CommandExt; use std::os::unix::process::CommandExt;
use std::process::Command; use std::process::Command;

View file

@ -1,7 +1,6 @@
//@ run-pass //@ run-pass
//@ no-prefer-dynamic We move the binary around, so do not depend dynamically on libstd //@ no-prefer-dynamic We move the binary around, so do not depend dynamically on libstd
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
//@ ignore-fuchsia Needs directory creation privilege //@ ignore-fuchsia Needs directory creation privilege
use std::env; use std::env;

View file

@ -1,13 +1,9 @@
//@ run-pass //@ run-pass
#![allow(stable_features)] //@ only-unix (this is a unix-specific test)
//@ ignore-windows - this is a unix-specific test //@ needs-subprocess
//@ ignore-wasm32 no processes
//@ ignore-sgx no processes
//@ ignore-fuchsia no execvp syscall provided //@ ignore-fuchsia no execvp syscall provided
#![feature(process_exec)]
use std::env; use std::env;
use std::os::unix::process::CommandExt; use std::os::unix::process::CommandExt;
use std::process::Command; use std::process::Command;

View file

@ -1,11 +1,9 @@
//@ run-pass //@ run-pass
//@ only-unix (this is a unix-specific test)
#![allow(stable_features)] //@ needs-subprocess
//@ ignore-windows - this is a unix-specific test
//@ ignore-wasm32 no processes
//@ ignore-sgx no processes
//@ ignore-fuchsia no execvp syscall //@ ignore-fuchsia no execvp syscall
#![feature(process_exec, rustc_private)]
#![feature(rustc_private)]
extern crate libc; extern crate libc;

View file

@ -1,9 +1,8 @@
//@ run-pass //@ run-pass
//@ ignore-windows - this is a unix-specific test //@ only-unix (this is a unix-specific test)
//@ ignore-wasm32
//@ ignore-sgx
//@ ignore-musl - returns dummy result for _SC_NGROUPS_MAX //@ ignore-musl - returns dummy result for _SC_NGROUPS_MAX
//@ ignore-nto - does not have `/bin/id`, expects groups to be i32 (not u32) //@ ignore-nto - does not have `/bin/id`, expects groups to be i32 (not u32)
//@ needs-subprocess
#![feature(rustc_private)] #![feature(rustc_private)]
#![feature(setgroups)] #![feature(setgroups)]

View file

@ -1,8 +1,7 @@
//@ run-pass //@ run-pass
//@ ignore-android //@ ignore-android
//@ ignore-emscripten
//@ ignore-sgx
//@ ignore-fuchsia no '/bin/sh', '/bin/ls' //@ ignore-fuchsia no '/bin/sh', '/bin/ls'
//@ needs-subprocess
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -1,6 +1,5 @@
//@ run-pass //@ run-pass
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
// Make sure that if a process doesn't have its stdio/stderr descriptors set up // Make sure that if a process doesn't have its stdio/stderr descriptors set up
// that we don't die in a large ball of fire // that we don't die in a large ball of fire

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:index out of bounds: the len is 5 but the index is 5 //@ error-pattern:index out of bounds: the len is 5 but the index is 5
//@ ignore-emscripten no processes //@ needs-subprocess
const fn test(x: usize) -> i32 { const fn test(x: usize) -> i32 {
[42;5][x] [42;5][x]

View file

@ -1,7 +1,7 @@
//@ run-fail //@ run-fail
//@ needs-unwind //@ needs-unwind
//@ error-pattern:coroutine resumed after panicking //@ error-pattern:coroutine resumed after panicking
//@ ignore-emscripten no processes //@ needs-subprocess
// Test that we get the correct message for resuming a panicked coroutine. // Test that we get the correct message for resuming a panicked coroutine.

View file

@ -2,7 +2,7 @@
#![allow(dead_code)] #![allow(dead_code)]
#![allow(unused_assignments)] #![allow(unused_assignments)]
#![allow(unused_variables)] #![allow(unused_variables)]
//@ ignore-emscripten no threads support //@ needs-threads
//@ needs-unwind //@ needs-unwind
use std::thread; use std::thread;

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
// Issue #787 // Issue #787
// Don't try to clean up uninitialized locals // Don't try to clean up uninitialized locals

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
fn f() -> ! { fn f() -> ! {
panic!() panic!()

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let _x = if false { let _x = if false {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:Number is odd //@ error-pattern:Number is odd
//@ ignore-emscripten no processes //@ needs-subprocess
fn even(x: usize) -> bool { fn even(x: usize) -> bool {
if x < 2 { if x < 2 {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:quux //@ error-pattern:quux
//@ ignore-emscripten no processes //@ needs-subprocess
fn my_err(s: String) -> ! { fn my_err(s: String) -> ! {
println!("{}", s); println!("{}", s);

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:stop //@ error-pattern:stop
//@ ignore-emscripten no processes //@ needs-subprocess
// #18576 // #18576
// Make sure that calling an extern function pointer in an unreachable // Make sure that calling an extern function pointer in an unreachable

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine // rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
// should still run destructors as it unwinds the stack. However, // should still run destructors as it unwinds the stack. However,

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine // rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
// should still run destructors as it unwinds the stack. However, // should still run destructors as it unwinds the stack. However,

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
fn f() -> ! { fn f() -> ! {
panic!() panic!()

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:capacity overflow //@ error-pattern:capacity overflow
//@ ignore-emscripten no processes //@ needs-subprocess
use std::collections::hash_map::HashMap; use std::collections::hash_map::HashMap;
use std::mem::size_of; use std::mem::size_of;

View file

@ -2,7 +2,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:panic works //@ error-pattern:panic works
//@ ignore-emscripten no processes //@ needs-subprocess
use std::*; use std::*;

View file

@ -1,11 +1,10 @@
// ignore-tidy-linelength
//! This test checks panic emitted from `mem::{uninitialized,zeroed}`.
//@ run-pass //@ run-pass
//@ revisions: default strict //@ revisions: default strict
//@ [strict]compile-flags: -Zstrict-init-checks //@ [strict]compile-flags: -Zstrict-init-checks
// ignore-tidy-linelength //@ needs-subprocess
//@ ignore-wasm32 spawning processes is not supported
//@ ignore-sgx no processes
//
// This test checks panic emitted from `mem::{uninitialized,zeroed}`.
#![allow(deprecated, invalid_value)] #![allow(deprecated, invalid_value)]
#![feature(never_type)] #![feature(never_type)]

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
pub fn main() { pub fn main() {
panic!(); panic!();

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:bad input //@ error-pattern:bad input
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
Some("foo").unwrap_or(panic!("bad input")).to_string(); Some("foo").unwrap_or(panic!("bad input")).to_string();

View file

@ -2,7 +2,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:Hello, world! //@ error-pattern:Hello, world!
//@ ignore-emscripten no processes //@ needs-subprocess
pub trait Parser { pub trait Parser {
type Input; type Input;

View file

@ -1,20 +1,16 @@
//@ run-pass //@ check-pass
#![allow(unused_must_use)]
#![allow(non_upper_case_globals)]
//@ ignore-emscripten no threads
use std::thread::Builder; use std::thread::Builder;
static generations: usize = 1024+256+128+49; static GENERATIONS: usize = 1024+256+128+49;
fn spawn(mut f: Box<dyn FnMut() + 'static + Send>) { fn spawn(mut f: Box<dyn FnMut() + 'static + Send>) {
Builder::new().stack_size(32 * 1024).spawn(move|| f()); Builder::new().stack_size(32 * 1024).spawn(move || f());
} }
fn child_no(x: usize) -> Box<dyn FnMut() + 'static + Send> { fn child_no(x: usize) -> Box<dyn FnMut() + 'static + Send> {
Box::new(move|| { Box::new(move || {
if x < generations { if x < GENERATIONS {
spawn(child_no(x+1)); spawn(child_no(x+1));
} }
}) })

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:panic evaluated //@ error-pattern:panic evaluated
//@ ignore-emscripten no processes //@ needs-subprocess
#[allow(unused_variables)] #[allow(unused_variables)]
fn main() { fn main() {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:panic evaluated //@ error-pattern:panic evaluated
//@ ignore-emscripten no processes //@ needs-subprocess
#[allow(unused_variables)] #[allow(unused_variables)]
fn main() { fn main() {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:index out of bounds //@ error-pattern:index out of bounds
//@ ignore-emscripten no processes //@ needs-subprocess
use std::mem; use std::mem;

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
use std::thread; use std::thread;

View file

@ -1,6 +1,6 @@
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
// Check that the destructors of simple enums are run on unwinding // Check that the destructors of simple enums are run on unwinding

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:custom message //@ error-pattern:custom message
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert!(false, "custom message"); assert!(false, "custom message");

View file

@ -2,7 +2,7 @@
#![allow(unused_attributes)] #![allow(unused_attributes)]
//@ aux-build:issue-29485.rs //@ aux-build:issue-29485.rs
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads //@ needs-threads
#[feature(recover)] #[feature(recover)]

View file

@ -5,7 +5,7 @@
// SIGTRAP injected by the drop-flag consistency checking. // SIGTRAP injected by the drop-flag consistency checking.
//@ needs-unwind //@ needs-unwind
//@ ignore-emscripten no threads support //@ needs-threads
struct Foo; struct Foo;

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:so long //@ error-pattern:so long
//@ ignore-emscripten no processes //@ needs-subprocess
#![allow(unreachable_code)] #![allow(unreachable_code)]

View file

@ -3,7 +3,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:panicking destructors ftw! //@ error-pattern:panicking destructors ftw!
//@ ignore-emscripten no processes //@ needs-subprocess
struct Observer<'a>(&'a mut FilledOnDrop); struct Observer<'a>(&'a mut FilledOnDrop);

View file

@ -1,6 +1,5 @@
//@ run-pass //@ run-pass
//@ ignore-wasm32 no processes //@ needs-subprocess
//@ ignore-sgx no processes
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::env; use std::env;

View file

@ -1,5 +1,5 @@
//@ run-pass //@ run-pass
//@ ignore-emscripten //@ needs-threads
#[repr(C)] #[repr(C)]
pub struct Foo(i128); pub struct Foo(i128);

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:overflow //@ error-pattern:overflow
//@ ignore-emscripten no processes //@ needs-subprocess
use std::time::{Duration, SystemTime}; use std::time::{Duration, SystemTime};

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:overflow //@ error-pattern:overflow
//@ ignore-emscripten no processes //@ needs-subprocess
use std::time::{Instant, Duration}; use std::time::{Instant, Duration};

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:overflow //@ error-pattern:overflow
//@ ignore-emscripten no processes //@ needs-subprocess
use std::time::{Duration, SystemTime}; use std::time::{Duration, SystemTime};

View file

@ -1,5 +1,6 @@
//@ revisions: edition2021 edition2024 //@ revisions: edition2021 edition2024
//@ ignore-wasm no panic or subprocess support //@ ignore-wasm no panic support
//@ needs-subprocess
//@ [edition2024] edition: 2024 //@ [edition2024] edition: 2024
//@ run-pass //@ run-pass
//@ needs-unwind //@ needs-unwind

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:moop //@ error-pattern:moop
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
for _ in 0_usize..10_usize { for _ in 0_usize..10_usize {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:assertion failed: 1 == 2 //@ error-pattern:assertion failed: 1 == 2
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert!(1 == 2); assert!(1 == 2);

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left == right` failed: 1 + 1 definitely should be 3 //@ error-pattern:assertion `left == right` failed: 1 + 1 definitely should be 3
//@ error-pattern: left: 2 //@ error-pattern: left: 2
//@ error-pattern: right: 3 //@ error-pattern: right: 3
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert_eq!(1 + 1, 3, "1 + 1 definitely should be 3"); assert_eq!(1 + 1, 3, "1 + 1 definitely should be 3");

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left == right` failed //@ error-pattern:assertion `left == right` failed
//@ error-pattern: left: 14 //@ error-pattern: left: 14
//@ error-pattern: right: 15 //@ error-pattern: right: 15
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert_eq!(14, 15); assert_eq!(14, 15);

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:assertion failed: false //@ error-pattern:assertion failed: false
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert!(false); assert!(false);

View file

@ -1,7 +1,7 @@
//@ run-fail //@ run-fail
//@ error-pattern: panicked //@ error-pattern: panicked
//@ error-pattern: test-assert-fmt 42 rust //@ error-pattern: test-assert-fmt 42 rust
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert!(false, "test-assert-fmt {} {}", 42, "rust"); assert!(false, "test-assert-fmt {} {}", 42, "rust");

View file

@ -1,7 +1,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:panicked //@ error-pattern:panicked
//@ error-pattern:test-assert-owned //@ error-pattern:test-assert-owned
//@ ignore-emscripten no processes //@ needs-subprocess
#![allow(non_fmt_panics)] #![allow(non_fmt_panics)]

View file

@ -1,7 +1,7 @@
//@ run-fail //@ run-fail
//@ error-pattern:panicked //@ error-pattern:panicked
//@ error-pattern:test-assert-static //@ error-pattern:test-assert-static
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert!(false, "test-assert-static"); assert!(false, "test-assert-static");

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left matches right` failed: 1 + 1 definitely should be 3 //@ error-pattern:assertion `left matches right` failed: 1 + 1 definitely should be 3
//@ error-pattern: left: 2 //@ error-pattern: left: 2
//@ error-pattern: right: 3 //@ error-pattern: right: 3
//@ ignore-emscripten no processes //@ needs-subprocess
#![feature(assert_matches)] #![feature(assert_matches)]

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left != right` failed: 1 + 1 definitely should not be 2 //@ error-pattern:assertion `left != right` failed: 1 + 1 definitely should not be 2
//@ error-pattern: left: 2 //@ error-pattern: left: 2
//@ error-pattern: right: 2 //@ error-pattern: right: 2
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert_ne!(1 + 1, 2, "1 + 1 definitely should not be 2"); assert_ne!(1 + 1, 2, "1 + 1 definitely should not be 2");

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left != right` failed //@ error-pattern:assertion `left != right` failed
//@ error-pattern: left: 14 //@ error-pattern: left: 14
//@ error-pattern: right: 14 //@ error-pattern: right: 14
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
assert_ne!(14, 14); assert_ne!(14, 14);

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:test //@ error-pattern:test
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
panic!("test"); panic!("test");

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:test //@ error-pattern:test
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let __isize: isize = panic!("test"); let __isize: isize = panic!("test");

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:test //@ error-pattern:test
//@ ignore-emscripten no processes //@ needs-subprocess
fn f() { fn f() {
panic!("test"); panic!("test");

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:not implemented //@ error-pattern:not implemented
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
unimplemented!() unimplemented!()

View file

@ -1,4 +1,4 @@
//@ ignore-emscripten no processes //@ needs-subprocess
//@ revisions: edition_2015 edition_2021 //@ revisions: edition_2015 edition_2021
//@ [edition_2015]edition:2015 //@ [edition_2015]edition:2015

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:internal error: entered unreachable code: 6 is not prime //@ error-pattern:internal error: entered unreachable code: 6 is not prime
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
unreachable!("{} is not {}", 6u32, "prime"); unreachable!("{} is not {}", 6u32, "prime");

View file

@ -1,5 +1,5 @@
//@ run-fail //@ run-fail
//@ ignore-emscripten no processes //@ needs-subprocess
//@ revisions: edition_2015 edition_2021 //@ revisions: edition_2015 edition_2021
//@ [edition_2015]edition:2015 //@ [edition_2015]edition:2015

View file

@ -1,4 +1,4 @@
//@ ignore-emscripten no processes //@ needs-subprocess
//@ revisions: edition_2015 edition_2021 //@ revisions: edition_2015 edition_2021
//@ [edition_2015]edition:2015 //@ [edition_2015]edition:2015

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:internal error: entered unreachable code //@ error-pattern:internal error: entered unreachable code
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
unreachable!() unreachable!()

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:internal error: entered unreachable code: uhoh //@ error-pattern:internal error: entered unreachable code: uhoh
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
unreachable!("uhoh") unreachable!("uhoh")

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:internal error: entered unreachable code //@ error-pattern:internal error: entered unreachable code
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
unreachable!() unreachable!()

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
fn f() -> ! { fn f() -> ! {
panic!() panic!()

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
fn main() { fn main() {
let _x = match true { let _x = match true {

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:explicit panic //@ error-pattern:explicit panic
//@ ignore-emscripten no processes //@ needs-subprocess
#![allow(unreachable_code)] #![allow(unreachable_code)]
#![allow(unused_variables)] #![allow(unused_variables)]

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:quux //@ error-pattern:quux
//@ ignore-emscripten no processes //@ needs-subprocess
fn f() -> ! { fn f() -> ! {
panic!("quux") panic!("quux")

View file

@ -1,6 +1,6 @@
//@ run-fail //@ run-fail
//@ error-pattern:squirrelcupcake //@ error-pattern:squirrelcupcake
//@ ignore-emscripten no processes //@ needs-subprocess
fn cmp() -> isize { fn cmp() -> isize {
match (Some('a'), None::<char>) { match (Some('a'), None::<char>) {

View file

@ -5,7 +5,7 @@
//@ revisions: foo bar //@ revisions: foo bar
//@[foo] error-pattern:foo //@[foo] error-pattern:foo
//@[bar] error-pattern:bar //@[bar] error-pattern:bar
//@ ignore-emscripten no processes //@ needs-subprocess
#[cfg(foo)] #[cfg(foo)]
fn die() { fn die() {

View file

@ -2,7 +2,7 @@
//@ error-pattern:converging_fn called //@ error-pattern:converging_fn called
//@ error-pattern:0 dropped //@ error-pattern:0 dropped
//@ error-pattern:exit //@ error-pattern:exit
//@ ignore-emscripten no processes //@ needs-subprocess
struct Droppable(u8); struct Droppable(u8);
impl Drop for Droppable { impl Drop for Droppable {

View file

@ -2,7 +2,7 @@
//@ error-pattern:complex called //@ error-pattern:complex called
//@ error-pattern:dropped //@ error-pattern:dropped
//@ error-pattern:exit //@ error-pattern:exit
//@ ignore-emscripten no processes //@ needs-subprocess
struct Droppable; struct Droppable;
impl Drop for Droppable { impl Drop for Droppable {

Some files were not shown because too many files have changed in this diff Show more