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 |
|-----------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------|-----------------------------------------------------------------------------------------|
| `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 |
| `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 |
@ -176,6 +176,7 @@ settings:
- `needs-rust-lld` — ignores if the rust lld support is not enabled (`rust.lld =
true` in `config.toml`)
- `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
the case on Windows if the developer did not enable privileged symlink
permissions.

View file

@ -488,6 +488,17 @@ impl Config {
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`.

View file

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

View file

@ -94,6 +94,11 @@ pub(super) fn handle_needs(
condition: config.has_threads(),
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 {
name: "needs-unwind",
condition: config.can_unwind(),
@ -351,6 +356,9 @@ fn find_dlltool(config: &Config) -> bool {
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)]
fn has_symlinks() -> bool {
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-38987.rs
ui/issues/issue-39089.rs
ui/issues/issue-39175.rs
ui/issues/issue-39211.rs
ui/issues/issue-39367.rs
ui/issues/issue-39548.rs

View file

@ -17,7 +17,7 @@ use ignore::Walk;
const ENTRY_LIMIT: u32 = 901;
// 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] = &[
"rs", // test source files

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,8 +1,8 @@
//@ run-pass
//@ 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
// the contents implement Drop and we hit a panic in the middle of

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
//@ run-pass
//@ needs-unwind
//@ ignore-emscripten no threads support
//@ needs-threads
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
// scenario worth testing.
//@ ignore-emscripten no threads support
//@ needs-threads
use std::thread;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,5 @@
//@ run-pass
//@ ignore-wasm32 no processes
//@ ignore-sgx no processes
//@ needs-subprocess
// 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

View file

@ -1,6 +1,6 @@
//@ run-fail
//@ 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 {
[42;5][x]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,20 +1,16 @@
//@ run-pass
#![allow(unused_must_use)]
#![allow(non_upper_case_globals)]
//@ ignore-emscripten no threads
//@ check-pass
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>) {
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> {
Box::new(move|| {
if x < generations {
Box::new(move || {
if x < GENERATIONS {
spawn(child_no(x+1));
}
})

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
//@ error-pattern:assertion `left == right` failed: 1 + 1 definitely should be 3
//@ error-pattern: left: 2
//@ error-pattern: right: 3
//@ ignore-emscripten no processes
//@ needs-subprocess
fn main() {
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: left: 14
//@ error-pattern: right: 15
//@ ignore-emscripten no processes
//@ needs-subprocess
fn main() {
assert_eq!(14, 15);

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
//@ run-fail
//@ error-pattern:panicked
//@ error-pattern:test-assert-static
//@ ignore-emscripten no processes
//@ needs-subprocess
fn main() {
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: left: 2
//@ error-pattern: right: 3
//@ ignore-emscripten no processes
//@ needs-subprocess
#![feature(assert_matches)]

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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