From e5b3cb52d032a1bdb0bcf056fcb2d1179c90e8ea Mon Sep 17 00:00:00 2001 From: Hadrien Eyraud Date: Thu, 9 Jan 2025 18:39:40 +0100 Subject: [PATCH 01/41] Check empty SIMD vector in inline asm --- .../rustc_hir_analysis/src/check/intrinsicck.rs | 8 ++++++++ tests/crashes/134334.rs | 9 --------- tests/ui/simd/empty-simd-vector-in-operand.rs | 14 ++++++++++++++ tests/ui/simd/empty-simd-vector-in-operand.stderr | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 9 deletions(-) delete mode 100644 tests/crashes/134334.rs create mode 100644 tests/ui/simd/empty-simd-vector-in-operand.rs create mode 100644 tests/ui/simd/empty-simd-vector-in-operand.stderr diff --git a/compiler/rustc_hir_analysis/src/check/intrinsicck.rs b/compiler/rustc_hir_analysis/src/check/intrinsicck.rs index 90e93bdbb5075..4324e26d9742d 100644 --- a/compiler/rustc_hir_analysis/src/check/intrinsicck.rs +++ b/compiler/rustc_hir_analysis/src/check/intrinsicck.rs @@ -26,6 +26,7 @@ enum NonAsmTypeReason<'tcx> { UnevaluatedSIMDArrayLength(DefId, ty::Const<'tcx>), Invalid(Ty<'tcx>), InvalidElement(DefId, Ty<'tcx>), + EmptySIMDArray(Ty<'tcx>), } impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { @@ -86,6 +87,9 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { ty::RawPtr(ty, _) if self.is_thin_ptr_ty(ty) => Ok(asm_ty_isize), ty::Adt(adt, args) if adt.repr().simd() => { let fields = &adt.non_enum_variant().fields; + if fields.is_empty() { + return Err(NonAsmTypeReason::EmptySIMDArray(ty)); + } let field = &fields[FieldIdx::ZERO]; let elem_ty = field.ty(self.tcx, args); @@ -201,6 +205,10 @@ impl<'a, 'tcx> InlineAsmCtxt<'a, 'tcx> { can be used as arguments for inline assembly", ).emit(); } + NonAsmTypeReason::EmptySIMDArray(ty) => { + let msg = format!("use of empty SIMD vector `{ty}`"); + self.tcx.dcx().struct_span_err(expr.span, msg).emit(); + } } return None; } diff --git a/tests/crashes/134334.rs b/tests/crashes/134334.rs deleted file mode 100644 index d99df7bdc1eda..0000000000000 --- a/tests/crashes/134334.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ known-bug: #134334 -//@ only-x86_64 - -#[repr(simd)] -struct A(); - -fn main() { - std::arch::asm!("{}", in(xmm_reg) A()); -} diff --git a/tests/ui/simd/empty-simd-vector-in-operand.rs b/tests/ui/simd/empty-simd-vector-in-operand.rs new file mode 100644 index 0000000000000..ae21461eb95b9 --- /dev/null +++ b/tests/ui/simd/empty-simd-vector-in-operand.rs @@ -0,0 +1,14 @@ +// Regression test for issue #134224. + +#![feature(repr_simd)] + +#[repr(simd)] +struct A(); +//~^ ERROR SIMD vector cannot be empty + +fn main() { + unsafe { + std::arch::asm!("{}", in(xmm_reg) A()); + //~^ use of empty SIMD vector `A` + } +} diff --git a/tests/ui/simd/empty-simd-vector-in-operand.stderr b/tests/ui/simd/empty-simd-vector-in-operand.stderr new file mode 100644 index 0000000000000..a0faf5f06d209 --- /dev/null +++ b/tests/ui/simd/empty-simd-vector-in-operand.stderr @@ -0,0 +1,15 @@ +error[E0075]: SIMD vector cannot be empty + --> $DIR/empty-simd-vector-in-operand.rs:6:1 + | +LL | struct A(); + | ^^^^^^^^ + +error: use of empty SIMD vector `A` + --> $DIR/empty-simd-vector-in-operand.rs:11:43 + | +LL | std::arch::asm!("{}", in(xmm_reg) A()); + | ^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0075`. From 339616b97afbd3b84c9fd5054f5cb8f7bbcfd249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:38:43 +0800 Subject: [PATCH 02/41] compiletest: implement `needs-subprocess` directive --- src/tools/compiletest/src/common.rs | 11 +++++++++++ src/tools/compiletest/src/directive-list.rs | 1 + src/tools/compiletest/src/header/needs.rs | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index c6f3d7c0d1080..00821fc9f9db2 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -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`. diff --git a/src/tools/compiletest/src/directive-list.rs b/src/tools/compiletest/src/directive-list.rs index 5784cd831196e..acdb3cbdd4590 100644 --- a/src/tools/compiletest/src/directive-list.rs +++ b/src/tools/compiletest/src/directive-list.rs @@ -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", diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index e19dcd992fc2e..12f0790fb1040 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -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() { From 669f4bce4d747aafb55ebffa11216b6e8996f894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:39:04 +0800 Subject: [PATCH 03/41] rustc-dev-guide: document `needs-subprocess` directive --- src/doc/rustc-dev-guide/src/tests/directives.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doc/rustc-dev-guide/src/tests/directives.md b/src/doc/rustc-dev-guide/src/tests/directives.md index 426a6ff1da527..7366e55d3146d 100644 --- a/src/doc/rustc-dev-guide/src/tests/directives.md +++ b/src/doc/rustc-dev-guide/src/tests/directives.md @@ -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 `"" -> ""` before comparing against snapshot | `ui`, `incremental` | `"" -> ""`, ``/`` 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. From eee72ba2f1a87f88be7a9da127705c1ad0aea6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:25:18 +0800 Subject: [PATCH 04/41] tests: adjust `tests/ui/issues/issue-39175.rs` - Change test to check only. - Don't ignore `wasm` or `sgx`. - Gate test to be Unix only because Unix `CommandExt` influences the suggestion. - Run rustfix on the suggestion. --- tests/ui/issues/issue-39175.fixed | 16 ++++++++++++++++ tests/ui/issues/issue-39175.rs | 7 +++---- tests/ui/issues/issue-39175.stderr | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 tests/ui/issues/issue-39175.fixed diff --git a/tests/ui/issues/issue-39175.fixed b/tests/ui/issues/issue-39175.fixed new file mode 100644 index 0000000000000..1f2b5b8b0ce66 --- /dev/null +++ b/tests/ui/issues/issue-39175.fixed @@ -0,0 +1,16 @@ +// This test ignores some platforms as the particular extension trait used +// to demonstrate the issue is only available on unix. This is fine as +// the fix to suggested paths is not platform-dependent and will apply on +// these platforms also. + +//@ run-rustfix +//@ only-unix (the diagnostics is influenced by `use std::os::unix::process::CommandExt;`) + +use std::os::unix::process::CommandExt; +use std::process::Command; +// use std::os::unix::process::CommandExt; + +fn main() { + let _ = Command::new("echo").arg("hello").exec(); +//~^ ERROR no method named `exec` +} diff --git a/tests/ui/issues/issue-39175.rs b/tests/ui/issues/issue-39175.rs index 7b801317b714b..a7e6134b2d9c0 100644 --- a/tests/ui/issues/issue-39175.rs +++ b/tests/ui/issues/issue-39175.rs @@ -3,14 +3,13 @@ // the fix to suggested paths is not platform-dependent and will apply on // these platforms also. -//@ ignore-windows -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ run-rustfix +//@ only-unix (the diagnostics is influenced by `use std::os::unix::process::CommandExt;`) use std::process::Command; // use std::os::unix::process::CommandExt; fn main() { - Command::new("echo").arg("hello").exec(); + let _ = Command::new("echo").arg("hello").exec(); //~^ ERROR no method named `exec` } diff --git a/tests/ui/issues/issue-39175.stderr b/tests/ui/issues/issue-39175.stderr index bbe8badb65231..163b4989aae05 100644 --- a/tests/ui/issues/issue-39175.stderr +++ b/tests/ui/issues/issue-39175.stderr @@ -1,8 +1,8 @@ error[E0599]: no method named `exec` found for mutable reference `&mut Command` in the current scope - --> $DIR/issue-39175.rs:14:39 + --> $DIR/issue-39175.rs:13:47 | -LL | Command::new("echo").arg("hello").exec(); - | ^^^^ +LL | let _ = Command::new("echo").arg("hello").exec(); + | ^^^^ | = help: items from traits can only be used if the trait is in scope help: there is a method `pre_exec` with a similar name, but with different arguments From c7f9c30e33f26d277b4b6fe5dcd4bfc8765f621d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 20:38:55 +0800 Subject: [PATCH 05/41] tests: move `tests/ui/issues/issue-39175.rs` under `suggestions/` and rename --- src/tools/tidy/src/issues.txt | 1 - src/tools/tidy/src/ui_tests.rs | 2 +- .../import-visible-path-39175.fixed} | 0 .../issue-39175.rs => suggestions/import-visible-path-39175.rs} | 0 .../import-visible-path-39175.stderr} | 2 +- 5 files changed, 2 insertions(+), 3 deletions(-) rename tests/ui/{issues/issue-39175.fixed => suggestions/import-visible-path-39175.fixed} (100%) rename tests/ui/{issues/issue-39175.rs => suggestions/import-visible-path-39175.rs} (100%) rename tests/ui/{issues/issue-39175.stderr => suggestions/import-visible-path-39175.stderr} (93%) diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index de3380502bfcd..1c5452b38d17d 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -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 diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 63ac447a772ea..5ef07911429b0 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -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 diff --git a/tests/ui/issues/issue-39175.fixed b/tests/ui/suggestions/import-visible-path-39175.fixed similarity index 100% rename from tests/ui/issues/issue-39175.fixed rename to tests/ui/suggestions/import-visible-path-39175.fixed diff --git a/tests/ui/issues/issue-39175.rs b/tests/ui/suggestions/import-visible-path-39175.rs similarity index 100% rename from tests/ui/issues/issue-39175.rs rename to tests/ui/suggestions/import-visible-path-39175.rs diff --git a/tests/ui/issues/issue-39175.stderr b/tests/ui/suggestions/import-visible-path-39175.stderr similarity index 93% rename from tests/ui/issues/issue-39175.stderr rename to tests/ui/suggestions/import-visible-path-39175.stderr index 163b4989aae05..0b558ca4b52b1 100644 --- a/tests/ui/issues/issue-39175.stderr +++ b/tests/ui/suggestions/import-visible-path-39175.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `exec` found for mutable reference `&mut Command` in the current scope - --> $DIR/issue-39175.rs:13:47 + --> $DIR/import-visible-path-39175.rs:13:47 | LL | let _ = Command::new("echo").arg("hello").exec(); | ^^^^ From 5f63f2dac99a7d48d66e4385a66ef2b00a3d85a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:39:44 +0800 Subject: [PATCH 06/41] tests: slightly cleanup `tests/ui/command/command-pre-exec.rs` - Remove already stabilized feature gate and `#![allow(stable_features)]`. - Convert `ignore-windows` to `only-unix`. - Convert `ignore-*` to `needs-subprocess`. --- tests/ui/command/command-pre-exec.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/ui/command/command-pre-exec.rs b/tests/ui/command/command-pre-exec.rs index 7242dea27759a..7299f357bd078 100644 --- a/tests/ui/command/command-pre-exec.rs +++ b/tests/ui/command/command-pre-exec.rs @@ -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; From f9addadd716d946ad40fb728a5bb74ab0c1d4da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:41:35 +0800 Subject: [PATCH 07/41] tests: cleanup `tests/ui/command/command-argv0.rs` - Convert `ignore-windows` to `only-unix`. - Convert `ignore-*` to `needs-subprocess`. --- tests/ui/command/command-argv0.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/command/command-argv0.rs b/tests/ui/command/command-argv0.rs index 35625c0b334cb..0907e18b30c7c 100644 --- a/tests/ui/command/command-argv0.rs +++ b/tests/ui/command/command-argv0.rs @@ -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; From bfc553eb5301ebdc1364cb8f0acbba3d9f9f9da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:43:01 +0800 Subject: [PATCH 08/41] tests: cleanup `tests/ui/command/command-exec.rs` - Remove already stable feature gate and `#![allow(stable_features)]`. - Replace `ignore-windows` with `only-unix`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/command/command-exec.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/ui/command/command-exec.rs b/tests/ui/command/command-exec.rs index d2545b0b472cf..77336377e8899 100644 --- a/tests/ui/command/command-exec.rs +++ b/tests/ui/command/command-exec.rs @@ -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; From 2632fdc2982e7cb21cc2458d13c8732f0864d53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 15:57:55 +0800 Subject: [PATCH 09/41] tests: cleanup `tests/ui/process/core-run-destroy.rs` - Remove redundant `#![allow(stable_features)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/core-run-destroy.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/process/core-run-destroy.rs b/tests/ui/process/core-run-destroy.rs index 3f2ea0e844116..b4815c9dfbb52 100644 --- a/tests/ui/process/core-run-destroy.rs +++ b/tests/ui/process/core-run-destroy.rs @@ -1,12 +1,11 @@ //@ run-pass #![allow(unused_must_use)] -#![allow(stable_features)] #![allow(deprecated)] #![allow(unused_imports)] + //@ compile-flags:--test -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-vxworks no 'cat' and 'sleep' //@ ignore-fuchsia no 'cat' From 83226094e72f7ad9f0521913e711da439c323fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:01:13 +0800 Subject: [PATCH 10/41] tests: cleanup `tests/ui/process/signal-exit-status.rs` - Replace `ignore-windows` -> `only-unix` since the test exercises Unix signals and `ExitStatus::code` behavior that's specific to Unix. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/signal-exit-status.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/process/signal-exit-status.rs b/tests/ui/process/signal-exit-status.rs index a6acea476367a..33aa83abfc377 100644 --- a/tests/ui/process/signal-exit-status.rs +++ b/tests/ui/process/signal-exit-status.rs @@ -1,7 +1,6 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes -//@ ignore-windows +//@ needs-subprocess +//@ only-unix (`code()` returns `None` if terminated by a signal on Unix) //@ ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590) #![feature(core_intrinsics)] From 02c003b50e18831636f851a4602f686db20fbd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:02:41 +0800 Subject: [PATCH 11/41] tests: cleanup `tests/ui/process/issue-20091.rs` - Remove already stable feature gate and remove `#![allow(stable_features)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/issue-20091.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/ui/process/issue-20091.rs b/tests/ui/process/issue-20091.rs index b6d94661b75c2..72bf4c0e71eee 100644 --- a/tests/ui/process/issue-20091.rs +++ b/tests/ui/process/issue-20091.rs @@ -1,9 +1,5 @@ //@ run-pass -#![allow(stable_features)] -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes - -#![feature(os)] +//@ needs-subprocess #[cfg(unix)] fn main() { From 635a06b5955587002639e8eaf7d0941d4265b70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:06:02 +0800 Subject: [PATCH 12/41] tests: cleanup `tests/ui/process/process-exit.rs` - Remove unnecessary `#![allow(unused_imports)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/process-exit.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/process/process-exit.rs b/tests/ui/process/process-exit.rs index a75a7306cbcd0..a1ed243b62b69 100644 --- a/tests/ui/process/process-exit.rs +++ b/tests/ui/process/process-exit.rs @@ -1,10 +1,8 @@ //@ run-pass -#![allow(unused_imports)] -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; -use std::process::{self, Command, Stdio}; +use std::process::{self, Command}; fn main() { let args: Vec = env::args().collect(); From a4a3acace68f7132d43b5ba6d42b29f91b80b916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:08:31 +0800 Subject: [PATCH 13/41] tests: cleanup `tests/ui/process/fds-are-cloexec.rs` - Replace `ignore-windows` with `only-unix`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/fds-are-cloexec.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/process/fds-are-cloexec.rs b/tests/ui/process/fds-are-cloexec.rs index e7b000b2c499f..f6678379dd675 100644 --- a/tests/ui/process/fds-are-cloexec.rs +++ b/tests/ui/process/fds-are-cloexec.rs @@ -1,9 +1,8 @@ //@ run-pass -//@ ignore-windows +//@ only-unix //@ ignore-android -//@ ignore-wasm32 no processes +//@ needs-subprocess //@ ignore-haiku -//@ ignore-sgx no processes #![feature(rustc_private)] From b617aae20e1d8e5abb7f1286cbde49b0172c63dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:10:15 +0800 Subject: [PATCH 14/41] tests: cleanup `tests/ui/process/process-panic-after-fork.rs` - Replace `ignore-windows` with `only-unix`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/process-panic-after-fork.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/process/process-panic-after-fork.rs b/tests/ui/process/process-panic-after-fork.rs index afb1b721182e5..6e0267e0a54f5 100644 --- a/tests/ui/process/process-panic-after-fork.rs +++ b/tests/ui/process/process-panic-after-fork.rs @@ -1,8 +1,7 @@ //@ run-pass //@ no-prefer-dynamic -//@ ignore-windows -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ only-unix +//@ needs-subprocess //@ ignore-fuchsia no fork #![feature(rustc_private)] From c7c1e4d6559a16b7db05a34249a9785d215a6d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:11:55 +0800 Subject: [PATCH 15/41] tests: cleanup `tests/ui/process/issue-14456.rs` - Remove unnecessary `mut` and remove `#![allow(unused_mut)]`. - Replace `ignore-*` with `needs-process`. --- tests/ui/process/issue-14456.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/process/issue-14456.rs b/tests/ui/process/issue-14456.rs index fd6da8a5fc471..e67a9d8bad559 100644 --- a/tests/ui/process/issue-14456.rs +++ b/tests/ui/process/issue-14456.rs @@ -1,7 +1,5 @@ //@ run-pass -#![allow(unused_mut)] -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::io::prelude::*; @@ -20,7 +18,7 @@ fn main() { fn child() { writeln!(&mut io::stdout(), "foo").unwrap(); writeln!(&mut io::stderr(), "bar").unwrap(); - let mut stdin = io::stdin(); + let stdin = io::stdin(); let mut s = String::new(); stdin.lock().read_line(&mut s).unwrap(); assert_eq!(s.len(), 0); From 7eaa6ec8f72d1fb1b34f4a65b21da434887694c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:13:09 +0800 Subject: [PATCH 16/41] tests: cleanup `tests/ui/process/try-wait.rs` - Remove already stable feature gate and remove `#![allow(stable_features)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/try-wait.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/ui/process/try-wait.rs b/tests/ui/process/try-wait.rs index b6d026d802ff6..dcef43ad348ab 100644 --- a/tests/ui/process/try-wait.rs +++ b/tests/ui/process/try-wait.rs @@ -1,9 +1,5 @@ //@ run-pass - -#![allow(stable_features)] -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes -#![feature(process_try_wait)] +//@ needs-subprocess use std::env; use std::process::Command; From 0cc392e5fab3d046b2973f71998609181753e299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:16:03 +0800 Subject: [PATCH 17/41] tests: cleanup `tests/ui/process/sigpipe-should-be-ignored.rs` - Unwrap a must-use I/O result and remove `#![allow(unused_must_use)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/sigpipe-should-be-ignored.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/ui/process/sigpipe-should-be-ignored.rs b/tests/ui/process/sigpipe-should-be-ignored.rs index 44785bee7f80c..3dcf0117ae971 100644 --- a/tests/ui/process/sigpipe-should-be-ignored.rs +++ b/tests/ui/process/sigpipe-should-be-ignored.rs @@ -1,12 +1,9 @@ //@ run-pass +//@ needs-subprocess -#![allow(unused_must_use)] // Be sure that when a SIGPIPE would have been received that the entire process // doesn't die in a ball of fire, but rather it's gracefully handled. -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes - use std::env; use std::io::prelude::*; use std::io; @@ -14,7 +11,7 @@ use std::process::{Command, Stdio}; fn test() { let _ = io::stdin().read_line(&mut String::new()); - io::stdout().write(&[1]); + io::stdout().write(&[1]).unwrap(); assert!(io::stdout().flush().is_err()); } From a5d72f45ba19f22b8dba64623b712042e2ccd034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:19:42 +0800 Subject: [PATCH 18/41] tests: cleanup `tests/ui/panic-runtime/lto-unwind.rs` - Ignore an unused variable and remove `#![allow(unused_variables)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/panic-runtime/lto-unwind.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/ui/panic-runtime/lto-unwind.rs b/tests/ui/panic-runtime/lto-unwind.rs index 5eab2bd56ed1f..93275052f8527 100644 --- a/tests/ui/panic-runtime/lto-unwind.rs +++ b/tests/ui/panic-runtime/lto-unwind.rs @@ -1,11 +1,8 @@ //@ run-pass -#![allow(unused_variables)] - //@ compile-flags:-C lto -C panic=unwind //@ needs-unwind //@ no-prefer-dynamic -//@ ignore-emscripten no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::process::Command; use std::env; @@ -20,7 +17,7 @@ impl Drop for Bomb { fn main() { let mut args = env::args_os(); - let me = args.next().unwrap(); + let _ = args.next().unwrap(); if let Some(s) = args.next() { if &*s == "foo" { From bb36a40557abe9dc513586c089d31242d453a81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:21:27 +0800 Subject: [PATCH 19/41] tests: cleanup `tests/ui/panic-runtime/abort.rs` - Ignore unused value, remove `#![allow(unused_variable)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/panic-runtime/abort.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/panic-runtime/abort.rs b/tests/ui/panic-runtime/abort.rs index caf0243ebdb26..8cdfd018a9282 100644 --- a/tests/ui/panic-runtime/abort.rs +++ b/tests/ui/panic-runtime/abort.rs @@ -1,9 +1,7 @@ //@ run-pass -#![allow(unused_variables)] //@ compile-flags:-C panic=abort //@ no-prefer-dynamic -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::process::Command; @@ -18,7 +16,7 @@ impl Drop for Bomb { fn main() { let mut args = env::args_os(); - let me = args.next().unwrap(); + let _ = args.next().unwrap(); if let Some(s) = args.next() { if &*s == "foo" { From 1abb93608f2275cecf9bd7a8c83f46cc74f11e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:22:54 +0800 Subject: [PATCH 20/41] tests: cleanup `tests/ui/process/issue-13304.rs` - Remove unnecessary `mut`, remove `#[allow(unused_mut)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/process/issue-13304.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/process/issue-13304.rs b/tests/ui/process/issue-13304.rs index 6dbf0caaaecee..621c54300d378 100644 --- a/tests/ui/process/issue-13304.rs +++ b/tests/ui/process/issue-13304.rs @@ -1,7 +1,5 @@ //@ run-pass -#![allow(unused_mut)] -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::io::prelude::*; @@ -32,7 +30,7 @@ fn parent() { } fn child() { - let mut stdin = io::stdin(); + let stdin = io::stdin(); for line in stdin.lock().lines() { println!("{}", line.unwrap()); } From 91bd54547582e4a0caf57c03c878f0c50636f9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:26:14 +0800 Subject: [PATCH 21/41] tests: cleanup `tests/ui/panic-runtime/lto-abort.rs` - Ignore unused value, remove `#![allow(unused_variable)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/panic-runtime/lto-abort.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/panic-runtime/lto-abort.rs b/tests/ui/panic-runtime/lto-abort.rs index c66b6a60c7389..cf15ae6435bfd 100644 --- a/tests/ui/panic-runtime/lto-abort.rs +++ b/tests/ui/panic-runtime/lto-abort.rs @@ -1,9 +1,7 @@ //@ run-pass -#![allow(unused_variables)] //@ compile-flags:-C lto -C panic=abort //@ no-prefer-dynamic -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::process::Command; use std::env; @@ -18,7 +16,7 @@ impl Drop for Bomb { fn main() { let mut args = env::args_os(); - let me = args.next().unwrap(); + let _ = args.next().unwrap(); if let Some(s) = args.next() { if &*s == "foo" { From 5c1e2ec2be698f0e2521e82eab617d807445206d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:27:41 +0800 Subject: [PATCH 22/41] tests: cleanup `tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs` - Ignore unused value, remove `#![allow(unused_variable)]`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs index ce6644e675869..0566d2319df1a 100644 --- a/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs +++ b/tests/ui/panic-runtime/abort-link-to-unwinding-crates.rs @@ -1,10 +1,8 @@ //@ run-pass -#![allow(unused_variables)] //@ compile-flags:-C panic=abort //@ aux-build:exit-success-if-unwind.rs //@ no-prefer-dynamic -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess extern crate exit_success_if_unwind; @@ -13,7 +11,7 @@ use std::process::Command; fn main() { let mut args = env::args_os(); - let me = args.next().unwrap(); + let _ = args.next().unwrap(); if let Some(s) = args.next() { if &*s == "foo" { From 4b743a7a63511b3d142d58c9c45e699ff70c5363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:49:47 +0800 Subject: [PATCH 23/41] tests: cleanup `tests/ui/command/command-setgroups.rs` - Use `only-unix` instead of `ignore-windows`. - Replace `ignore-*` with `needs-subprocess`. --- tests/ui/command/command-setgroups.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/ui/command/command-setgroups.rs b/tests/ui/command/command-setgroups.rs index c940135d844ca..047f06729af98 100644 --- a/tests/ui/command/command-setgroups.rs +++ b/tests/ui/command/command-setgroups.rs @@ -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)] From e00e10c943947aa3d6a6bcbdf8ca035e9d8fd865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:56:11 +0800 Subject: [PATCH 24/41] tests: cleanup `tests/ui/std/thread-sleep-ms.rs` - Use `needs-threads` instead of `ignore-sgx`. - Remove unnecessary import and `#![allow(unused_import)]`. --- tests/ui/std/thread-sleep-ms.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/ui/std/thread-sleep-ms.rs b/tests/ui/std/thread-sleep-ms.rs index 0a3d0253a20ef..2d668b8265c27 100644 --- a/tests/ui/std/thread-sleep-ms.rs +++ b/tests/ui/std/thread-sleep-ms.rs @@ -1,12 +1,9 @@ //@ run-pass -//@ ignore-sgx not supported -//@ ignore-emscripten -// FIXME: test hangs on emscripten -#![allow(deprecated)] -#![allow(unused_imports)] +//@ needs-threads +//@ ignore-emscripten (FIXME: test hangs on emscripten) -use std::thread; +#![allow(deprecated)] fn main() { - thread::sleep_ms(250); + std::thread::sleep_ms(250); } From a11227b916219599c761ab008c431075f77b9a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:18:15 +0800 Subject: [PATCH 25/41] tests: update `tests/ui/issues/issue-2190-1.rs` - Convert `run-pass` to `check-pass`, the test is about closure inference based on expected type, does not need to run-pass. - Dropped unnecessary ignores. --- tests/ui/issues/issue-2190-1.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/ui/issues/issue-2190-1.rs b/tests/ui/issues/issue-2190-1.rs index 8db4a84aac860..e4e4bf9dbbee5 100644 --- a/tests/ui/issues/issue-2190-1.rs +++ b/tests/ui/issues/issue-2190-1.rs @@ -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) { - Builder::new().stack_size(32 * 1024).spawn(move|| f()); + Builder::new().stack_size(32 * 1024).spawn(move || f()); } fn child_no(x: usize) -> Box { - Box::new(move|| { - if x < generations { + Box::new(move || { + if x < GENERATIONS { spawn(child_no(x+1)); } }) From 8a0310a0b131cfc24b931cd537b400525727cf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:36:54 +0800 Subject: [PATCH 26/41] tests: use `needs-subprocess` instead of `ignore-{wasm32,emscripten,sgx}` --- tests/ui/abi/homogenous-floats-target-feature-mixup.rs | 3 +-- tests/ui/abi/segfault-no-out-of-stack.rs | 3 +-- tests/ui/abi/stack-probes-lto.rs | 2 +- tests/ui/abi/stack-probes.rs | 3 +-- tests/ui/alloc-error/default-alloc-error-hook.rs | 3 +-- tests/ui/array-slice-vec/bounds-check-no-overflow.rs | 2 +- tests/ui/array-slice-vec/dst-raw-slice.rs | 2 +- tests/ui/array-slice-vec/vec-overrun.rs | 2 +- tests/ui/backtrace/backtrace.rs | 3 +-- tests/ui/backtrace/std-backtrace.rs | 3 +-- tests/ui/binop/binop-fail-3.rs | 2 +- tests/ui/binop/binop-panic.rs | 2 +- tests/ui/borrowck/borrowck-local-borrow.rs | 2 +- tests/ui/borrowck/issue-28934.rs | 2 +- tests/ui/closures/diverging-closure.rs | 2 +- tests/ui/command/command-current-dir.rs | 3 +-- tests/ui/command/command-uid-gid.rs | 3 +-- tests/ui/command/issue-10626.rs | 3 +-- tests/ui/consts/issue-29798.rs | 2 +- tests/ui/coroutine/coroutine-resume-after-panic.rs | 2 +- tests/ui/expr/if/expr-if-panic-fn.rs | 2 +- tests/ui/expr/if/expr-if-panic.rs | 2 +- tests/ui/expr/if/if-check-panic.rs | 2 +- tests/ui/expr/if/if-cond-bot.rs | 2 +- tests/ui/extern/issue-18576.rs | 2 +- tests/ui/fn/expr-fn-panic.rs | 2 +- tests/ui/hashmap/hashmap-capacity-overflow.rs | 2 +- tests/ui/imports/glob-use-std.rs | 2 +- tests/ui/intrinsics/panic-uninitialized-zeroed.rs | 9 ++++----- tests/ui/issues/issue-12920.rs | 2 +- tests/ui/issues/issue-13202.rs | 2 +- tests/ui/issues/issue-20971.rs | 2 +- tests/ui/issues/issue-23354-2.rs | 2 +- tests/ui/issues/issue-23354.rs | 2 +- tests/ui/issues/issue-2470-bounds-check-overflow.rs | 2 +- tests/ui/issues/issue-2761.rs | 2 +- tests/ui/issues/issue-3029.rs | 2 +- tests/ui/issues/issue-30380.rs | 2 +- tests/ui/issues/issue-33770.rs | 3 +-- tests/ui/issues/issue-44216-add-system-time.rs | 2 +- tests/ui/issues/issue-44216-sub-instant.rs | 2 +- tests/ui/issues/issue-44216-sub-system-time.rs | 2 +- tests/ui/lifetimes/tail-expr-lock-poisoning.rs | 3 ++- tests/ui/loops/for-each-loop-panic.rs | 2 +- tests/ui/macros/assert-as-macro.rs | 2 +- tests/ui/macros/assert-eq-macro-msg.rs | 2 +- tests/ui/macros/assert-eq-macro-panic.rs | 2 +- tests/ui/macros/assert-macro-explicit.rs | 2 +- tests/ui/macros/assert-macro-fmt.rs | 2 +- tests/ui/macros/assert-macro-owned.rs | 2 +- tests/ui/macros/assert-macro-static.rs | 2 +- tests/ui/macros/assert-matches-macro-msg.rs | 2 +- tests/ui/macros/assert-ne-macro-msg.rs | 2 +- tests/ui/macros/assert-ne-macro-panic.rs | 2 +- tests/ui/macros/die-macro-2.rs | 2 +- tests/ui/macros/die-macro-expr.rs | 2 +- tests/ui/macros/die-macro-pure.rs | 2 +- tests/ui/macros/unimplemented-macro-panic.rs | 2 +- tests/ui/macros/unreachable-arg.rs | 2 +- tests/ui/macros/unreachable-fmt-msg.rs | 2 +- tests/ui/macros/unreachable-format-arg.rs | 2 +- tests/ui/macros/unreachable-format-args.rs | 2 +- tests/ui/macros/unreachable-macro-panic.rs | 2 +- tests/ui/macros/unreachable-static-msg.rs | 2 +- tests/ui/macros/unreachable.rs | 2 +- tests/ui/match/expr-match-panic-fn.rs | 2 +- tests/ui/match/expr-match-panic.rs | 2 +- tests/ui/match/match-bot-panic.rs | 2 +- tests/ui/match/match-disc-bot.rs | 2 +- tests/ui/match/match-wildcards.rs | 2 +- tests/ui/meta/revision-ok.rs | 2 +- tests/ui/mir/mir_codegen_calls_converging_drops.rs | 2 +- tests/ui/mir/mir_codegen_calls_converging_drops_2.rs | 2 +- tests/ui/mir/mir_codegen_calls_diverging.rs | 2 +- tests/ui/mir/mir_dynamic_drops_1.rs | 2 +- tests/ui/mir/mir_dynamic_drops_2.rs | 2 +- tests/ui/mir/mir_dynamic_drops_3.rs | 2 +- tests/ui/mir/mir_indexing_oob_1.rs | 2 +- tests/ui/mir/mir_indexing_oob_2.rs | 2 +- tests/ui/mir/mir_indexing_oob_3.rs | 2 +- tests/ui/never_type/return-never-coerce.rs | 2 +- tests/ui/nll/issue-51345-2.rs | 2 +- tests/ui/numbers-arithmetic/divide-by-zero.rs | 2 +- tests/ui/numbers-arithmetic/mod-zero.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-add.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-mul.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-pow-signed.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs | 2 +- tests/ui/numbers-arithmetic/overflowing-sub.rs | 2 +- tests/ui/panic-runtime/unwind-interleaved.rs | 2 +- tests/ui/panic-runtime/unwind-rec.rs | 2 +- tests/ui/panic-runtime/unwind-rec2.rs | 2 +- tests/ui/panic-runtime/unwind-unique.rs | 2 +- tests/ui/panics/abort-on-panic.rs | 3 +-- tests/ui/panics/args-panic.rs | 2 +- tests/ui/panics/doublepanic.rs | 2 +- tests/ui/panics/explicit-panic-msg.rs | 2 +- tests/ui/panics/explicit-panic.rs | 2 +- tests/ui/panics/fmt-panic.rs | 2 +- tests/ui/panics/issue-47429-short-backtraces.rs | 6 +++--- tests/ui/panics/main-panic.rs | 2 +- tests/ui/panics/panic-arg.rs | 2 +- tests/ui/panics/panic-macro-any-wrapped.rs | 2 +- tests/ui/panics/panic-macro-any.rs | 2 +- tests/ui/panics/panic-macro-explicit.rs | 2 +- tests/ui/panics/panic-macro-fmt.rs | 2 +- tests/ui/panics/panic-macro-owned.rs | 2 +- tests/ui/panics/panic-macro-static.rs | 2 +- tests/ui/panics/panic-main.rs | 2 +- tests/ui/panics/panic-parens.rs | 2 +- tests/ui/panics/panic-set-handler.rs | 2 +- tests/ui/panics/panic-set-unset-handler.rs | 2 +- tests/ui/panics/panic-take-handler-nop.rs | 2 +- tests/ui/panics/panic.rs | 2 +- tests/ui/panics/result-get-panic.rs | 2 +- tests/ui/panics/runtime-switch.rs | 4 ++-- tests/ui/panics/test-panic.rs | 2 +- tests/ui/panics/test-should-panic-no-message.rs | 2 +- tests/ui/panics/while-body-panics.rs | 2 +- tests/ui/panics/while-panic.rs | 2 +- tests/ui/print-stdout-eprint-stderr.rs | 3 +-- tests/ui/process/env-args-reverse-iterator.rs | 3 +-- tests/ui/process/inherit-env.rs | 3 +-- tests/ui/process/issue-14940.rs | 3 +-- tests/ui/process/issue-16272.rs | 3 +-- tests/ui/process/issue-30490.rs | 3 +-- tests/ui/process/multi-panic.rs | 3 +-- tests/ui/process/no-stdio.rs | 3 +-- tests/ui/process/println-with-broken-pipe.rs | 2 +- tests/ui/process/process-envs.rs | 3 +-- tests/ui/process/process-remove-from-env.rs | 3 +-- tests/ui/process/process-spawn-nonexistent.rs | 3 +-- tests/ui/process/process-spawn-with-unicode-params.rs | 3 +-- tests/ui/process/process-status-inherits-stdin.rs | 3 +-- tests/ui/process/tls-exit-status.rs | 2 +- tests/ui/reachable/issue-948.rs | 2 +- .../termination-trait-for-box-dyn-error-err.rs | 2 +- .../termination-trait-for-never.rs | 2 +- .../termination-trait-for-result-box-error_err.rs | 2 +- .../termination-trait-for-str-err.rs | 2 +- tests/ui/runtime/atomic-print.rs | 4 ++-- tests/ui/runtime/backtrace-debuginfo.rs | 3 +-- tests/ui/runtime/out-of-stack.rs | 3 +-- tests/ui/runtime/rt-explody-panic-payloads.rs | 3 +-- tests/ui/runtime/running-with-no-runtime.rs | 3 +-- tests/ui/simd/target-feature-mixup.rs | 3 +-- tests/ui/stdio-is-blocking.rs | 3 +-- tests/ui/str/str-overrun.rs | 2 +- tests/ui/structs/rhs-type.rs | 2 +- tests/ui/test-attrs/test-panic-abort-disabled.rs | 5 +++-- tests/ui/test-attrs/test-panic-abort-nocapture.rs | 6 +++--- tests/ui/test-attrs/test-panic-abort.rs | 6 +++--- tests/ui/threads-sendsync/eprint-on-tls-drop.rs | 2 +- tests/ui/threads-sendsync/issue-24313.rs | 2 +- tests/ui/wait-forked-but-failed-child.rs | 3 +-- 156 files changed, 170 insertions(+), 200 deletions(-) diff --git a/tests/ui/abi/homogenous-floats-target-feature-mixup.rs b/tests/ui/abi/homogenous-floats-target-feature-mixup.rs index 4afb710b193eb..22b9b029a4049 100644 --- a/tests/ui/abi/homogenous-floats-target-feature-mixup.rs +++ b/tests/ui/abi/homogenous-floats-target-feature-mixup.rs @@ -5,8 +5,7 @@ // without #[repr(simd)] //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess #![feature(avx512_target_feature)] diff --git a/tests/ui/abi/segfault-no-out-of-stack.rs b/tests/ui/abi/segfault-no-out-of-stack.rs index 113c82c30e927..b5af13ebfb5cf 100644 --- a/tests/ui/abi/segfault-no-out-of-stack.rs +++ b/tests/ui/abi/segfault-no-out-of-stack.rs @@ -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)] diff --git a/tests/ui/abi/stack-probes-lto.rs b/tests/ui/abi/stack-probes-lto.rs index e6c26c5c4de85..c6e5bea5f4225 100644 --- a/tests/ui/abi/stack-probes-lto.rs +++ b/tests/ui/abi/stack-probes-lto.rs @@ -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 diff --git a/tests/ui/abi/stack-probes.rs b/tests/ui/abi/stack-probes.rs index 1c0e50250d768..f0fbd80d2e734 100644 --- a/tests/ui/abi/stack-probes.rs +++ b/tests/ui/abi/stack-probes.rs @@ -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 diff --git a/tests/ui/alloc-error/default-alloc-error-hook.rs b/tests/ui/alloc-error/default-alloc-error-hook.rs index 5f977460b8c6e..7fbc66ca5f472 100644 --- a/tests/ui/alloc-error/default-alloc-error-hook.rs +++ b/tests/ui/alloc-error/default-alloc-error-hook.rs @@ -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; diff --git a/tests/ui/array-slice-vec/bounds-check-no-overflow.rs b/tests/ui/array-slice-vec/bounds-check-no-overflow.rs index 4614df44084f2..c5ff805a853e0 100644 --- a/tests/ui/array-slice-vec/bounds-check-no-overflow.rs +++ b/tests/ui/array-slice-vec/bounds-check-no-overflow.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:index out of bounds -//@ ignore-emscripten no processes +//@ needs-subprocess use std::mem::size_of; diff --git a/tests/ui/array-slice-vec/dst-raw-slice.rs b/tests/ui/array-slice-vec/dst-raw-slice.rs index f1281f4e302f2..ab9dedc139d7e 100644 --- a/tests/ui/array-slice-vec/dst-raw-slice.rs +++ b/tests/ui/array-slice-vec/dst-raw-slice.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:index out of bounds -//@ ignore-emscripten no processes +//@ needs-subprocess #[allow(unconditional_panic)] fn main() { diff --git a/tests/ui/array-slice-vec/vec-overrun.rs b/tests/ui/array-slice-vec/vec-overrun.rs index 10f8350869fb8..3b3e9215279f9 100644 --- a/tests/ui/array-slice-vec/vec-overrun.rs +++ b/tests/ui/array-slice-vec/vec-overrun.rs @@ -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 = vec![10]; diff --git a/tests/ui/backtrace/backtrace.rs b/tests/ui/backtrace/backtrace.rs index 2579ff5203b4f..487473f4393b5 100644 --- a/tests/ui/backtrace/backtrace.rs +++ b/tests/ui/backtrace/backtrace.rs @@ -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 diff --git a/tests/ui/backtrace/std-backtrace.rs b/tests/ui/backtrace/std-backtrace.rs index 57d953a86408d..7ccbd46152bbf 100644 --- a/tests/ui/backtrace/std-backtrace.rs +++ b/tests/ui/backtrace/std-backtrace.rs @@ -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 diff --git a/tests/ui/binop/binop-fail-3.rs b/tests/ui/binop/binop-fail-3.rs index b1e70a1c5961c..4e8d7e92ab6b0 100644 --- a/tests/ui/binop/binop-fail-3.rs +++ b/tests/ui/binop/binop-fail-3.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:quux -//@ ignore-emscripten no processes +//@ needs-subprocess fn foo() -> ! { panic!("quux"); diff --git a/tests/ui/binop/binop-panic.rs b/tests/ui/binop/binop-panic.rs index 8dbf62a922e45..8173eb0d6898f 100644 --- a/tests/ui/binop/binop-panic.rs +++ b/tests/ui/binop/binop-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:quux -//@ ignore-emscripten no processes +//@ needs-subprocess fn my_err(s: String) -> ! { println!("{}", s); diff --git a/tests/ui/borrowck/borrowck-local-borrow.rs b/tests/ui/borrowck/borrowck-local-borrow.rs index de6ee5983c864..4d22503e37bae 100644 --- a/tests/ui/borrowck/borrowck-local-borrow.rs +++ b/tests/ui/borrowck/borrowck-local-borrow.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:panic 1 -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let x = 2; diff --git a/tests/ui/borrowck/issue-28934.rs b/tests/ui/borrowck/issue-28934.rs index a3ac663c5b5c6..64559d4cf1ddc 100644 --- a/tests/ui/borrowck/issue-28934.rs +++ b/tests/ui/borrowck/issue-28934.rs @@ -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); diff --git a/tests/ui/closures/diverging-closure.rs b/tests/ui/closures/diverging-closure.rs index dda829d8af42e..2c86f55cf2595 100644 --- a/tests/ui/closures/diverging-closure.rs +++ b/tests/ui/closures/diverging-closure.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:oops -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let func = || -> ! { diff --git a/tests/ui/command/command-current-dir.rs b/tests/ui/command/command-current-dir.rs index 23269e4123182..e264cbe4d7045 100644 --- a/tests/ui/command/command-current-dir.rs +++ b/tests/ui/command/command-current-dir.rs @@ -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; diff --git a/tests/ui/command/command-uid-gid.rs b/tests/ui/command/command-uid-gid.rs index 7a70a0fbd7612..f54a0f50708ba 100644 --- a/tests/ui/command/command-uid-gid.rs +++ b/tests/ui/command/command-uid-gid.rs @@ -1,8 +1,7 @@ //@ run-pass //@ ignore-android -//@ ignore-emscripten -//@ ignore-sgx //@ ignore-fuchsia no '/bin/sh', '/bin/ls' +//@ needs-subprocess #![feature(rustc_private)] diff --git a/tests/ui/command/issue-10626.rs b/tests/ui/command/issue-10626.rs index f8dbb01151377..d2679ec9e29c8 100644 --- a/tests/ui/command/issue-10626.rs +++ b/tests/ui/command/issue-10626.rs @@ -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 diff --git a/tests/ui/consts/issue-29798.rs b/tests/ui/consts/issue-29798.rs index bdabbad6491f6..f7470d7aac908 100644 --- a/tests/ui/consts/issue-29798.rs +++ b/tests/ui/consts/issue-29798.rs @@ -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] diff --git a/tests/ui/coroutine/coroutine-resume-after-panic.rs b/tests/ui/coroutine/coroutine-resume-after-panic.rs index 2745ebc61326f..1aa547c2a7bd2 100644 --- a/tests/ui/coroutine/coroutine-resume-after-panic.rs +++ b/tests/ui/coroutine/coroutine-resume-after-panic.rs @@ -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. diff --git a/tests/ui/expr/if/expr-if-panic-fn.rs b/tests/ui/expr/if/expr-if-panic-fn.rs index 4f3d7fd48e36e..0b4742d4a8999 100644 --- a/tests/ui/expr/if/expr-if-panic-fn.rs +++ b/tests/ui/expr/if/expr-if-panic-fn.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn f() -> ! { panic!() diff --git a/tests/ui/expr/if/expr-if-panic.rs b/tests/ui/expr/if/expr-if-panic.rs index 0b43d1d6b0069..2f35878e844d1 100644 --- a/tests/ui/expr/if/expr-if-panic.rs +++ b/tests/ui/expr/if/expr-if-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let _x = if false { diff --git a/tests/ui/expr/if/if-check-panic.rs b/tests/ui/expr/if/if-check-panic.rs index 4b400deaca46f..eb0413f42fcf1 100644 --- a/tests/ui/expr/if/if-check-panic.rs +++ b/tests/ui/expr/if/if-check-panic.rs @@ -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 { diff --git a/tests/ui/expr/if/if-cond-bot.rs b/tests/ui/expr/if/if-cond-bot.rs index ddb5559ffca7c..56bd5ec35f925 100644 --- a/tests/ui/expr/if/if-cond-bot.rs +++ b/tests/ui/expr/if/if-cond-bot.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:quux -//@ ignore-emscripten no processes +//@ needs-subprocess fn my_err(s: String) -> ! { println!("{}", s); diff --git a/tests/ui/extern/issue-18576.rs b/tests/ui/extern/issue-18576.rs index 0a98e85e4844f..6b41fe7363145 100644 --- a/tests/ui/extern/issue-18576.rs +++ b/tests/ui/extern/issue-18576.rs @@ -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 diff --git a/tests/ui/fn/expr-fn-panic.rs b/tests/ui/fn/expr-fn-panic.rs index 23946b7533d66..d726aac2a4c07 100644 --- a/tests/ui/fn/expr-fn-panic.rs +++ b/tests/ui/fn/expr-fn-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn f() -> ! { panic!() diff --git a/tests/ui/hashmap/hashmap-capacity-overflow.rs b/tests/ui/hashmap/hashmap-capacity-overflow.rs index 91aebc3bbba8b..502dbe9fa932e 100644 --- a/tests/ui/hashmap/hashmap-capacity-overflow.rs +++ b/tests/ui/hashmap/hashmap-capacity-overflow.rs @@ -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; diff --git a/tests/ui/imports/glob-use-std.rs b/tests/ui/imports/glob-use-std.rs index b625543da81f5..d2af816e24f2d 100644 --- a/tests/ui/imports/glob-use-std.rs +++ b/tests/ui/imports/glob-use-std.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:panic works -//@ ignore-emscripten no processes +//@ needs-subprocess use std::*; diff --git a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs index 67b9832d60140..346a94c37dd86 100644 --- a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs +++ b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs @@ -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)] diff --git a/tests/ui/issues/issue-12920.rs b/tests/ui/issues/issue-12920.rs index 7f453e499d48c..f3b1b643c45af 100644 --- a/tests/ui/issues/issue-12920.rs +++ b/tests/ui/issues/issue-12920.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess pub fn main() { panic!(); diff --git a/tests/ui/issues/issue-13202.rs b/tests/ui/issues/issue-13202.rs index 89205fc7fd1a2..99ffba3fba51a 100644 --- a/tests/ui/issues/issue-13202.rs +++ b/tests/ui/issues/issue-13202.rs @@ -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(); diff --git a/tests/ui/issues/issue-20971.rs b/tests/ui/issues/issue-20971.rs index 377a3d9ea304b..31dd910191935 100644 --- a/tests/ui/issues/issue-20971.rs +++ b/tests/ui/issues/issue-20971.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:Hello, world! -//@ ignore-emscripten no processes +//@ needs-subprocess pub trait Parser { type Input; diff --git a/tests/ui/issues/issue-23354-2.rs b/tests/ui/issues/issue-23354-2.rs index 90de1276cc6bc..a296477215ed1 100644 --- a/tests/ui/issues/issue-23354-2.rs +++ b/tests/ui/issues/issue-23354-2.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:panic evaluated -//@ ignore-emscripten no processes +//@ needs-subprocess #[allow(unused_variables)] fn main() { diff --git a/tests/ui/issues/issue-23354.rs b/tests/ui/issues/issue-23354.rs index 31783842dac00..eff5f3d27147a 100644 --- a/tests/ui/issues/issue-23354.rs +++ b/tests/ui/issues/issue-23354.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:panic evaluated -//@ ignore-emscripten no processes +//@ needs-subprocess #[allow(unused_variables)] fn main() { diff --git a/tests/ui/issues/issue-2470-bounds-check-overflow.rs b/tests/ui/issues/issue-2470-bounds-check-overflow.rs index 241bc8fda9c21..4f300454dcb6e 100644 --- a/tests/ui/issues/issue-2470-bounds-check-overflow.rs +++ b/tests/ui/issues/issue-2470-bounds-check-overflow.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:index out of bounds -//@ ignore-emscripten no processes +//@ needs-subprocess use std::mem; diff --git a/tests/ui/issues/issue-2761.rs b/tests/ui/issues/issue-2761.rs index b44a24e09f258..6df7a5118b820 100644 --- a/tests/ui/issues/issue-2761.rs +++ b/tests/ui/issues/issue-2761.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:custom message -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { assert!(false, "custom message"); diff --git a/tests/ui/issues/issue-3029.rs b/tests/ui/issues/issue-3029.rs index a070578969cb2..22d0906ccf701 100644 --- a/tests/ui/issues/issue-3029.rs +++ b/tests/ui/issues/issue-3029.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:so long -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(unreachable_code)] diff --git a/tests/ui/issues/issue-30380.rs b/tests/ui/issues/issue-30380.rs index 534bb3423d0fb..49fce3d150cd7 100644 --- a/tests/ui/issues/issue-30380.rs +++ b/tests/ui/issues/issue-30380.rs @@ -3,7 +3,7 @@ //@ run-fail //@ error-pattern:panicking destructors ftw! -//@ ignore-emscripten no processes +//@ needs-subprocess struct Observer<'a>(&'a mut FilledOnDrop); diff --git a/tests/ui/issues/issue-33770.rs b/tests/ui/issues/issue-33770.rs index 0fa91ac91c4d3..814e8f371765e 100644 --- a/tests/ui/issues/issue-33770.rs +++ b/tests/ui/issues/issue-33770.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::process::{Command, Stdio}; use std::env; diff --git a/tests/ui/issues/issue-44216-add-system-time.rs b/tests/ui/issues/issue-44216-add-system-time.rs index 207f72fade813..3838d28e33d1b 100644 --- a/tests/ui/issues/issue-44216-add-system-time.rs +++ b/tests/ui/issues/issue-44216-add-system-time.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:overflow -//@ ignore-emscripten no processes +//@ needs-subprocess use std::time::{Duration, SystemTime}; diff --git a/tests/ui/issues/issue-44216-sub-instant.rs b/tests/ui/issues/issue-44216-sub-instant.rs index 2457d2aaa0446..19cd12e685fd1 100644 --- a/tests/ui/issues/issue-44216-sub-instant.rs +++ b/tests/ui/issues/issue-44216-sub-instant.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:overflow -//@ ignore-emscripten no processes +//@ needs-subprocess use std::time::{Instant, Duration}; diff --git a/tests/ui/issues/issue-44216-sub-system-time.rs b/tests/ui/issues/issue-44216-sub-system-time.rs index 7e33f22793374..bd4f66f3e161b 100644 --- a/tests/ui/issues/issue-44216-sub-system-time.rs +++ b/tests/ui/issues/issue-44216-sub-system-time.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:overflow -//@ ignore-emscripten no processes +//@ needs-subprocess use std::time::{Duration, SystemTime}; diff --git a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs index 6af6655149bd9..d7c7b2e24143a 100644 --- a/tests/ui/lifetimes/tail-expr-lock-poisoning.rs +++ b/tests/ui/lifetimes/tail-expr-lock-poisoning.rs @@ -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 diff --git a/tests/ui/loops/for-each-loop-panic.rs b/tests/ui/loops/for-each-loop-panic.rs index 04784cac8f2fc..79cfca93e0e20 100644 --- a/tests/ui/loops/for-each-loop-panic.rs +++ b/tests/ui/loops/for-each-loop-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:moop -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { for _ in 0_usize..10_usize { diff --git a/tests/ui/macros/assert-as-macro.rs b/tests/ui/macros/assert-as-macro.rs index 391b056292f84..c18a3d89fb635 100644 --- a/tests/ui/macros/assert-as-macro.rs +++ b/tests/ui/macros/assert-as-macro.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:assertion failed: 1 == 2 -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { assert!(1 == 2); diff --git a/tests/ui/macros/assert-eq-macro-msg.rs b/tests/ui/macros/assert-eq-macro-msg.rs index 39eeefeeef90e..9ef7552cc7b2d 100644 --- a/tests/ui/macros/assert-eq-macro-msg.rs +++ b/tests/ui/macros/assert-eq-macro-msg.rs @@ -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"); diff --git a/tests/ui/macros/assert-eq-macro-panic.rs b/tests/ui/macros/assert-eq-macro-panic.rs index 22c3a8a634f4b..3c46e2798d11d 100644 --- a/tests/ui/macros/assert-eq-macro-panic.rs +++ b/tests/ui/macros/assert-eq-macro-panic.rs @@ -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); diff --git a/tests/ui/macros/assert-macro-explicit.rs b/tests/ui/macros/assert-macro-explicit.rs index 167581d2525e1..b14a182a876ce 100644 --- a/tests/ui/macros/assert-macro-explicit.rs +++ b/tests/ui/macros/assert-macro-explicit.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:assertion failed: false -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { assert!(false); diff --git a/tests/ui/macros/assert-macro-fmt.rs b/tests/ui/macros/assert-macro-fmt.rs index 475544303796d..3fd0f472d1606 100644 --- a/tests/ui/macros/assert-macro-fmt.rs +++ b/tests/ui/macros/assert-macro-fmt.rs @@ -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"); diff --git a/tests/ui/macros/assert-macro-owned.rs b/tests/ui/macros/assert-macro-owned.rs index 46a59db1390c2..f9b6f5f518059 100644 --- a/tests/ui/macros/assert-macro-owned.rs +++ b/tests/ui/macros/assert-macro-owned.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:test-assert-owned -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(non_fmt_panics)] diff --git a/tests/ui/macros/assert-macro-static.rs b/tests/ui/macros/assert-macro-static.rs index 7d9e345d516a3..8c91d7722fc40 100644 --- a/tests/ui/macros/assert-macro-static.rs +++ b/tests/ui/macros/assert-macro-static.rs @@ -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"); diff --git a/tests/ui/macros/assert-matches-macro-msg.rs b/tests/ui/macros/assert-matches-macro-msg.rs index efa4121da9232..956bc9cf0f49b 100644 --- a/tests/ui/macros/assert-matches-macro-msg.rs +++ b/tests/ui/macros/assert-matches-macro-msg.rs @@ -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)] diff --git a/tests/ui/macros/assert-ne-macro-msg.rs b/tests/ui/macros/assert-ne-macro-msg.rs index 0a578e1baf93c..24bc4dbea4753 100644 --- a/tests/ui/macros/assert-ne-macro-msg.rs +++ b/tests/ui/macros/assert-ne-macro-msg.rs @@ -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"); diff --git a/tests/ui/macros/assert-ne-macro-panic.rs b/tests/ui/macros/assert-ne-macro-panic.rs index 9cf5f05e9f18b..c349825baf389 100644 --- a/tests/ui/macros/assert-ne-macro-panic.rs +++ b/tests/ui/macros/assert-ne-macro-panic.rs @@ -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); diff --git a/tests/ui/macros/die-macro-2.rs b/tests/ui/macros/die-macro-2.rs index e5456bdfca0f9..d802f189ce1af 100644 --- a/tests/ui/macros/die-macro-2.rs +++ b/tests/ui/macros/die-macro-2.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:test -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("test"); diff --git a/tests/ui/macros/die-macro-expr.rs b/tests/ui/macros/die-macro-expr.rs index fb92dd66e3dc3..f4fefb0ca37dd 100644 --- a/tests/ui/macros/die-macro-expr.rs +++ b/tests/ui/macros/die-macro-expr.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:test -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let __isize: isize = panic!("test"); diff --git a/tests/ui/macros/die-macro-pure.rs b/tests/ui/macros/die-macro-pure.rs index 484eed3d720f0..d84787705a1aa 100644 --- a/tests/ui/macros/die-macro-pure.rs +++ b/tests/ui/macros/die-macro-pure.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:test -//@ ignore-emscripten no processes +//@ needs-subprocess fn f() { panic!("test"); diff --git a/tests/ui/macros/unimplemented-macro-panic.rs b/tests/ui/macros/unimplemented-macro-panic.rs index d3bff8ca10ba0..804bd61270e2a 100644 --- a/tests/ui/macros/unimplemented-macro-panic.rs +++ b/tests/ui/macros/unimplemented-macro-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:not implemented -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { unimplemented!() diff --git a/tests/ui/macros/unreachable-arg.rs b/tests/ui/macros/unreachable-arg.rs index 1f0d00734865b..702bd053ab022 100644 --- a/tests/ui/macros/unreachable-arg.rs +++ b/tests/ui/macros/unreachable-arg.rs @@ -1,4 +1,4 @@ -//@ ignore-emscripten no processes +//@ needs-subprocess //@ revisions: edition_2015 edition_2021 //@ [edition_2015]edition:2015 diff --git a/tests/ui/macros/unreachable-fmt-msg.rs b/tests/ui/macros/unreachable-fmt-msg.rs index b16394a1920eb..928e0a427ae42 100644 --- a/tests/ui/macros/unreachable-fmt-msg.rs +++ b/tests/ui/macros/unreachable-fmt-msg.rs @@ -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"); diff --git a/tests/ui/macros/unreachable-format-arg.rs b/tests/ui/macros/unreachable-format-arg.rs index 449c6bca16bce..e1fdab25a43c8 100644 --- a/tests/ui/macros/unreachable-format-arg.rs +++ b/tests/ui/macros/unreachable-format-arg.rs @@ -1,5 +1,5 @@ //@ run-fail -//@ ignore-emscripten no processes +//@ needs-subprocess //@ revisions: edition_2015 edition_2021 //@ [edition_2015]edition:2015 diff --git a/tests/ui/macros/unreachable-format-args.rs b/tests/ui/macros/unreachable-format-args.rs index 5f8a0e9cdffa1..856fc992685ac 100644 --- a/tests/ui/macros/unreachable-format-args.rs +++ b/tests/ui/macros/unreachable-format-args.rs @@ -1,4 +1,4 @@ -//@ ignore-emscripten no processes +//@ needs-subprocess //@ revisions: edition_2015 edition_2021 //@ [edition_2015]edition:2015 diff --git a/tests/ui/macros/unreachable-macro-panic.rs b/tests/ui/macros/unreachable-macro-panic.rs index 7909bcb76242d..c5cea5551cfcf 100644 --- a/tests/ui/macros/unreachable-macro-panic.rs +++ b/tests/ui/macros/unreachable-macro-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:internal error: entered unreachable code -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { unreachable!() diff --git a/tests/ui/macros/unreachable-static-msg.rs b/tests/ui/macros/unreachable-static-msg.rs index 3e917897da458..a85f8962e7d9c 100644 --- a/tests/ui/macros/unreachable-static-msg.rs +++ b/tests/ui/macros/unreachable-static-msg.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:internal error: entered unreachable code: uhoh -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { unreachable!("uhoh") diff --git a/tests/ui/macros/unreachable.rs b/tests/ui/macros/unreachable.rs index 7909bcb76242d..c5cea5551cfcf 100644 --- a/tests/ui/macros/unreachable.rs +++ b/tests/ui/macros/unreachable.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:internal error: entered unreachable code -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { unreachable!() diff --git a/tests/ui/match/expr-match-panic-fn.rs b/tests/ui/match/expr-match-panic-fn.rs index 82991d20df88d..a07c2c6af8f79 100644 --- a/tests/ui/match/expr-match-panic-fn.rs +++ b/tests/ui/match/expr-match-panic-fn.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn f() -> ! { panic!() diff --git a/tests/ui/match/expr-match-panic.rs b/tests/ui/match/expr-match-panic.rs index e332ba83b914f..d15b0a9cd726f 100644 --- a/tests/ui/match/expr-match-panic.rs +++ b/tests/ui/match/expr-match-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let _x = match true { diff --git a/tests/ui/match/match-bot-panic.rs b/tests/ui/match/match-bot-panic.rs index a155b5fb3f27e..7ec07ae290d98 100644 --- a/tests/ui/match/match-bot-panic.rs +++ b/tests/ui/match/match-bot-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/tests/ui/match/match-disc-bot.rs b/tests/ui/match/match-disc-bot.rs index fdb98a0accb8f..d65dc5aea0753 100644 --- a/tests/ui/match/match-disc-bot.rs +++ b/tests/ui/match/match-disc-bot.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:quux -//@ ignore-emscripten no processes +//@ needs-subprocess fn f() -> ! { panic!("quux") diff --git a/tests/ui/match/match-wildcards.rs b/tests/ui/match/match-wildcards.rs index 4fddee6666eac..1cc81a7c4159a 100644 --- a/tests/ui/match/match-wildcards.rs +++ b/tests/ui/match/match-wildcards.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:squirrelcupcake -//@ ignore-emscripten no processes +//@ needs-subprocess fn cmp() -> isize { match (Some('a'), None::) { diff --git a/tests/ui/meta/revision-ok.rs b/tests/ui/meta/revision-ok.rs index c1387f7d18e08..430d3d0a2397b 100644 --- a/tests/ui/meta/revision-ok.rs +++ b/tests/ui/meta/revision-ok.rs @@ -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() { diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops.rs b/tests/ui/mir/mir_codegen_calls_converging_drops.rs index 5c3c8b999b2de..8a6d3926de24a 100644 --- a/tests/ui/mir/mir_codegen_calls_converging_drops.rs +++ b/tests/ui/mir/mir_codegen_calls_converging_drops.rs @@ -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 { diff --git a/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs b/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs index e3cb9a96de0da..e89fbc58a0d1c 100644 --- a/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs +++ b/tests/ui/mir/mir_codegen_calls_converging_drops_2.rs @@ -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 { diff --git a/tests/ui/mir/mir_codegen_calls_diverging.rs b/tests/ui/mir/mir_codegen_calls_diverging.rs index c62527f01d38c..ce2d7140b074e 100644 --- a/tests/ui/mir/mir_codegen_calls_diverging.rs +++ b/tests/ui/mir/mir_codegen_calls_diverging.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:diverging_fn called -//@ ignore-emscripten no processes +//@ needs-subprocess fn diverging_fn() -> ! { panic!("diverging_fn called") diff --git a/tests/ui/mir/mir_dynamic_drops_1.rs b/tests/ui/mir/mir_dynamic_drops_1.rs index ffb8cc26100e8..0b0a396057452 100644 --- a/tests/ui/mir/mir_dynamic_drops_1.rs +++ b/tests/ui/mir/mir_dynamic_drops_1.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:drop 1 //@ error-pattern:drop 2 -//@ ignore-emscripten no processes +//@ needs-subprocess /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/tests/ui/mir/mir_dynamic_drops_2.rs b/tests/ui/mir/mir_dynamic_drops_2.rs index dc71f414673de..f625f19be26cb 100644 --- a/tests/ui/mir/mir_dynamic_drops_2.rs +++ b/tests/ui/mir/mir_dynamic_drops_2.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:drop 1 -//@ ignore-emscripten no processes +//@ needs-subprocess /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/tests/ui/mir/mir_dynamic_drops_3.rs b/tests/ui/mir/mir_dynamic_drops_3.rs index fe84502ef1dc1..2a8af4ce1fb4b 100644 --- a/tests/ui/mir/mir_dynamic_drops_3.rs +++ b/tests/ui/mir/mir_dynamic_drops_3.rs @@ -4,7 +4,7 @@ //@ error-pattern:drop 3 //@ error-pattern:drop 2 //@ error-pattern:drop 1 -//@ ignore-emscripten no processes +//@ needs-subprocess /// Structure which will not allow to be dropped twice. struct Droppable<'a>(&'a mut bool, u32); diff --git a/tests/ui/mir/mir_indexing_oob_1.rs b/tests/ui/mir/mir_indexing_oob_1.rs index 3afc2f0b32e62..936484b0c1edd 100644 --- a/tests/ui/mir/mir_indexing_oob_1.rs +++ b/tests/ui/mir/mir_indexing_oob_1.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:index out of bounds: the len is 5 but the index is 10 -//@ ignore-emscripten no processes +//@ needs-subprocess const C: [u32; 5] = [0; 5]; diff --git a/tests/ui/mir/mir_indexing_oob_2.rs b/tests/ui/mir/mir_indexing_oob_2.rs index 6e7c1c83536f4..310a7f8f2b75f 100644 --- a/tests/ui/mir/mir_indexing_oob_2.rs +++ b/tests/ui/mir/mir_indexing_oob_2.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:index out of bounds: the len is 5 but the index is 10 -//@ ignore-emscripten no processes +//@ needs-subprocess const C: &'static [u8; 5] = b"hello"; diff --git a/tests/ui/mir/mir_indexing_oob_3.rs b/tests/ui/mir/mir_indexing_oob_3.rs index 4012864c6ce63..44b3a2c5a6dd9 100644 --- a/tests/ui/mir/mir_indexing_oob_3.rs +++ b/tests/ui/mir/mir_indexing_oob_3.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:index out of bounds: the len is 5 but the index is 10 -//@ ignore-emscripten no processes +//@ needs-subprocess const C: &'static [u8; 5] = b"hello"; diff --git a/tests/ui/never_type/return-never-coerce.rs b/tests/ui/never_type/return-never-coerce.rs index 559b7d0e985e4..14f07dfeb76a9 100644 --- a/tests/ui/never_type/return-never-coerce.rs +++ b/tests/ui/never_type/return-never-coerce.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:aah! -//@ ignore-emscripten no processes +//@ needs-subprocess fn call_another_fn T>(f: F) -> T { f() diff --git a/tests/ui/nll/issue-51345-2.rs b/tests/ui/nll/issue-51345-2.rs index f2501fdbab405..39871d56a9af8 100644 --- a/tests/ui/nll/issue-51345-2.rs +++ b/tests/ui/nll/issue-51345-2.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let mut vec = vec![]; diff --git a/tests/ui/numbers-arithmetic/divide-by-zero.rs b/tests/ui/numbers-arithmetic/divide-by-zero.rs index 626daf9771ded..a05abadf4bb45 100644 --- a/tests/ui/numbers-arithmetic/divide-by-zero.rs +++ b/tests/ui/numbers-arithmetic/divide-by-zero.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:attempt to divide by zero -//@ ignore-emscripten no processes +//@ needs-subprocess #[allow(unconditional_panic)] fn main() { diff --git a/tests/ui/numbers-arithmetic/mod-zero.rs b/tests/ui/numbers-arithmetic/mod-zero.rs index f3cc7c9fc88f0..300bd765c4037 100644 --- a/tests/ui/numbers-arithmetic/mod-zero.rs +++ b/tests/ui/numbers-arithmetic/mod-zero.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:attempt to calculate the remainder with a divisor of zero -//@ ignore-emscripten no processes +//@ needs-subprocess #[allow(unconditional_panic)] fn main() { diff --git a/tests/ui/numbers-arithmetic/overflowing-add.rs b/tests/ui/numbers-arithmetic/overflowing-add.rs index 16583f6eb749f..c1f498c802b41 100644 --- a/tests/ui/numbers-arithmetic/overflowing-add.rs +++ b/tests/ui/numbers-arithmetic/overflowing-add.rs @@ -2,7 +2,7 @@ //@ error-pattern:thread 'main' panicked //@ error-pattern:attempt to add with overflow //@ compile-flags: -C debug-assertions -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(arithmetic_overflow)] diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.rs b/tests/ui/numbers-arithmetic/overflowing-mul.rs index 59575d2e86e07..0eece5369299b 100644 --- a/tests/ui/numbers-arithmetic/overflowing-mul.rs +++ b/tests/ui/numbers-arithmetic/overflowing-mul.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:attempt to multiply with overflow -//@ ignore-emscripten no processes +//@ needs-subprocess //@ compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs index 8aa0d04e500c7..c5059c002b4bf 100644 --- a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs +++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:attempt to negate with overflow -//@ ignore-emscripten no processes +//@ needs-subprocess //@ compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs index 69e22c2262a3a..28deb7cf6bad1 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:attempt to multiply with overflow -//@ ignore-emscripten no processes +//@ needs-subprocess //@ compile-flags: -C debug-assertions fn main() { diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs index f980033c480e1..dea9a4d5428be 100644 --- a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs +++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:attempt to multiply with overflow -//@ ignore-emscripten no processes +//@ needs-subprocess //@ compile-flags: -C debug-assertions fn main() { diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.rs b/tests/ui/numbers-arithmetic/overflowing-sub.rs index 44aadf6b3e70e..88b1b693f6326 100644 --- a/tests/ui/numbers-arithmetic/overflowing-sub.rs +++ b/tests/ui/numbers-arithmetic/overflowing-sub.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:attempt to subtract with overflow -//@ ignore-emscripten no processes +//@ needs-subprocess //@ compile-flags: -C debug-assertions #![allow(arithmetic_overflow)] diff --git a/tests/ui/panic-runtime/unwind-interleaved.rs b/tests/ui/panic-runtime/unwind-interleaved.rs index e5505cd893a11..83eb636509755 100644 --- a/tests/ui/panic-runtime/unwind-interleaved.rs +++ b/tests/ui/panic-runtime/unwind-interleaved.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn a() {} diff --git a/tests/ui/panic-runtime/unwind-rec.rs b/tests/ui/panic-runtime/unwind-rec.rs index d4b53c8876813..a855a4de28014 100644 --- a/tests/ui/panic-runtime/unwind-rec.rs +++ b/tests/ui/panic-runtime/unwind-rec.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn build() -> Vec { panic!(); diff --git a/tests/ui/panic-runtime/unwind-rec2.rs b/tests/ui/panic-runtime/unwind-rec2.rs index 6ac9a5a580547..ed02b117fff4b 100644 --- a/tests/ui/panic-runtime/unwind-rec2.rs +++ b/tests/ui/panic-runtime/unwind-rec2.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn build1() -> Vec { vec![0, 0, 0, 0, 0, 0, 0] diff --git a/tests/ui/panic-runtime/unwind-unique.rs b/tests/ui/panic-runtime/unwind-unique.rs index a6cd59690ca92..b57d81842c4dd 100644 --- a/tests/ui/panic-runtime/unwind-unique.rs +++ b/tests/ui/panic-runtime/unwind-unique.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn failfn() { panic!(); diff --git a/tests/ui/panics/abort-on-panic.rs b/tests/ui/panics/abort-on-panic.rs index feccefb253768..d3bf087bd3ef8 100644 --- a/tests/ui/panics/abort-on-panic.rs +++ b/tests/ui/panics/abort-on-panic.rs @@ -8,8 +8,7 @@ // Since we mark some ABIs as "nounwind" to LLVM, we must make sure that // we never unwind through them. -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::io; use std::io::prelude::*; diff --git a/tests/ui/panics/args-panic.rs b/tests/ui/panics/args-panic.rs index 091ced9b47917..9675c99dcb6f8 100644 --- a/tests/ui/panics/args-panic.rs +++ b/tests/ui/panics/args-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:meep -//@ ignore-emscripten no processes +//@ needs-subprocess fn f(_a: isize, _b: isize, _c: Box) { panic!("moop"); diff --git a/tests/ui/panics/doublepanic.rs b/tests/ui/panics/doublepanic.rs index 51945ea708c2e..6fddde82a277a 100644 --- a/tests/ui/panics/doublepanic.rs +++ b/tests/ui/panics/doublepanic.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:One -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("One"); diff --git a/tests/ui/panics/explicit-panic-msg.rs b/tests/ui/panics/explicit-panic-msg.rs index ef0c5b39f0990..e5728ef1e20c5 100644 --- a/tests/ui/panics/explicit-panic-msg.rs +++ b/tests/ui/panics/explicit-panic-msg.rs @@ -4,7 +4,7 @@ //@ run-fail //@ error-pattern:wooooo -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let mut a = 1; diff --git a/tests/ui/panics/explicit-panic.rs b/tests/ui/panics/explicit-panic.rs index 34e952ef68f9b..7c69289940e49 100644 --- a/tests/ui/panics/explicit-panic.rs +++ b/tests/ui/panics/explicit-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:explicit -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!(); diff --git a/tests/ui/panics/fmt-panic.rs b/tests/ui/panics/fmt-panic.rs index 032f65cb2e4b3..c6cb039684dba 100644 --- a/tests/ui/panics/fmt-panic.rs +++ b/tests/ui/panics/fmt-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:meh -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let str_var: String = "meh".to_string(); diff --git a/tests/ui/panics/issue-47429-short-backtraces.rs b/tests/ui/panics/issue-47429-short-backtraces.rs index dff885af1b87a..4a73ebe8712dc 100644 --- a/tests/ui/panics/issue-47429-short-backtraces.rs +++ b/tests/ui/panics/issue-47429-short-backtraces.rs @@ -17,10 +17,10 @@ //@ ignore-msvc see #62897 and `backtrace-debuginfo.rs` test //@ ignore-android FIXME #17520 //@ ignore-openbsd no support for libbacktrace without filename -//@ ignore-wasm no panic or subprocess support -//@ ignore-emscripten no panic or subprocess support -//@ ignore-sgx no subprocess support +//@ ignore-wasm no panic support +//@ ignore-emscripten no panic support //@ ignore-fuchsia Backtraces not symbolized +//@ needs-subprocess fn main() { panic!() diff --git a/tests/ui/panics/main-panic.rs b/tests/ui/panics/main-panic.rs index b69f1656ca491..0b3d5c3aaec85 100644 --- a/tests/ui/panics/main-panic.rs +++ b/tests/ui/panics/main-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:thread 'main' panicked at -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!() diff --git a/tests/ui/panics/panic-arg.rs b/tests/ui/panics/panic-arg.rs index 10be6d5ff6ce1..037cfda3689a1 100644 --- a/tests/ui/panics/panic-arg.rs +++ b/tests/ui/panics/panic-arg.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:woe -//@ ignore-emscripten no processes +//@ needs-subprocess fn f(a: isize) { println!("{}", a); diff --git a/tests/ui/panics/panic-macro-any-wrapped.rs b/tests/ui/panics/panic-macro-any-wrapped.rs index 7c6790e35fd16..e3a2dc6eed42e 100644 --- a/tests/ui/panics/panic-macro-any-wrapped.rs +++ b/tests/ui/panics/panic-macro-any-wrapped.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:Box -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-any.rs b/tests/ui/panics/panic-macro-any.rs index 75397333fa4a3..1392929b65c2e 100644 --- a/tests/ui/panics/panic-macro-any.rs +++ b/tests/ui/panics/panic-macro-any.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:Box -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(non_fmt_panics)] diff --git a/tests/ui/panics/panic-macro-explicit.rs b/tests/ui/panics/panic-macro-explicit.rs index 2c7b84d99fea2..b9195e3b0fccf 100644 --- a/tests/ui/panics/panic-macro-explicit.rs +++ b/tests/ui/panics/panic-macro-explicit.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:explicit panic -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!(); diff --git a/tests/ui/panics/panic-macro-fmt.rs b/tests/ui/panics/panic-macro-fmt.rs index 1a63a06c75ad3..550cd5c1ee333 100644 --- a/tests/ui/panics/panic-macro-fmt.rs +++ b/tests/ui/panics/panic-macro-fmt.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:test-fail-fmt 42 rust -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("test-fail-fmt {} {}", 42, "rust"); diff --git a/tests/ui/panics/panic-macro-owned.rs b/tests/ui/panics/panic-macro-owned.rs index 1878f3d52abde..4df04c50bc3eb 100644 --- a/tests/ui/panics/panic-macro-owned.rs +++ b/tests/ui/panics/panic-macro-owned.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:test-fail-owned -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("test-fail-owned"); diff --git a/tests/ui/panics/panic-macro-static.rs b/tests/ui/panics/panic-macro-static.rs index 018166e60cfab..1c6258ebed24b 100644 --- a/tests/ui/panics/panic-macro-static.rs +++ b/tests/ui/panics/panic-macro-static.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:panicked //@ error-pattern:test-fail-static -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("test-fail-static"); diff --git a/tests/ui/panics/panic-main.rs b/tests/ui/panics/panic-main.rs index d71fca0754e9e..3876dbb37c37d 100644 --- a/tests/ui/panics/panic-main.rs +++ b/tests/ui/panics/panic-main.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:moop -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("moop"); diff --git a/tests/ui/panics/panic-parens.rs b/tests/ui/panics/panic-parens.rs index 271d0363cab8a..5440bf18f2567 100644 --- a/tests/ui/panics/panic-parens.rs +++ b/tests/ui/panics/panic-parens.rs @@ -3,7 +3,7 @@ //@ run-fail //@ error-pattern:oops -//@ ignore-emscripten no processes +//@ needs-subprocess fn bigpanic() { while (panic!("oops")) { diff --git a/tests/ui/panics/panic-set-handler.rs b/tests/ui/panics/panic-set-handler.rs index 39286ca865ba5..41e513e0bd680 100644 --- a/tests/ui/panics/panic-set-handler.rs +++ b/tests/ui/panics/panic-set-handler.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:greetings from the panic handler -//@ ignore-emscripten no processes +//@ needs-subprocess use std::panic; diff --git a/tests/ui/panics/panic-set-unset-handler.rs b/tests/ui/panics/panic-set-unset-handler.rs index 02f1599338b66..66d5003d0f1c5 100644 --- a/tests/ui/panics/panic-set-unset-handler.rs +++ b/tests/ui/panics/panic-set-unset-handler.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:foobar -//@ ignore-emscripten no processes +//@ needs-subprocess use std::panic; diff --git a/tests/ui/panics/panic-take-handler-nop.rs b/tests/ui/panics/panic-take-handler-nop.rs index 89e1d234df138..f10582872df21 100644 --- a/tests/ui/panics/panic-take-handler-nop.rs +++ b/tests/ui/panics/panic-take-handler-nop.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:thread 'main' panicked //@ error-pattern:foobar -//@ ignore-emscripten no processes +//@ needs-subprocess use std::panic; diff --git a/tests/ui/panics/panic.rs b/tests/ui/panics/panic.rs index b9721ac8230f7..068f187524d5b 100644 --- a/tests/ui/panics/panic.rs +++ b/tests/ui/panics/panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:1 == 2 -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { assert!(1 == 2); diff --git a/tests/ui/panics/result-get-panic.rs b/tests/ui/panics/result-get-panic.rs index d7f6dfe8406da..b8dc49f9acaa5 100644 --- a/tests/ui/panics/result-get-panic.rs +++ b/tests/ui/panics/result-get-panic.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:called `Result::unwrap()` on an `Err` value -//@ ignore-emscripten no processes +//@ needs-subprocess use std::result::Result::Err; diff --git a/tests/ui/panics/runtime-switch.rs b/tests/ui/panics/runtime-switch.rs index ffd038f953515..9f0be8c7ddfa6 100644 --- a/tests/ui/panics/runtime-switch.rs +++ b/tests/ui/panics/runtime-switch.rs @@ -18,9 +18,9 @@ //@ ignore-android FIXME #17520 //@ ignore-openbsd no support for libbacktrace without filename //@ ignore-wasm no backtrace support -//@ ignore-emscripten no panic or subprocess support -//@ ignore-sgx no subprocess support +//@ ignore-emscripten no panic support //@ ignore-fuchsia Backtrace not symbolized +//@ needs-subprocess #![feature(panic_backtrace_config)] diff --git a/tests/ui/panics/test-panic.rs b/tests/ui/panics/test-panic.rs index 29a3c4e9c9f1a..c7af47524cfcf 100644 --- a/tests/ui/panics/test-panic.rs +++ b/tests/ui/panics/test-panic.rs @@ -1,7 +1,7 @@ //@ run-fail //@ check-stdout //@ compile-flags: --test -//@ ignore-emscripten +//@ needs-subprocess #[test] fn test_foo() { diff --git a/tests/ui/panics/test-should-panic-no-message.rs b/tests/ui/panics/test-should-panic-no-message.rs index b6ed6b19dd086..05fc927d876b5 100644 --- a/tests/ui/panics/test-should-panic-no-message.rs +++ b/tests/ui/panics/test-should-panic-no-message.rs @@ -1,7 +1,7 @@ //@ run-fail //@ compile-flags: --test //@ check-stdout -//@ ignore-wasm32 no processes +//@ needs-subprocess #[test] #[should_panic(expected = "foo")] diff --git a/tests/ui/panics/while-body-panics.rs b/tests/ui/panics/while-body-panics.rs index bddcd5d50ce4c..8459a8d63bff3 100644 --- a/tests/ui/panics/while-body-panics.rs +++ b/tests/ui/panics/while-body-panics.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:quux -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { let _x: isize = { diff --git a/tests/ui/panics/while-panic.rs b/tests/ui/panics/while-panic.rs index 2961e8599c356..4c8431c71d128 100644 --- a/tests/ui/panics/while-panic.rs +++ b/tests/ui/panics/while-panic.rs @@ -2,7 +2,7 @@ //@ run-fail //@ error-pattern:giraffe -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() { panic!("{}", { diff --git a/tests/ui/print-stdout-eprint-stderr.rs b/tests/ui/print-stdout-eprint-stderr.rs index e84a9bebc495a..4b356e2fe6172 100644 --- a/tests/ui/print-stdout-eprint-stderr.rs +++ b/tests/ui/print-stdout-eprint-stderr.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 spawning processes is not supported -//@ ignore-sgx no processes +//@ needs-subprocess use std::{env, process}; diff --git a/tests/ui/process/env-args-reverse-iterator.rs b/tests/ui/process/env-args-reverse-iterator.rs index 830e953546644..f0afeeb22eb73 100644 --- a/tests/ui/process/env-args-reverse-iterator.rs +++ b/tests/ui/process/env-args-reverse-iterator.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env::args; use std::process::Command; diff --git a/tests/ui/process/inherit-env.rs b/tests/ui/process/inherit-env.rs index 0eb61fcdd53b3..09d5b76141ef3 100644 --- a/tests/ui/process/inherit-env.rs +++ b/tests/ui/process/inherit-env.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no subprocess support -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::process::Command; diff --git a/tests/ui/process/issue-14940.rs b/tests/ui/process/issue-14940.rs index 13fb18154a0db..cfbc743250fde 100644 --- a/tests/ui/process/issue-14940.rs +++ b/tests/ui/process/issue-14940.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::process::Command; diff --git a/tests/ui/process/issue-16272.rs b/tests/ui/process/issue-16272.rs index bf26769d494f6..7270855475346 100644 --- a/tests/ui/process/issue-16272.rs +++ b/tests/ui/process/issue-16272.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::process::Command; use std::env; diff --git a/tests/ui/process/issue-30490.rs b/tests/ui/process/issue-30490.rs index 0d918bc3dd549..75b36e7c20b24 100644 --- a/tests/ui/process/issue-30490.rs +++ b/tests/ui/process/issue-30490.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-emscripten no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia Child I/O swaps not privileged // Previously libstd would set stdio descriptors of a child process diff --git a/tests/ui/process/multi-panic.rs b/tests/ui/process/multi-panic.rs index ad47925a14987..481fe75c731de 100644 --- a/tests/ui/process/multi-panic.rs +++ b/tests/ui/process/multi-panic.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ needs-unwind fn check_for_no_backtrace(test: std::process::Output) { diff --git a/tests/ui/process/no-stdio.rs b/tests/ui/process/no-stdio.rs index 8eebf6dbc7d4e..5cc7cacbb22f0 100644 --- a/tests/ui/process/no-stdio.rs +++ b/tests/ui/process/no-stdio.rs @@ -1,7 +1,6 @@ //@ run-pass //@ ignore-android -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess #![feature(rustc_private)] diff --git a/tests/ui/process/println-with-broken-pipe.rs b/tests/ui/process/println-with-broken-pipe.rs index d88c6dcc12b31..fbac9b6cd958f 100644 --- a/tests/ui/process/println-with-broken-pipe.rs +++ b/tests/ui/process/println-with-broken-pipe.rs @@ -1,7 +1,7 @@ //@ run-pass //@ check-run-results +//@ needs-subprocess //@ ignore-windows -//@ ignore-wasm32 //@ ignore-fuchsia //@ ignore-horizon //@ ignore-android diff --git a/tests/ui/process/process-envs.rs b/tests/ui/process/process-envs.rs index 15285960d16ae..98052f1d3a5d7 100644 --- a/tests/ui/process/process-envs.rs +++ b/tests/ui/process/process-envs.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-vxworks no 'env' //@ ignore-fuchsia no 'env' diff --git a/tests/ui/process/process-remove-from-env.rs b/tests/ui/process/process-remove-from-env.rs index 21fff4fd45d1d..c1a2b2daf5b63 100644 --- a/tests/ui/process/process-remove-from-env.rs +++ b/tests/ui/process/process-remove-from-env.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-vxworks no 'env' //@ ignore-fuchsia no 'env' diff --git a/tests/ui/process/process-spawn-nonexistent.rs b/tests/ui/process/process-spawn-nonexistent.rs index 1cd328662994d..3db670624fb37 100644 --- a/tests/ui/process/process-spawn-nonexistent.rs +++ b/tests/ui/process/process-spawn-nonexistent.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia ErrorKind not translated use std::io::ErrorKind; diff --git a/tests/ui/process/process-spawn-with-unicode-params.rs b/tests/ui/process/process-spawn-with-unicode-params.rs index 4d2ba49eeac71..65f835c13459c 100644 --- a/tests/ui/process/process-spawn-with-unicode-params.rs +++ b/tests/ui/process/process-spawn-with-unicode-params.rs @@ -7,8 +7,7 @@ // non-ASCII characters. The child process ensures all the strings are // intact. -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia Filesystem manipulation privileged use std::io::prelude::*; diff --git a/tests/ui/process/process-status-inherits-stdin.rs b/tests/ui/process/process-status-inherits-stdin.rs index 39eef34c5f862..d5dd0e55fa339 100644 --- a/tests/ui/process/process-status-inherits-stdin.rs +++ b/tests/ui/process/process-status-inherits-stdin.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::io; diff --git a/tests/ui/process/tls-exit-status.rs b/tests/ui/process/tls-exit-status.rs index cddcf369da0bd..6dd0d71ef356a 100644 --- a/tests/ui/process/tls-exit-status.rs +++ b/tests/ui/process/tls-exit-status.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:nonzero //@ exec-env:RUST_NEWRT=1 -//@ ignore-wasm32 no processes +//@ needs-subprocess use std::env; diff --git a/tests/ui/reachable/issue-948.rs b/tests/ui/reachable/issue-948.rs index 8e239a1115eb4..6181e547acc81 100644 --- a/tests/ui/reachable/issue-948.rs +++ b/tests/ui/reachable/issue-948.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:beep boop -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(unused_variables)] diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs index fb6718e55b286..00a0ea04c0d1d 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:returned Box from main() //@ failure-status: 1 -//@ ignore-emscripten no processes +//@ needs-subprocess use std::error::Error; use std::io; diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs index 91be3afbe225a..3b80c2b49a508 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs @@ -1,6 +1,6 @@ //@ run-fail //@ error-pattern:oh, dear -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() -> ! { panic!("oh, dear"); diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs index f1d972b3c5503..48605309965f7 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern:returned Box from main() //@ failure-status: 1 -//@ ignore-emscripten no processes +//@ needs-subprocess use std::io::{Error, ErrorKind}; diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs index acf3da2d55f36..8f7b3da31bb4c 100644 --- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs +++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs @@ -1,7 +1,7 @@ //@ run-fail //@ error-pattern: An error message for you //@ failure-status: 1 -//@ ignore-emscripten no processes +//@ needs-subprocess fn main() -> Result<(), &'static str> { Err("An error message for you") diff --git a/tests/ui/runtime/atomic-print.rs b/tests/ui/runtime/atomic-print.rs index 7352058973637..6b899d675a215 100644 --- a/tests/ui/runtime/atomic-print.rs +++ b/tests/ui/runtime/atomic-print.rs @@ -2,8 +2,8 @@ #![allow(unused_must_use)] #![allow(deprecated)] -//@ ignore-wasm32 no processes or threads -//@ ignore-sgx no processes +//@ needs-threads +//@ needs-subprocess use std::{env, fmt, process, sync, thread}; diff --git a/tests/ui/runtime/backtrace-debuginfo.rs b/tests/ui/runtime/backtrace-debuginfo.rs index da747ded44ff2..afc96d6bb5f54 100644 --- a/tests/ui/runtime/backtrace-debuginfo.rs +++ b/tests/ui/runtime/backtrace-debuginfo.rs @@ -9,8 +9,7 @@ //@ compile-flags:-g -Copt-level=0 -Cllvm-args=-enable-tail-merge=0 //@ compile-flags:-Cforce-frame-pointers=yes //@ compile-flags:-Cstrip=none -//@ ignore-wasm32 spawning processes is not supported -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia Backtrace not symbolized, trace different line alignment // FIXME(#117097): backtrace (possibly unwinding mechanism) seems to be different on at least diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs index c5300635ad924..6be34afb56035 100644 --- a/tests/ui/runtime/out-of-stack.rs +++ b/tests/ui/runtime/out-of-stack.rs @@ -3,8 +3,7 @@ #![allow(unused_must_use)] #![allow(unconditional_recursion)] //@ ignore-android: FIXME (#20004) -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590) //@ ignore-nto no stack overflow handler used (no alternate stack available) //@ ignore-ios stack overflow handlers aren't enabled diff --git a/tests/ui/runtime/rt-explody-panic-payloads.rs b/tests/ui/runtime/rt-explody-panic-payloads.rs index bd3624a8aee3d..c177fd260ed4f 100644 --- a/tests/ui/runtime/rt-explody-panic-payloads.rs +++ b/tests/ui/runtime/rt-explody-panic-payloads.rs @@ -1,7 +1,6 @@ //@ run-pass //@ needs-unwind -//@ ignore-emscripten no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::process::Command; diff --git a/tests/ui/runtime/running-with-no-runtime.rs b/tests/ui/runtime/running-with-no-runtime.rs index 5c219b6fedac5..7ac0dd912dc0d 100644 --- a/tests/ui/runtime/running-with-no-runtime.rs +++ b/tests/ui/runtime/running-with-no-runtime.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 spawning processes is not supported -//@ ignore-sgx no processes +//@ needs-subprocess #![no_main] diff --git a/tests/ui/simd/target-feature-mixup.rs b/tests/ui/simd/target-feature-mixup.rs index 62d87c3a6dc6c..2786251c7951b 100644 --- a/tests/ui/simd/target-feature-mixup.rs +++ b/tests/ui/simd/target-feature-mixup.rs @@ -3,8 +3,7 @@ #![allow(stable_features)] #![allow(overflowing_literals)] -//@ ignore-wasm32 no subprocess support -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-fuchsia must translate zircon signal to SIGILL, FIXME (#58590) #![feature(repr_simd, target_feature, cfg_target_feature)] diff --git a/tests/ui/stdio-is-blocking.rs b/tests/ui/stdio-is-blocking.rs index dda100951dded..615530dcd47e4 100644 --- a/tests/ui/stdio-is-blocking.rs +++ b/tests/ui/stdio-is-blocking.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess use std::env; use std::io::prelude::*; diff --git a/tests/ui/str/str-overrun.rs b/tests/ui/str/str-overrun.rs index b8e245475da92..6d62b837694b0 100644 --- a/tests/ui/str/str-overrun.rs +++ b/tests/ui/str/str-overrun.rs @@ -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 fn main() { let s: String = "hello".to_string(); diff --git a/tests/ui/structs/rhs-type.rs b/tests/ui/structs/rhs-type.rs index fde5c16a0680e..8ce924672cfd1 100644 --- a/tests/ui/structs/rhs-type.rs +++ b/tests/ui/structs/rhs-type.rs @@ -3,7 +3,7 @@ //@ run-fail //@ error-pattern:bye -//@ ignore-emscripten no processes +//@ needs-subprocess #![allow(unreachable_code)] #![allow(unused_variables)] diff --git a/tests/ui/test-attrs/test-panic-abort-disabled.rs b/tests/ui/test-attrs/test-panic-abort-disabled.rs index fbe3d7d5d18d7..05dd9395c2b06 100644 --- a/tests/ui/test-attrs/test-panic-abort-disabled.rs +++ b/tests/ui/test-attrs/test-panic-abort-disabled.rs @@ -4,8 +4,9 @@ //@ run-flags: --test-threads=1 //@ needs-unwind -//@ ignore-wasm no panic or subprocess support -//@ ignore-emscripten no panic or subprocess support +//@ ignore-wasm no panic support +//@ ignore-emscripten no panic support +//@ needs-subprocess #![cfg(test)] diff --git a/tests/ui/test-attrs/test-panic-abort-nocapture.rs b/tests/ui/test-attrs/test-panic-abort-nocapture.rs index 4377ae1ac3bd7..f7e15dbdbc30c 100644 --- a/tests/ui/test-attrs/test-panic-abort-nocapture.rs +++ b/tests/ui/test-attrs/test-panic-abort-nocapture.rs @@ -7,9 +7,9 @@ //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ ignore-android #120567 -//@ ignore-wasm no panic or subprocess support -//@ ignore-emscripten no panic or subprocess support -//@ ignore-sgx no subprocess support +//@ ignore-wasm no panic support +//@ ignore-emscripten no panic support +//@ needs-subprocess #![cfg(test)] diff --git a/tests/ui/test-attrs/test-panic-abort.rs b/tests/ui/test-attrs/test-panic-abort.rs index 3d203e059a46a..951cf54346b4f 100644 --- a/tests/ui/test-attrs/test-panic-abort.rs +++ b/tests/ui/test-attrs/test-panic-abort.rs @@ -7,9 +7,9 @@ //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" //@ ignore-android #120567 -//@ ignore-wasm no panic or subprocess support -//@ ignore-emscripten no panic or subprocess support -//@ ignore-sgx no subprocess support +//@ ignore-wasm no panic support +//@ ignore-emscripten no panic support +//@ needs-subprocess #![cfg(test)] #![feature(test)] diff --git a/tests/ui/threads-sendsync/eprint-on-tls-drop.rs b/tests/ui/threads-sendsync/eprint-on-tls-drop.rs index 82abf21df3f41..e85c7c83339b4 100644 --- a/tests/ui/threads-sendsync/eprint-on-tls-drop.rs +++ b/tests/ui/threads-sendsync/eprint-on-tls-drop.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-threads -//@ ignore-sgx no processes +//@ needs-subprocess use std::cell::RefCell; use std::env; diff --git a/tests/ui/threads-sendsync/issue-24313.rs b/tests/ui/threads-sendsync/issue-24313.rs index 99c6c4a5e12de..83ab5122e82b9 100644 --- a/tests/ui/threads-sendsync/issue-24313.rs +++ b/tests/ui/threads-sendsync/issue-24313.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-threads -//@ ignore-sgx no processes +//@ needs-subprocess use std::process::Command; use std::{env, thread}; diff --git a/tests/ui/wait-forked-but-failed-child.rs b/tests/ui/wait-forked-but-failed-child.rs index dd6a7fa0e6505..04f1c1a65d5cb 100644 --- a/tests/ui/wait-forked-but-failed-child.rs +++ b/tests/ui/wait-forked-but-failed-child.rs @@ -1,6 +1,5 @@ //@ run-pass -//@ ignore-wasm32 no processes -//@ ignore-sgx no processes +//@ needs-subprocess //@ ignore-vxworks no 'ps' //@ ignore-fuchsia no 'ps' //@ ignore-nto no 'ps' From 071ad3795c9dacbb3cf8ef7c06f9a0d9fd91c076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= <39484203+jieyouxu@users.noreply.github.com> Date: Thu, 23 Jan 2025 17:05:01 +0800 Subject: [PATCH 27/41] tests: use `needs-threads` instead of `ignore-emscripten` --- tests/ui/array-slice-vec/box-of-array-of-drop-1.rs | 4 ++-- tests/ui/array-slice-vec/box-of-array-of-drop-2.rs | 4 ++-- tests/ui/array-slice-vec/nested-vec-3.rs | 4 ++-- tests/ui/array-slice-vec/slice-panic-1.rs | 3 +-- tests/ui/array-slice-vec/slice-panic-2.rs | 3 +-- tests/ui/box/unit/unwind-unique.rs | 2 +- tests/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs | 2 +- tests/ui/drop/drop-trait-enum.rs | 2 +- tests/ui/drop/terminate-in-initializer.rs | 2 +- .../issue-64655-allow-unwind-when-calling-panic-directly.rs | 2 +- tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs | 2 +- tests/ui/issues/issue-25089.rs | 2 +- tests/ui/issues/issue-26655.rs | 2 +- tests/ui/issues/issue-29485.rs | 2 +- tests/ui/issues/issue-30018-panic.rs | 2 +- tests/ui/issues/issue-38763.rs | 2 +- tests/ui/numbers-arithmetic/int-abs-overflow.rs | 2 +- tests/ui/numbers-arithmetic/issue-8460.rs | 2 +- tests/ui/panics/panic-handler-chain-update-hook.rs | 2 +- tests/ui/panics/panic-handler-flail-wildly.rs | 2 +- tests/ui/panics/panic-handler-set-twice.rs | 2 +- tests/ui/panics/panic-in-dtor-drops-fields.rs | 2 +- tests/ui/panics/panic-recover-propagate.rs | 2 +- tests/ui/process/process-sigpipe.rs | 2 +- tests/ui/sepcomp/sepcomp-unwind.rs | 2 +- tests/ui/structs-enums/unit-like-struct-drop-run.rs | 2 +- tests/ui/test-attrs/terse.rs | 2 +- tests/ui/test-attrs/test-thread-capture.rs | 2 +- tests/ui/test-attrs/test-thread-nocapture.rs | 2 +- 29 files changed, 32 insertions(+), 34 deletions(-) diff --git a/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs b/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs index d64df4f7e4d9a..c7c05946c4ca9 100644 --- a/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs +++ b/tests/ui/array-slice-vec/box-of-array-of-drop-1.rs @@ -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}; diff --git a/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs b/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs index 5ca3d60ad1dc9..98175a26ec0d1 100644 --- a/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs +++ b/tests/ui/array-slice-vec/box-of-array-of-drop-2.rs @@ -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}; diff --git a/tests/ui/array-slice-vec/nested-vec-3.rs b/tests/ui/array-slice-vec/nested-vec-3.rs index ce61401aab451..51975743742cf 100644 --- a/tests/ui/array-slice-vec/nested-vec-3.rs +++ b/tests/ui/array-slice-vec/nested-vec-3.rs @@ -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 diff --git a/tests/ui/array-slice-vec/slice-panic-1.rs b/tests/ui/array-slice-vec/slice-panic-1.rs index d4f584c163222..a745dff96afc7 100644 --- a/tests/ui/array-slice-vec/slice-panic-1.rs +++ b/tests/ui/array-slice-vec/slice-panic-1.rs @@ -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. diff --git a/tests/ui/array-slice-vec/slice-panic-2.rs b/tests/ui/array-slice-vec/slice-panic-2.rs index b3d1dc455735a..483a4cbe245db 100644 --- a/tests/ui/array-slice-vec/slice-panic-2.rs +++ b/tests/ui/array-slice-vec/slice-panic-2.rs @@ -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. diff --git a/tests/ui/box/unit/unwind-unique.rs b/tests/ui/box/unit/unwind-unique.rs index 512327c9af456..1da55c45ee969 100644 --- a/tests/ui/box/unit/unwind-unique.rs +++ b/tests/ui/box/unit/unwind-unique.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs b/tests/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs index 80c5a8fe0995f..4c59df24e4b3f 100644 --- a/tests/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs +++ b/tests/ui/cleanup-rvalue-temp-during-incomplete-alloc.rs @@ -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; diff --git a/tests/ui/drop/drop-trait-enum.rs b/tests/ui/drop/drop-trait-enum.rs index 91b5bcdf7301d..5a88d959ec6fa 100644 --- a/tests/ui/drop/drop-trait-enum.rs +++ b/tests/ui/drop/drop-trait-enum.rs @@ -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; diff --git a/tests/ui/drop/terminate-in-initializer.rs b/tests/ui/drop/terminate-in-initializer.rs index 23169aaf65bdc..24ec39fe09638 100644 --- a/tests/ui/drop/terminate-in-initializer.rs +++ b/tests/ui/drop/terminate-in-initializer.rs @@ -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 diff --git a/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs index e9471d207da48..1cd52b70315c1 100644 --- a/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs +++ b/tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs @@ -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, diff --git a/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs index 9486b5f1178c4..a44eb3828d0a9 100644 --- a/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs +++ b/tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs @@ -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, diff --git a/tests/ui/issues/issue-25089.rs b/tests/ui/issues/issue-25089.rs index ea9ab290904c3..929738c3e794d 100644 --- a/tests/ui/issues/issue-25089.rs +++ b/tests/ui/issues/issue-25089.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/issues/issue-26655.rs b/tests/ui/issues/issue-26655.rs index 7f1858fdb7d0e..416472b0b269e 100644 --- a/tests/ui/issues/issue-26655.rs +++ b/tests/ui/issues/issue-26655.rs @@ -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 diff --git a/tests/ui/issues/issue-29485.rs b/tests/ui/issues/issue-29485.rs index 56865d0e5db15..a44bcd49c6a9c 100644 --- a/tests/ui/issues/issue-29485.rs +++ b/tests/ui/issues/issue-29485.rs @@ -2,7 +2,7 @@ #![allow(unused_attributes)] //@ aux-build:issue-29485.rs //@ needs-unwind -//@ ignore-emscripten no threads +//@ needs-threads #[feature(recover)] diff --git a/tests/ui/issues/issue-30018-panic.rs b/tests/ui/issues/issue-30018-panic.rs index f5482d7c741df..591848b6f7b4e 100644 --- a/tests/ui/issues/issue-30018-panic.rs +++ b/tests/ui/issues/issue-30018-panic.rs @@ -5,7 +5,7 @@ // SIGTRAP injected by the drop-flag consistency checking. //@ needs-unwind -//@ ignore-emscripten no threads support +//@ needs-threads struct Foo; diff --git a/tests/ui/issues/issue-38763.rs b/tests/ui/issues/issue-38763.rs index 05cd648dcfe97..87c758db1723c 100644 --- a/tests/ui/issues/issue-38763.rs +++ b/tests/ui/issues/issue-38763.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ ignore-emscripten +//@ needs-threads #[repr(C)] pub struct Foo(i128); diff --git a/tests/ui/numbers-arithmetic/int-abs-overflow.rs b/tests/ui/numbers-arithmetic/int-abs-overflow.rs index e91141380482d..6397f62d06551 100644 --- a/tests/ui/numbers-arithmetic/int-abs-overflow.rs +++ b/tests/ui/numbers-arithmetic/int-abs-overflow.rs @@ -1,6 +1,6 @@ //@ run-pass //@ compile-flags: -C overflow-checks=on -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind use std::thread; diff --git a/tests/ui/numbers-arithmetic/issue-8460.rs b/tests/ui/numbers-arithmetic/issue-8460.rs index 9d3044a7ca022..87867fdc93e41 100644 --- a/tests/ui/numbers-arithmetic/issue-8460.rs +++ b/tests/ui/numbers-arithmetic/issue-8460.rs @@ -1,6 +1,6 @@ //@ run-pass #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind #![feature(rustc_attrs)] diff --git a/tests/ui/panics/panic-handler-chain-update-hook.rs b/tests/ui/panics/panic-handler-chain-update-hook.rs index 1f8fe30cfd8c2..662ea9e978f70 100644 --- a/tests/ui/panics/panic-handler-chain-update-hook.rs +++ b/tests/ui/panics/panic-handler-chain-update-hook.rs @@ -2,7 +2,7 @@ //@ needs-unwind #![allow(stable_features)] -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(std_panic)] #![feature(panic_update_hook)] diff --git a/tests/ui/panics/panic-handler-flail-wildly.rs b/tests/ui/panics/panic-handler-flail-wildly.rs index 768c9d4c4c5ec..d42dfd68d9cf8 100644 --- a/tests/ui/panics/panic-handler-flail-wildly.rs +++ b/tests/ui/panics/panic-handler-flail-wildly.rs @@ -4,7 +4,7 @@ #![allow(stable_features)] #![allow(unused_must_use)] -//@ ignore-emscripten no threads support +//@ needs-threads #![feature(std_panic)] diff --git a/tests/ui/panics/panic-handler-set-twice.rs b/tests/ui/panics/panic-handler-set-twice.rs index 902e48b65414e..5f670d5f49298 100644 --- a/tests/ui/panics/panic-handler-set-twice.rs +++ b/tests/ui/panics/panic-handler-set-twice.rs @@ -5,7 +5,7 @@ #![feature(std_panic)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::atomic::{AtomicUsize, Ordering}; use std::panic; diff --git a/tests/ui/panics/panic-in-dtor-drops-fields.rs b/tests/ui/panics/panic-in-dtor-drops-fields.rs index 4d18dc0e05916..38eb6d0acfb81 100644 --- a/tests/ui/panics/panic-in-dtor-drops-fields.rs +++ b/tests/ui/panics/panic-in-dtor-drops-fields.rs @@ -3,7 +3,7 @@ #![allow(dead_code)] #![allow(non_upper_case_globals)] -//@ ignore-emscripten no threads support +//@ needs-threads use std::thread; diff --git a/tests/ui/panics/panic-recover-propagate.rs b/tests/ui/panics/panic-recover-propagate.rs index f8be86be19db6..ef6ae4fd7887d 100644 --- a/tests/ui/panics/panic-recover-propagate.rs +++ b/tests/ui/panics/panic-recover-propagate.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind -//@ ignore-emscripten no threads support +//@ needs-threads use std::sync::atomic::{AtomicUsize, Ordering}; use std::panic; diff --git a/tests/ui/process/process-sigpipe.rs b/tests/ui/process/process-sigpipe.rs index 9db130c26bd68..453e53379fc49 100644 --- a/tests/ui/process/process-sigpipe.rs +++ b/tests/ui/process/process-sigpipe.rs @@ -15,7 +15,7 @@ //@ ignore-vxworks no 'sh' //@ ignore-fuchsia no 'sh' -//@ ignore-emscripten No threads +//@ needs-threads //@ only-unix SIGPIPE is a unix feature use std::process; diff --git a/tests/ui/sepcomp/sepcomp-unwind.rs b/tests/ui/sepcomp/sepcomp-unwind.rs index 6a40b5ccc1247..8c25278bb7ec6 100644 --- a/tests/ui/sepcomp/sepcomp-unwind.rs +++ b/tests/ui/sepcomp/sepcomp-unwind.rs @@ -2,7 +2,7 @@ //@ needs-unwind #![allow(dead_code)] //@ compile-flags: -C codegen-units=3 -//@ ignore-emscripten no threads support +//@ needs-threads // Test unwinding through multiple compilation units. diff --git a/tests/ui/structs-enums/unit-like-struct-drop-run.rs b/tests/ui/structs-enums/unit-like-struct-drop-run.rs index 02d14265f3ef2..3d00871837cf8 100644 --- a/tests/ui/structs-enums/unit-like-struct-drop-run.rs +++ b/tests/ui/structs-enums/unit-like-struct-drop-run.rs @@ -1,6 +1,6 @@ //@ run-pass //@ needs-unwind -//@ ignore-emscripten no threads support +//@ needs-threads // Make sure the destructor is run for unit-like structs. diff --git a/tests/ui/test-attrs/terse.rs b/tests/ui/test-attrs/terse.rs index 6c3f29ed10f99..6e605f994f2a3 100644 --- a/tests/ui/test-attrs/terse.rs +++ b/tests/ui/test-attrs/terse.rs @@ -4,7 +4,7 @@ //@ check-run-results //@ exec-env:RUST_BACKTRACE=0 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind #[test] diff --git a/tests/ui/test-attrs/test-thread-capture.rs b/tests/ui/test-attrs/test-thread-capture.rs index c56f87f2ddac4..0a5b1e9816f2b 100644 --- a/tests/ui/test-attrs/test-thread-capture.rs +++ b/tests/ui/test-attrs/test-thread-capture.rs @@ -4,7 +4,7 @@ //@ check-run-results //@ exec-env:RUST_BACKTRACE=0 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind #[test] diff --git a/tests/ui/test-attrs/test-thread-nocapture.rs b/tests/ui/test-attrs/test-thread-nocapture.rs index 5b82e9b272076..ce5db7bf1c374 100644 --- a/tests/ui/test-attrs/test-thread-nocapture.rs +++ b/tests/ui/test-attrs/test-thread-nocapture.rs @@ -4,7 +4,7 @@ //@ check-run-results //@ exec-env:RUST_BACKTRACE=0 //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" -//@ ignore-emscripten no threads support +//@ needs-threads //@ needs-unwind #[test] From b2ad126a55b3c92a0e09d1749565376c3424ac01 Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Fri, 24 Jan 2025 01:07:17 +0300 Subject: [PATCH 28/41] Make `Vec::pop_if` a bit more presentable --- library/alloc/src/vec/mod.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index cd2afd7a47319..84e1449a50e81 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2511,9 +2511,9 @@ impl Vec { } } - /// Removes and returns the last element in a vector if the predicate + /// Removes and returns the last element from a vector if the predicate /// returns `true`, or [`None`] if the predicate returns false or the vector - /// is empty. + /// is empty (the predicate will not be called in that case). /// /// # Examples /// @@ -2528,12 +2528,9 @@ impl Vec { /// assert_eq!(vec.pop_if(pred), None); /// ``` #[unstable(feature = "vec_pop_if", issue = "122741")] - pub fn pop_if(&mut self, f: F) -> Option - where - F: FnOnce(&mut T) -> bool, - { + pub fn pop_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option { let last = self.last_mut()?; - if f(last) { self.pop() } else { None } + if predicate(last) { self.pop() } else { None } } /// Moves all the elements of `other` into `self`, leaving `other` empty. From 56c9267df3b4bcc673e121932763013135b3920c Mon Sep 17 00:00:00 2001 From: Henry Jiang Date: Thu, 23 Jan 2025 20:53:04 -0500 Subject: [PATCH 29/41] allow different sized load and store --- tests/assembly/powerpc64-struct-abi.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/assembly/powerpc64-struct-abi.rs b/tests/assembly/powerpc64-struct-abi.rs index 7052937acf661..db08a5148196d 100644 --- a/tests/assembly/powerpc64-struct-abi.rs +++ b/tests/assembly/powerpc64-struct-abi.rs @@ -50,9 +50,9 @@ struct ThreeU8s(u8, u8, u8); // CHECK-LABEL: read_large // aix: lwz [[REG1:.*]], 16(4) -// aix-NEXT: lxvd2x 0, 0, 4 +// aix-NEXT: lxv{{d2x|w4x}} 0, 0, 4 // aix-NEXT: stw [[REG1]], 16(3) -// aix-NEXT: stxvd2x 0, 0, 3 +// aix-NEXT: stxv{{d2x|w4x}} 0, 0, 3 // be: lwz [[REG1:.*]], 16(4) // be-NEXT: stw [[REG1]], 16(3) // be-NEXT: ld [[REG2:.*]], 8(4) @@ -118,8 +118,8 @@ extern "C" fn read_small(x: &ThreeU8s) -> ThreeU8s { // aix-NEXT: std 4, 56(1) // aix-NEXT: stw [[REG1]], 16(6) // aix-NEXT: addi [[REG2:.*]], 1, 48 -// aix-NEXT: lxvd2x 0, 0, [[REG2]] -// aix-NEXT: stxvd2x 0, 0, 6 +// aix-NEXT: lxv{{d2x|w4x}} 0, 0, [[REG2]] +// aix-NEXT: stxv{{d2x|w4x}} 0, 0, 6 // elf: std 3, 0(6) // be-NEXT: rldicl [[REG1:.*]], 5, 32, 32 // elf-NEXT: std 4, 8(6) From 8a6e06fecb4feea56b97e181e3ff93a7a3bea8d6 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 22 Jan 2025 20:35:33 +1100 Subject: [PATCH 30/41] Exclude `mir::coverage` types from TypeFoldable/TypeVisitable These types are unlikely to ever contain type information in the foreseeable future, so excluding them from TypeFoldable/TypeVisitable avoids some unhelpful derive boilerplate. --- compiler/rustc_middle/src/mir/coverage.rs | 28 +++++++++++------------ compiler/rustc_middle/src/mir/mod.rs | 4 ++++ compiler/rustc_middle/src/mir/syntax.rs | 9 +++++++- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index 65f51ae9d39c6..46534697e1d60 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -4,7 +4,7 @@ use std::fmt::{self, Debug, Formatter}; use rustc_index::IndexVec; use rustc_index::bit_set::DenseBitSet; -use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; +use rustc_macros::{HashStable, TyDecodable, TyEncodable}; use rustc_span::Span; rustc_index::newtype_index! { @@ -72,7 +72,7 @@ impl ConditionId { /// Enum that can hold a constant zero value, the ID of an physical coverage /// counter, or the ID of a coverage-counter expression. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub enum CovTerm { Zero, Counter(CounterId), @@ -89,7 +89,7 @@ impl Debug for CovTerm { } } -#[derive(Clone, PartialEq, TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(Clone, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)] pub enum CoverageKind { /// Marks a span that might otherwise not be represented in MIR, so that /// coverage instrumentation can associate it with its enclosing block/BCB. @@ -151,7 +151,7 @@ impl Debug for CoverageKind { } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, HashStable)] -#[derive(TyEncodable, TyDecodable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable)] pub enum Op { Subtract, Add, @@ -168,7 +168,7 @@ impl Op { } #[derive(Clone, Debug, PartialEq, Eq)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct Expression { pub lhs: CovTerm, pub op: Op, @@ -176,7 +176,7 @@ pub struct Expression { } #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub enum MappingKind { /// Associates a normal region of code with a counter/expression/zero. Code(CovTerm), @@ -208,7 +208,7 @@ impl MappingKind { } #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct Mapping { pub kind: MappingKind, pub span: Span, @@ -218,7 +218,7 @@ pub struct Mapping { /// to be used in conjunction with the individual coverage statements injected /// into the function's basic blocks. #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct FunctionCoverageInfo { pub function_source_hash: u64, pub body_span: Span, @@ -238,7 +238,7 @@ pub struct FunctionCoverageInfo { /// ("Hi" indicates that this is "high-level" information collected at the /// THIR/MIR boundary, before the MIR-based coverage instrumentation pass.) #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct CoverageInfoHi { /// 1 more than the highest-numbered [`CoverageKind::BlockMarker`] that was /// injected into the MIR body. This makes it possible to allocate per-ID @@ -252,7 +252,7 @@ pub struct CoverageInfoHi { } #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct BranchSpan { pub span: Span, pub true_marker: BlockMarkerId, @@ -260,7 +260,7 @@ pub struct BranchSpan { } #[derive(Copy, Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct ConditionInfo { pub condition_id: ConditionId, pub true_next_id: Option, @@ -268,7 +268,7 @@ pub struct ConditionInfo { } #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct MCDCBranchSpan { pub span: Span, pub condition_info: ConditionInfo, @@ -277,14 +277,14 @@ pub struct MCDCBranchSpan { } #[derive(Copy, Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct DecisionInfo { pub bitmap_idx: u32, pub num_conditions: u16, } #[derive(Clone, Debug)] -#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)] +#[derive(TyEncodable, TyDecodable, Hash, HashStable)] pub struct MCDCDecisionSpan { pub span: Span, pub end_markers: Vec, diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs index bbb8bdce4a0ca..0f3fca434eecf 100644 --- a/compiler/rustc_middle/src/mir/mod.rs +++ b/compiler/rustc_middle/src/mir/mod.rs @@ -358,6 +358,8 @@ pub struct Body<'tcx> { /// /// Only present if coverage is enabled and this function is eligible. /// Boxed to limit space overhead in non-coverage builds. + #[type_foldable(identity)] + #[type_visitable(ignore)] pub coverage_info_hi: Option>, /// Per-function coverage information added by the `InstrumentCoverage` @@ -366,6 +368,8 @@ pub struct Body<'tcx> { /// /// If `-Cinstrument-coverage` is not active, or if an individual function /// is not eligible for coverage, then this should always be `None`. + #[type_foldable(identity)] + #[type_visitable(ignore)] pub function_coverage_info: Option>, } diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 0c17a2e0fe5a1..29ae2e1bd6bc1 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -417,7 +417,14 @@ pub enum StatementKind<'tcx> { /// /// Interpreters and codegen backends that don't support coverage instrumentation /// can usually treat this as a no-op. - Coverage(CoverageKind), + Coverage( + // Coverage statements are unlikely to ever contain type information in + // the foreseeable future, so excluding them from TypeFoldable/TypeVisitable + // avoids some unhelpful derive boilerplate. + #[type_foldable(identity)] + #[type_visitable(ignore)] + CoverageKind, + ), /// Denotes a call to an intrinsic that does not require an unwind path and always returns. /// This avoids adding a new block and a terminator for simple intrinsics. From ec6fc95d6d808d0407a80e7e3e3b4d82f03a09d7 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 21 Jan 2025 13:59:01 +1100 Subject: [PATCH 31/41] coverage: Remove some dead code from MC/DC branch mapping conversion --- .../rustc_mir_transform/src/coverage/mod.rs | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coverage/mod.rs b/compiler/rustc_mir_transform/src/coverage/mod.rs index 19568735df76e..b8aa76a7dbe5d 100644 --- a/compiler/rustc_mir_transform/src/coverage/mod.rs +++ b/compiler/rustc_mir_transform/src/coverage/mod.rs @@ -180,7 +180,12 @@ fn create_mappings( )); for (decision, branches) in mcdc_mappings { - let num_conditions = branches.len() as u16; + // FIXME(#134497): Previously it was possible for some of these branch + // conversions to fail, in which case the remaining branches in the + // decision would be degraded to plain `MappingKind::Branch`. + // The changes in #134497 made that failure impossible, because the + // fallible step was deferred to codegen. But the corresponding code + // in codegen wasn't updated to detect the need for a degrade step. let conditions = branches .into_iter() .map( @@ -206,24 +211,13 @@ fn create_mappings( ) .collect::>(); - if conditions.len() == num_conditions as usize { - // LLVM requires end index for counter mapping regions. - let kind = MappingKind::MCDCDecision(DecisionInfo { - bitmap_idx: (decision.bitmap_idx + decision.num_test_vectors) as u32, - num_conditions, - }); - let span = decision.span; - mappings.extend(std::iter::once(Mapping { kind, span }).chain(conditions.into_iter())); - } else { - mappings.extend(conditions.into_iter().map(|mapping| { - let MappingKind::MCDCBranch { true_term, false_term, mcdc_params: _ } = - mapping.kind - else { - unreachable!("all mappings here are MCDCBranch as shown above"); - }; - Mapping { kind: MappingKind::Branch { true_term, false_term }, span: mapping.span } - })) - } + // LLVM requires end index for counter mapping regions. + let kind = MappingKind::MCDCDecision(DecisionInfo { + bitmap_idx: (decision.bitmap_idx + decision.num_test_vectors) as u32, + num_conditions: u16::try_from(conditions.len()).unwrap(), + }); + let span = decision.span; + mappings.extend(std::iter::once(Mapping { kind, span }).chain(conditions.into_iter())); } mappings From ff48331588e74dc381374d7f474d85adc4dd3b4b Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 22 Jan 2025 12:58:37 +1100 Subject: [PATCH 32/41] coverage: Make query `coverage_ids_info` return an Option This reflects the fact that we can't compute meaningful info for a function that wasn't instrumented and therefore doesn't have `function_coverage_info`. --- .../src/coverageinfo/mapgen/covfun.rs | 2 +- compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs | 8 +++++--- compiler/rustc_middle/src/query/mod.rs | 4 +++- compiler/rustc_mir_transform/src/coverage/query.rs | 12 +++--------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs index 5428d776f41e8..460a466461571 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs @@ -51,7 +51,7 @@ pub(crate) fn prepare_covfun_record<'tcx>( is_used: bool, ) -> Option> { let fn_cov_info = tcx.instance_mir(instance.def).function_coverage_info.as_deref()?; - let ids_info = tcx.coverage_ids_info(instance.def); + let ids_info = tcx.coverage_ids_info(instance.def)?; let expressions = prepare_expressions(fn_cov_info, ids_info, is_used); diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index 7311cd9d230c6..021108cd51caf 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -8,7 +8,6 @@ use rustc_codegen_ssa::traits::{ use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; use rustc_middle::mir::coverage::CoverageKind; use rustc_middle::ty::Instance; -use rustc_middle::ty::layout::HasTyCtxt; use tracing::{debug, instrument}; use crate::builder::Builder; @@ -147,6 +146,10 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> { debug!("function has a coverage statement but no coverage info"); return; }; + let Some(ids_info) = bx.tcx.coverage_ids_info(instance.def) else { + debug!("function has a coverage statement but no IDs info"); + return; + }; // Mark the instance as used in this CGU, for coverage purposes. // This includes functions that were not partitioned into this CGU, @@ -162,8 +165,7 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> { // be smaller than the number originally inserted by the instrumentor, // if some high-numbered counters were removed by MIR optimizations. // If so, LLVM's profiler runtime will use fewer physical counters. - let num_counters = - bx.tcx().coverage_ids_info(instance.def).num_counters_after_mir_opts(); + let num_counters = ids_info.num_counters_after_mir_opts(); assert!( num_counters as usize <= function_coverage_info.num_counters, "num_counters disagreement: query says {num_counters} but function info only has {}", diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 05ded71dbeb51..17e1fe35bba05 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -618,7 +618,9 @@ rustc_queries! { /// Summarizes coverage IDs inserted by the `InstrumentCoverage` MIR pass /// (for compiler option `-Cinstrument-coverage`), after MIR optimizations /// have had a chance to potentially remove some of them. - query coverage_ids_info(key: ty::InstanceKind<'tcx>) -> &'tcx mir::coverage::CoverageIdsInfo { + /// + /// Returns `None` for functions that were not instrumented. + query coverage_ids_info(key: ty::InstanceKind<'tcx>) -> Option<&'tcx mir::coverage::CoverageIdsInfo> { desc { |tcx| "retrieving coverage IDs info from MIR for `{}`", tcx.def_path_str(key.def_id()) } arena_cache } diff --git a/compiler/rustc_mir_transform/src/coverage/query.rs b/compiler/rustc_mir_transform/src/coverage/query.rs index 3e7cf8541c23a..5e7b46182dcfb 100644 --- a/compiler/rustc_mir_transform/src/coverage/query.rs +++ b/compiler/rustc_mir_transform/src/coverage/query.rs @@ -87,15 +87,9 @@ fn coverage_attr_on(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool { fn coverage_ids_info<'tcx>( tcx: TyCtxt<'tcx>, instance_def: ty::InstanceKind<'tcx>, -) -> CoverageIdsInfo { +) -> Option { let mir_body = tcx.instance_mir(instance_def); - - let Some(fn_cov_info) = mir_body.function_coverage_info.as_deref() else { - return CoverageIdsInfo { - counters_seen: DenseBitSet::new_empty(0), - zero_expressions: DenseBitSet::new_empty(0), - }; - }; + let fn_cov_info = mir_body.function_coverage_info.as_deref()?; let mut counters_seen = DenseBitSet::new_empty(fn_cov_info.num_counters); let mut expressions_seen = DenseBitSet::new_filled(fn_cov_info.expressions.len()); @@ -129,7 +123,7 @@ fn coverage_ids_info<'tcx>( let zero_expressions = identify_zero_expressions(fn_cov_info, &counters_seen, &expressions_seen); - CoverageIdsInfo { counters_seen, zero_expressions } + Some(CoverageIdsInfo { counters_seen, zero_expressions }) } fn all_coverage_in_mir_body<'a, 'tcx>( From 52c1bfa7bb2733e798ce56f39ca4c147f6dd79b2 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 21 Jan 2025 20:34:52 +1100 Subject: [PATCH 33/41] coverage: Simplify how counter terms are stored Using `SmallVec` here was fine when it was a module-private detail, but if we want to pass these terms across query boundaries then it's not worth the extra hassle. Replacing a method call with direct field access is slightly simpler. Using the name `counter_terms` is more consistent with other code that tries to maintain a distinction between (physical) "counters" and "expressions". --- .../src/coverage/counters.rs | 6 ++-- .../src/coverage/counters/node_flow.rs | 36 +++++++------------ .../src/coverage/counters/node_flow/tests.rs | 8 ++--- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs index 8d397f63cc7e0..08347c95c64b9 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters.rs @@ -81,11 +81,11 @@ fn transcribe_counters( let mut new = CoverageCounters::with_num_bcbs(bcb_needs_counter.domain_size()); for bcb in bcb_needs_counter.iter() { - // Our counter-creation algorithm doesn't guarantee that a counter - // expression starts or ends with a positive term, so partition the + // Our counter-creation algorithm doesn't guarantee that a node's list + // of terms starts or ends with a positive term, so partition the // counters into "positive" and "negative" lists for easier handling. let (mut pos, mut neg): (Vec<_>, Vec<_>) = - old.counter_expr(bcb).iter().partition_map(|&CounterTerm { node, op }| match op { + old.counter_terms[bcb].iter().partition_map(|&CounterTerm { node, op }| match op { Op::Add => Either::Left(node), Op::Subtract => Either::Right(node), }); diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs index 610498c6c0ec7..a022ae67c0b66 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs @@ -10,7 +10,6 @@ use rustc_data_structures::graph; use rustc_index::bit_set::DenseBitSet; use rustc_index::{Idx, IndexVec}; use rustc_middle::mir::coverage::Op; -use smallvec::SmallVec; use crate::coverage::counters::iter_nodes::IterNodes; use crate::coverage::counters::union_find::{FrozenUnionFind, UnionFind}; @@ -100,7 +99,7 @@ impl MergedNodeFlowGraph { builder.visit_node(node); } - NodeCounters { counter_exprs: builder.finish() } + NodeCounters { counter_terms: builder.finish() } } } @@ -108,18 +107,12 @@ impl MergedNodeFlowGraph { /// nodes of a graph. #[derive(Debug)] pub(crate) struct NodeCounters { - counter_exprs: IndexVec>, -} - -impl NodeCounters { /// For the given node, returns the finished list of terms that represent /// its physical counter or counter expression. Always non-empty. /// - /// If a node was given a physical counter, its "expression" will contain + /// If a node was given a physical counter, the term list will contain /// that counter as its sole element. - pub(crate) fn counter_expr(&self, this: Node) -> &[CounterTerm] { - self.counter_exprs[this].as_slice() - } + pub(crate) counter_terms: IndexVec>>, } #[derive(Debug)] @@ -146,9 +139,6 @@ pub(crate) struct CounterTerm { pub(crate) node: Node, } -/// Stores the list of counter terms that make up a node's counter expression. -type CounterExprVec = SmallVec<[CounterTerm; 2]>; - #[derive(Debug)] struct SpantreeBuilder<'a, Node: Idx> { graph: &'a MergedNodeFlowGraph, @@ -163,7 +153,7 @@ struct SpantreeBuilder<'a, Node: Idx> { yank_buffer: Vec, /// An in-progress counter expression for each node. Each expression is /// initially empty, and will be filled in as relevant nodes are visited. - counter_exprs: IndexVec>, + counter_terms: IndexVec>>, } impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { @@ -174,7 +164,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { is_unvisited: DenseBitSet::new_filled(num_nodes), span_edges: IndexVec::from_fn_n(|_| None, num_nodes), yank_buffer: vec![], - counter_exprs: IndexVec::from_fn_n(|_| SmallVec::new(), num_nodes), + counter_terms: IndexVec::from_fn_n(|_| vec![], num_nodes), } } @@ -268,8 +258,8 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { // `this_supernode`. // Instead of setting `this.measure = true` as in the original paper, - // we just add the node's ID to its own "expression". - self.counter_exprs[this].push(CounterTerm { node: this, op: Op::Add }); + // we just add the node's ID to its own list of terms. + self.counter_terms[this].push(CounterTerm { node: this, op: Op::Add }); // Walk the spantree from `this.successor` back to `this`. For each // spantree edge along the way, add this node's physical counter to @@ -279,7 +269,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { let &SpantreeEdge { is_reversed, claiming_node, span_parent } = self.span_edges[curr].as_ref().unwrap(); let op = if is_reversed { Op::Subtract } else { Op::Add }; - self.counter_exprs[claiming_node].push(CounterTerm { node: this, op }); + self.counter_terms[claiming_node].push(CounterTerm { node: this, op }); curr = span_parent; } @@ -288,8 +278,8 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { /// Asserts that all nodes have been visited, and returns the computed /// counter expressions (made up of physical counters) for each node. - fn finish(self) -> IndexVec> { - let Self { graph, is_unvisited, span_edges, yank_buffer: _, counter_exprs } = self; + fn finish(self) -> IndexVec>> { + let Self { graph, is_unvisited, span_edges, yank_buffer: _, counter_terms } = self; assert!(is_unvisited.is_empty(), "some nodes were never visited: {is_unvisited:?}"); debug_assert!( span_edges @@ -298,9 +288,9 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { "only supernodes can have a span edge", ); debug_assert!( - counter_exprs.iter().all(|expr| !expr.is_empty()), - "after visiting all nodes, every node should have a non-empty expression", + counter_terms.iter().all(|terms| !terms.is_empty()), + "after visiting all nodes, every node should have at least one term", ); - counter_exprs + counter_terms } } diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs index 9e7f754523d3d..4393e3b14933b 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs @@ -53,12 +53,12 @@ fn format_counter_expressions(counters: &NodeCounters) -> Vec>(); - expr.sort_by_key(|item| item.node.index()); - format!("[{node:?}]: {}", expr.into_iter().map(format_item).join(" ")) + let mut terms = counters.counter_terms[node].iter().collect::>(); + terms.sort_by_key(|item| item.node.index()); + format!("[{node:?}]: {}", terms.into_iter().map(format_item).join(" ")) }) .collect() } From 4b20a27ae0ed73dd0acc9815ad6b5cc2a4fac171 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Mon, 20 Jan 2025 23:00:08 +1100 Subject: [PATCH 34/41] coverage: Replace `FrozenUnionFind` with a plain IndexVec This dedicated type seemed like a good idea at the time, but if we want to store this information in a query result then a plainer data type is more convenient. --- .../src/coverage/counters/node_flow.rs | 14 +++++----- .../src/coverage/counters/union_find.rs | 28 +++---------------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs index a022ae67c0b66..7f767810f3117 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs @@ -12,7 +12,7 @@ use rustc_index::{Idx, IndexVec}; use rustc_middle::mir::coverage::Op; use crate::coverage::counters::iter_nodes::IterNodes; -use crate::coverage::counters::union_find::{FrozenUnionFind, UnionFind}; +use crate::coverage::counters::union_find::UnionFind; #[cfg(test)] mod tests; @@ -32,7 +32,7 @@ mod tests; pub(crate) struct MergedNodeFlowGraph { /// Maps each node to the supernode that contains it, indicated by some /// arbitrary "root" node that is part of that supernode. - supernodes: FrozenUnionFind, + supernodes: IndexVec, /// For each node, stores the single supernode that all of its successors /// have been merged into. /// @@ -66,11 +66,11 @@ impl MergedNodeFlowGraph { }) .collect::>(); - // Now that unification is complete, freeze the supernode forest, + // Now that unification is complete, take a snapshot of the supernode forest, // and resolve each arbitrarily-chosen successor to its canonical root. // (This avoids having to explicitly resolve them later.) - let supernodes = supernodes.freeze(); - let succ_supernodes = successors.into_iter().map(|succ| supernodes.find(succ)).collect(); + let supernodes = supernodes.snapshot(); + let succ_supernodes = successors.into_iter().map(|succ| supernodes[succ]).collect(); Self { supernodes, succ_supernodes } } @@ -80,7 +80,7 @@ impl MergedNodeFlowGraph { } fn is_supernode(&self, node: Node) -> bool { - self.supernodes.find(node) == node + self.supernodes[node] == node } /// Using the information in this merged graph, together with a given @@ -225,7 +225,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { // Get the supernode containing `this`, and make it the root of its // component of the spantree. - let this_supernode = self.graph.supernodes.find(this); + let this_supernode = self.graph.supernodes[this]; self.yank_to_spantree_root(this_supernode); // Get the supernode containing all of this's successors. diff --git a/compiler/rustc_mir_transform/src/coverage/counters/union_find.rs b/compiler/rustc_mir_transform/src/coverage/counters/union_find.rs index 2da4f5f5fce11..a826a953fa679 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/union_find.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/union_find.rs @@ -88,29 +88,9 @@ impl UnionFind { a } - /// Creates a snapshot of this disjoint-set forest that can no longer be - /// mutated, but can be queried without mutation. - pub(crate) fn freeze(&mut self) -> FrozenUnionFind { - // Just resolve each key to its actual root. - let roots = self.table.indices().map(|key| self.find(key)).collect(); - FrozenUnionFind { roots } - } -} - -/// Snapshot of a disjoint-set forest that can no longer be mutated, but can be -/// queried in O(1) time without mutation. -/// -/// This is really just a wrapper around a direct mapping from keys to roots, -/// but with a [`Self::find`] method that resembles [`UnionFind::find`]. -#[derive(Debug)] -pub(crate) struct FrozenUnionFind { - roots: IndexVec, -} - -impl FrozenUnionFind { - /// Returns the "root" key of the disjoint-set containing the given key. - /// If two keys have the same root, they belong to the same set. - pub(crate) fn find(&self, key: Key) -> Key { - self.roots[key] + /// Takes a "snapshot" of the current state of this disjoint-set forest, in + /// the form of a vector that directly maps each key to its current root. + pub(crate) fn snapshot(&mut self) -> IndexVec { + self.table.indices().map(|key| self.find(key)).collect() } } From 2bdc67a75e74924ac93df518e76b9ec1cf0a0857 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 21 Jan 2025 11:25:10 +1100 Subject: [PATCH 35/41] coverage: Treat the "merged node flow graph" as a plain data struct By removing all methods from this struct and treating it as a collection of data fields, we make it easier for a future PR to store that data in a query result, without having to move all of its methods into `rustc_middle`. --- .../src/coverage/counters.rs | 12 +- .../src/coverage/counters/node_flow.rs | 148 +++++++++--------- .../src/coverage/counters/node_flow/tests.rs | 12 +- 3 files changed, 89 insertions(+), 83 deletions(-) diff --git a/compiler/rustc_mir_transform/src/coverage/counters.rs b/compiler/rustc_mir_transform/src/coverage/counters.rs index 08347c95c64b9..50ebde3292ea7 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters.rs @@ -11,7 +11,9 @@ use rustc_middle::mir::coverage::{CounterId, CovTerm, Expression, ExpressionId, use crate::coverage::counters::balanced_flow::BalancedFlowGraph; use crate::coverage::counters::iter_nodes::IterNodes; -use crate::coverage::counters::node_flow::{CounterTerm, MergedNodeFlowGraph, NodeCounters}; +use crate::coverage::counters::node_flow::{ + CounterTerm, NodeCounters, make_node_counters, node_flow_data_for_balanced_graph, +}; use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph}; mod balanced_flow; @@ -27,12 +29,12 @@ pub(super) fn make_bcb_counters( ) -> CoverageCounters { // Create the derived graphs that are necessary for subsequent steps. let balanced_graph = BalancedFlowGraph::for_graph(graph, |n| !graph[n].is_out_summable); - let merged_graph = MergedNodeFlowGraph::for_balanced_graph(&balanced_graph); + let node_flow_data = node_flow_data_for_balanced_graph(&balanced_graph); // Use those graphs to determine which nodes get physical counters, and how // to compute the execution counts of other nodes from those counters. - let nodes = make_node_counter_priority_list(graph, balanced_graph); - let node_counters = merged_graph.make_node_counters(&nodes); + let priority_list = make_node_flow_priority_list(graph, balanced_graph); + let node_counters = make_node_counters(&node_flow_data, &priority_list); // Convert the counters into a form suitable for embedding into MIR. transcribe_counters(&node_counters, bcb_needs_counter) @@ -40,7 +42,7 @@ pub(super) fn make_bcb_counters( /// Arranges the nodes in `balanced_graph` into a list, such that earlier nodes /// take priority in being given a counter expression instead of a physical counter. -fn make_node_counter_priority_list( +fn make_node_flow_priority_list( graph: &CoverageGraph, balanced_graph: BalancedFlowGraph<&CoverageGraph>, ) -> Vec { diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs index 7f767810f3117..3647c88993746 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow.rs @@ -8,7 +8,7 @@ use rustc_data_structures::graph; use rustc_index::bit_set::DenseBitSet; -use rustc_index::{Idx, IndexVec}; +use rustc_index::{Idx, IndexSlice, IndexVec}; use rustc_middle::mir::coverage::Op; use crate::coverage::counters::iter_nodes::IterNodes; @@ -17,8 +17,8 @@ use crate::coverage::counters::union_find::UnionFind; #[cfg(test)] mod tests; -/// View of some underlying graph, in which each node's successors have been -/// merged into a single "supernode". +/// Data representing a view of some underlying graph, in which each node's +/// successors have been merged into a single "supernode". /// /// The resulting supernodes have no obvious meaning on their own. /// However, merging successor nodes means that a node's out-edges can all @@ -29,7 +29,7 @@ mod tests; /// in the merged graph, it becomes possible to analyze the original node flows /// using techniques for analyzing edge flows. #[derive(Debug)] -pub(crate) struct MergedNodeFlowGraph { +pub(crate) struct NodeFlowData { /// Maps each node to the supernode that contains it, indicated by some /// arbitrary "root" node that is part of that supernode. supernodes: IndexVec, @@ -41,66 +41,59 @@ pub(crate) struct MergedNodeFlowGraph { succ_supernodes: IndexVec, } -impl MergedNodeFlowGraph { - /// Creates a "merged" view of an underlying graph. - /// - /// The given graph is assumed to have [“balanced flow”](balanced-flow), - /// though it does not necessarily have to be a `BalancedFlowGraph`. - /// - /// [balanced-flow]: `crate::coverage::counters::balanced_flow::BalancedFlowGraph`. - pub(crate) fn for_balanced_graph(graph: G) -> Self - where - G: graph::DirectedGraph + graph::Successors, - { - let mut supernodes = UnionFind::::new(graph.num_nodes()); - - // For each node, merge its successors into a single supernode, and - // arbitrarily choose one of those successors to represent all of them. - let successors = graph - .iter_nodes() - .map(|node| { - graph - .successors(node) - .reduce(|a, b| supernodes.unify(a, b)) - .expect("each node in a balanced graph must have at least one out-edge") - }) - .collect::>(); - - // Now that unification is complete, take a snapshot of the supernode forest, - // and resolve each arbitrarily-chosen successor to its canonical root. - // (This avoids having to explicitly resolve them later.) - let supernodes = supernodes.snapshot(); - let succ_supernodes = successors.into_iter().map(|succ| supernodes[succ]).collect(); - - Self { supernodes, succ_supernodes } - } - - fn num_nodes(&self) -> usize { - self.succ_supernodes.len() - } +/// Creates a "merged" view of an underlying graph. +/// +/// The given graph is assumed to have [“balanced flow”](balanced-flow), +/// though it does not necessarily have to be a `BalancedFlowGraph`. +/// +/// [balanced-flow]: `crate::coverage::counters::balanced_flow::BalancedFlowGraph`. +pub(crate) fn node_flow_data_for_balanced_graph(graph: G) -> NodeFlowData +where + G: graph::Successors, +{ + let mut supernodes = UnionFind::::new(graph.num_nodes()); + + // For each node, merge its successors into a single supernode, and + // arbitrarily choose one of those successors to represent all of them. + let successors = graph + .iter_nodes() + .map(|node| { + graph + .successors(node) + .reduce(|a, b| supernodes.unify(a, b)) + .expect("each node in a balanced graph must have at least one out-edge") + }) + .collect::>(); + + // Now that unification is complete, take a snapshot of the supernode forest, + // and resolve each arbitrarily-chosen successor to its canonical root. + // (This avoids having to explicitly resolve them later.) + let supernodes = supernodes.snapshot(); + let succ_supernodes = successors.into_iter().map(|succ| supernodes[succ]).collect(); + + NodeFlowData { supernodes, succ_supernodes } +} - fn is_supernode(&self, node: Node) -> bool { - self.supernodes[node] == node +/// Uses the graph information in `node_flow_data`, together with a given +/// permutation of all nodes in the graph, to create physical counters and +/// counter expressions for each node in the underlying graph. +/// +/// The given list must contain exactly one copy of each node in the +/// underlying balanced-flow graph. The order of nodes is used as a hint to +/// influence counter allocation: +/// - Earlier nodes are more likely to receive counter expressions. +/// - Later nodes are more likely to receive physical counters. +pub(crate) fn make_node_counters( + node_flow_data: &NodeFlowData, + priority_list: &[Node], +) -> NodeCounters { + let mut builder = SpantreeBuilder::new(node_flow_data); + + for &node in priority_list { + builder.visit_node(node); } - /// Using the information in this merged graph, together with a given - /// permutation of all nodes in the graph, to create physical counters and - /// counter expressions for each node in the underlying graph. - /// - /// The given list must contain exactly one copy of each node in the - /// underlying balanced-flow graph. The order of nodes is used as a hint to - /// influence counter allocation: - /// - Earlier nodes are more likely to receive counter expressions. - /// - Later nodes are more likely to receive physical counters. - pub(crate) fn make_node_counters(&self, all_nodes_permutation: &[Node]) -> NodeCounters { - let mut builder = SpantreeBuilder::new(self); - - for &node in all_nodes_permutation { - builder.visit_node(node); - } - - NodeCounters { counter_terms: builder.finish() } - } + NodeCounters { counter_terms: builder.finish() } } /// End result of allocating physical counters and counter expressions for the @@ -141,7 +134,9 @@ pub(crate) struct CounterTerm { #[derive(Debug)] struct SpantreeBuilder<'a, Node: Idx> { - graph: &'a MergedNodeFlowGraph, + supernodes: &'a IndexSlice, + succ_supernodes: &'a IndexSlice, + is_unvisited: DenseBitSet, /// Links supernodes to each other, gradually forming a spanning tree of /// the merged-flow graph. @@ -157,10 +152,12 @@ struct SpantreeBuilder<'a, Node: Idx> { } impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { - fn new(graph: &'a MergedNodeFlowGraph) -> Self { - let num_nodes = graph.num_nodes(); + fn new(node_flow_data: &'a NodeFlowData) -> Self { + let NodeFlowData { supernodes, succ_supernodes } = node_flow_data; + let num_nodes = supernodes.len(); Self { - graph, + supernodes, + succ_supernodes, is_unvisited: DenseBitSet::new_filled(num_nodes), span_edges: IndexVec::from_fn_n(|_| None, num_nodes), yank_buffer: vec![], @@ -168,11 +165,15 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { } } + fn is_supernode(&self, node: Node) -> bool { + self.supernodes[node] == node + } + /// Given a supernode, finds the supernode that is the "root" of its /// spantree component. Two nodes that have the same spantree root are /// connected in the spantree. fn spantree_root(&self, this: Node) -> Node { - debug_assert!(self.graph.is_supernode(this)); + debug_assert!(self.is_supernode(this)); match self.span_edges[this] { None => this, @@ -183,7 +184,7 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { /// Rotates edges in the spantree so that `this` is the root of its /// spantree component. fn yank_to_spantree_root(&mut self, this: Node) { - debug_assert!(self.graph.is_supernode(this)); + debug_assert!(self.is_supernode(this)); // The rotation is done iteratively, by first traversing from `this` to // its root and storing the path in a buffer, and then traversing the @@ -225,12 +226,12 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { // Get the supernode containing `this`, and make it the root of its // component of the spantree. - let this_supernode = self.graph.supernodes[this]; + let this_supernode = self.supernodes[this]; self.yank_to_spantree_root(this_supernode); // Get the supernode containing all of this's successors. - let succ_supernode = self.graph.succ_supernodes[this]; - debug_assert!(self.graph.is_supernode(succ_supernode)); + let succ_supernode = self.succ_supernodes[this]; + debug_assert!(self.is_supernode(succ_supernode)); // If two supernodes are already connected in the spantree, they will // have the same spantree root. (Each supernode is connected to itself.) @@ -279,18 +280,19 @@ impl<'a, Node: Idx> SpantreeBuilder<'a, Node> { /// Asserts that all nodes have been visited, and returns the computed /// counter expressions (made up of physical counters) for each node. fn finish(self) -> IndexVec>> { - let Self { graph, is_unvisited, span_edges, yank_buffer: _, counter_terms } = self; + let Self { ref span_edges, ref is_unvisited, ref counter_terms, .. } = self; assert!(is_unvisited.is_empty(), "some nodes were never visited: {is_unvisited:?}"); debug_assert!( span_edges .iter_enumerated() - .all(|(node, span_edge)| { span_edge.is_some() <= graph.is_supernode(node) }), + .all(|(node, span_edge)| { span_edge.is_some() <= self.is_supernode(node) }), "only supernodes can have a span edge", ); debug_assert!( counter_terms.iter().all(|terms| !terms.is_empty()), "after visiting all nodes, every node should have at least one term", ); - counter_terms + + self.counter_terms } } diff --git a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs index 4393e3b14933b..b509a14514b79 100644 --- a/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs +++ b/compiler/rustc_mir_transform/src/coverage/counters/node_flow/tests.rs @@ -4,10 +4,12 @@ use rustc_data_structures::graph::vec_graph::VecGraph; use rustc_index::Idx; use rustc_middle::mir::coverage::Op; -use super::{CounterTerm, MergedNodeFlowGraph, NodeCounters}; +use crate::coverage::counters::node_flow::{ + CounterTerm, NodeCounters, NodeFlowData, make_node_counters, node_flow_data_for_balanced_graph, +}; -fn merged_node_flow_graph(graph: G) -> MergedNodeFlowGraph { - MergedNodeFlowGraph::for_balanced_graph(graph) +fn node_flow_data(graph: G) -> NodeFlowData { + node_flow_data_for_balanced_graph(graph) } fn make_graph(num_nodes: usize, edge_pairs: Vec<(Node, Node)>) -> VecGraph { @@ -30,8 +32,8 @@ fn example_driver() { (4, 0), ]); - let merged = merged_node_flow_graph(&graph); - let counters = merged.make_node_counters(&[3, 1, 2, 0, 4]); + let node_flow_data = node_flow_data(&graph); + let counters = make_node_counters(&node_flow_data, &[3, 1, 2, 0, 4]); assert_eq!(format_counter_expressions(&counters), &[ // (comment to force vertical formatting for clarity) From 7f10ab2c98371a166c5e04444d8ecbe9e62755f9 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 22 Jan 2025 21:11:53 +1100 Subject: [PATCH 36/41] coverage: Tweak FileCheck directives in a mir-opt test --- ...ument_coverage.bar.InstrumentCoverage.diff | 4 ++-- ...ment_coverage.main.InstrumentCoverage.diff | 12 ++++++------ tests/mir-opt/coverage/instrument_coverage.rs | 19 +++++++++++-------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff index 148ff86354b57..a91d88984a8a7 100644 --- a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff @@ -4,8 +4,8 @@ fn bar() -> bool { let mut _0: bool; -+ coverage body span: $DIR/instrument_coverage.rs:19:18: 21:2 (#0) -+ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:19:1: 21:2 (#0); ++ coverage body span: $DIR/instrument_coverage.rs:29:18: 31:2 (#0) ++ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:29:1: 31:2 (#0); + bb0: { + Coverage::CounterIncrement(0); diff --git a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff index fa09cf0b83f87..d7ea442518ebe 100644 --- a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff @@ -7,13 +7,13 @@ let mut _2: bool; let mut _3: !; -+ coverage body span: $DIR/instrument_coverage.rs:10:11: 16:2 (#0) ++ coverage body span: $DIR/instrument_coverage.rs:14:11: 20:2 (#0) + coverage ExpressionId(0) => Expression { lhs: Counter(1), op: Subtract, rhs: Counter(0) }; -+ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:10:1: 10:11 (#0); -+ coverage Code(Counter(1)) => $DIR/instrument_coverage.rs:12:12: 12:17 (#0); -+ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:13:13: 13:18 (#0); -+ coverage Code(Expression(0)) => $DIR/instrument_coverage.rs:14:10: 14:10 (#0); -+ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:16:2: 16:2 (#0); ++ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:14:1: 14:11 (#0); ++ coverage Code(Counter(1)) => $DIR/instrument_coverage.rs:16:12: 16:17 (#0); ++ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:17:13: 17:18 (#0); ++ coverage Code(Expression(0)) => $DIR/instrument_coverage.rs:18:10: 18:10 (#0); ++ coverage Code(Counter(0)) => $DIR/instrument_coverage.rs:20:2: 20:2 (#0); + bb0: { + Coverage::CounterIncrement(0); diff --git a/tests/mir-opt/coverage/instrument_coverage.rs b/tests/mir-opt/coverage/instrument_coverage.rs index beb88b607f974..c49786f961511 100644 --- a/tests/mir-opt/coverage/instrument_coverage.rs +++ b/tests/mir-opt/coverage/instrument_coverage.rs @@ -6,7 +6,11 @@ //@ compile-flags: -Cinstrument-coverage -Zno-profiler-runtime // EMIT_MIR instrument_coverage.main.InstrumentCoverage.diff -// EMIT_MIR instrument_coverage.bar.InstrumentCoverage.diff +// CHECK-LABEL: fn main() +// CHECK: coverage body span: +// CHECK: coverage Code(Counter({{[0-9]+}})) => +// CHECK: bb0: +// CHECK: Coverage::CounterIncrement fn main() { loop { if bar() { @@ -15,14 +19,13 @@ fn main() { } } +// EMIT_MIR instrument_coverage.bar.InstrumentCoverage.diff +// CHECK-LABEL: fn bar() +// CHECK: coverage body span: +// CHECK: coverage Code(Counter({{[0-9]+}})) => +// CHECK: bb0: +// CHECK: Coverage::CounterIncrement #[inline(never)] fn bar() -> bool { true } - -// CHECK: coverage ExpressionId({{[0-9]+}}) => -// CHECK-DAG: coverage Code(Counter({{[0-9]+}})) => -// CHECK-DAG: coverage Code(Expression({{[0-9]+}})) => -// CHECK: bb0: -// CHECK-DAG: Coverage::ExpressionUsed({{[0-9]+}}) -// CHECK-DAG: Coverage::CounterIncrement({{[0-9]+}}) From 5122c068cb7bd69023846cd198564af340dd7766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 23 Jan 2025 20:05:06 +0100 Subject: [PATCH 37/41] Refactor Python linting and formatting in tidy Unify the logic under a simple function to make it harder to cause mistakes. --- src/tools/tidy/src/ext_tool_checks.rs | 99 ++++++++++++++------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 6269d91c7ecc3..00c349a13a492 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -89,74 +89,45 @@ fn check_impl( if python_lint { eprintln!("linting python files"); - let mut cfg_args_ruff = cfg_args.clone(); - let mut file_args_ruff = file_args.clone(); - - let mut cfg_path = root_path.to_owned(); - cfg_path.extend(RUFF_CONFIG_PATH); - let mut cache_dir = outdir.to_owned(); - cache_dir.extend(RUFF_CACHE_PATH); - - cfg_args_ruff.extend([ - "--config".as_ref(), - cfg_path.as_os_str(), - "--cache-dir".as_ref(), - cache_dir.as_os_str(), - ]); - - if file_args_ruff.is_empty() { - file_args_ruff.push(root_path.as_os_str()); - } - - let mut args = merge_args(&cfg_args_ruff, &file_args_ruff); - args.insert(0, "check".as_ref()); - let res = py_runner(py_path.as_ref().unwrap(), true, None, "ruff", &args); + let py_path = py_path.as_ref().unwrap(); + let res = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &["check".as_ref()]); if res.is_err() && show_diff { eprintln!("\npython linting failed! Printing diff suggestions:"); - args.insert(1, "--diff".as_ref()); - let _ = py_runner(py_path.as_ref().unwrap(), true, None, "ruff", &args); + let _ = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &[ + "check".as_ref(), + "--diff".as_ref(), + ]); } // Rethrow error let _ = res?; } if python_fmt { - let mut cfg_args_ruff = cfg_args.clone(); - let mut file_args_ruff = file_args.clone(); - + let mut args: Vec<&OsStr> = vec!["format".as_ref()]; if bless { eprintln!("formatting python files"); } else { eprintln!("checking python file formatting"); - cfg_args_ruff.push("--check".as_ref()); + args.push("--check".as_ref()); } - let mut cfg_path = root_path.to_owned(); - cfg_path.extend(RUFF_CONFIG_PATH); - let mut cache_dir = outdir.to_owned(); - cache_dir.extend(RUFF_CACHE_PATH); - - cfg_args_ruff.extend(["--config".as_ref(), cfg_path.as_os_str()]); - - if file_args_ruff.is_empty() { - file_args_ruff.push(root_path.as_os_str()); - } + let py_path = py_path.as_ref().unwrap(); + let res = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &args); - let mut args = merge_args(&cfg_args_ruff, &file_args_ruff); - args.insert(0, "format".as_ref()); - let res = py_runner(py_path.as_ref().unwrap(), true, None, "ruff", &args); - - if res.is_err() && show_diff { - eprintln!("\npython formatting does not match! Printing diff:"); - - args.insert(0, "--diff".as_ref()); - let _ = py_runner(py_path.as_ref().unwrap(), true, None, "ruff", &args); - } if res.is_err() && !bless { + if show_diff { + eprintln!("\npython formatting does not match! Printing diff:"); + + let _ = run_ruff(root_path, outdir, py_path, &cfg_args, &file_args, &[ + "format".as_ref(), + "--diff".as_ref(), + ]); + } eprintln!("rerun tidy with `--extra-checks=py:fmt --bless` to reformat Python code"); } + // Rethrow error let _ = res?; } @@ -247,6 +218,38 @@ fn check_impl( Ok(()) } +fn run_ruff( + root_path: &Path, + outdir: &Path, + py_path: &Path, + cfg_args: &[&OsStr], + file_args: &[&OsStr], + ruff_args: &[&OsStr], +) -> Result<(), Error> { + let mut cfg_args_ruff = cfg_args.into_iter().copied().collect::>(); + let mut file_args_ruff = file_args.into_iter().copied().collect::>(); + + let mut cfg_path = root_path.to_owned(); + cfg_path.extend(RUFF_CONFIG_PATH); + let mut cache_dir = outdir.to_owned(); + cache_dir.extend(RUFF_CACHE_PATH); + + cfg_args_ruff.extend([ + "--config".as_ref(), + cfg_path.as_os_str(), + "--cache-dir".as_ref(), + cache_dir.as_os_str(), + ]); + + if file_args_ruff.is_empty() { + file_args_ruff.push(root_path.as_os_str()); + } + + let mut args: Vec<&OsStr> = ruff_args.into_iter().copied().collect(); + args.extend(merge_args(&cfg_args_ruff, &file_args_ruff)); + py_runner(py_path, true, None, "ruff", &args) +} + /// Helper to create `cfg1 cfg2 -- file1 file2` output fn merge_args<'a>(cfg_args: &[&'a OsStr], file_args: &[&'a OsStr]) -> Vec<&'a OsStr> { let mut args = cfg_args.to_owned(); From cd7be9295ca444bcc550f90213da412d3ffbe219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 23 Jan 2025 20:09:13 +0100 Subject: [PATCH 38/41] Document Python formatting and linting in the rustc-dev-guide --- src/doc/rustc-dev-guide/src/conventions.md | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/doc/rustc-dev-guide/src/conventions.md b/src/doc/rustc-dev-guide/src/conventions.md index 37af8121cd1dd..4010e90821f9b 100644 --- a/src/doc/rustc-dev-guide/src/conventions.md +++ b/src/doc/rustc-dev-guide/src/conventions.md @@ -1,4 +1,4 @@ -This file offers some tips on the coding conventions for rustc. This +This file offers some tips on the coding conventions for rustc. This chapter covers [formatting](#formatting), [coding for correctness](#cc), [using crates from crates.io](#cio), and some tips on [structuring your PR for easy review](#er). @@ -25,6 +25,7 @@ pass the `--edition=2021` argument yourself when c `rustfmt` directly. [fmt]: https://github.com/rust-dev-tools/fmt-rfcs + [`rustfmt`]:https://github.com/rust-lang/rustfmt ## Formatting C++ code @@ -40,6 +41,26 @@ When modifying that code, use this command to format it: This uses a pinned version of `clang-format`, to avoid relying on the local environment. +## Formatting and linting Python code + +The Rust repository contains quite a lof of Python code. We try to keep +it both linted and formatted by the [ruff][ruff] tool. + +When modifying Python code, use this command to format it: +```sh +./x test tidy --extra-checks=py:fmt --bless +``` + +and the following command to run lints: +```sh +./x test tidy --extra-checks=py:lint +``` + +This uses a pinned version of `ruff`, to avoid relying on the local +environment. + +[ruff]: https://github.com/astral-sh/ruff + @@ -84,7 +105,7 @@ Using `_` in a match is convenient, but it means that when new variants are added to the enum, they may not get handled correctly. Ask yourself: if a new variant were added to this enum, what's the chance that it would want to use the `_` code, versus having some -other treatment? Unless the answer is "low", then prefer an +other treatment? Unless the answer is "low", then prefer an exhaustive match. (The same advice applies to `if let` and `while let`, which are effectively tests for a single variant.) @@ -124,7 +145,7 @@ See the [crates.io dependencies][crates] section. # How to structure your PR How you prepare the commits in your PR can make a big difference for the -reviewer. Here are some tips. +reviewer. Here are some tips. **Isolate "pure refactorings" into their own commit.** For example, if you rename a method, then put that rename into its own commit, along @@ -165,4 +186,5 @@ to the compiler. crate-related, often the spelling is changed to `krate`. [tcx]: ./ty.md + [crates]: ./crates-io.md From 9a85104d6753ff00a1ecd42de5e8f5648263cc35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 23 Jan 2025 20:26:06 +0100 Subject: [PATCH 39/41] Make virtualenv creation in tidy more robust --- src/tools/tidy/src/ext_tool_checks.rs | 30 +++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 00c349a13a492..6eef1c9648b61 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -360,22 +360,40 @@ fn create_venv_at_path(path: &Path) -> Result<(), Error> { return Err(ret); }; - eprintln!("creating virtual environment at '{}' using '{sys_py}'", path.display()); - let out = Command::new(sys_py).args(["-m", "virtualenv"]).arg(path).output().unwrap(); + // First try venv, which should be packaged in the Python3 standard library. + // If it is not available, try to create the virtual environment using the + // virtualenv package. + if try_create_venv(sys_py, path, "venv").is_ok() { + return Ok(()); + } + try_create_venv(sys_py, path, "virtualenv") +} + +fn try_create_venv(python: &str, path: &Path, module: &str) -> Result<(), Error> { + eprintln!( + "creating virtual environment at '{}' using '{python}' and '{module}'", + path.display() + ); + let out = Command::new(python).args(["-m", module]).arg(path).output().unwrap(); if out.status.success() { return Ok(()); } let stderr = String::from_utf8_lossy(&out.stderr); - let err = if stderr.contains("No module named virtualenv") { + let err = if stderr.contains(&format!("No module named {module}")) { Error::Generic(format!( - "virtualenv not found: you may need to install it \ - (`{sys_py} -m pip install virtualenv`)" + r#"{module} not found: you may need to install it: +`{python} -m pip install {module}` +If you see an error about "externally managed environment" when running the above command, +either install `{module}` using your system package manager +(e.g. `sudo apt-get install {python}-{module}`) or create a virtual environment manually, install +`{module}` in it and then activate it before running tidy. +"# )) } else { Error::Generic(format!( - "failed to create venv at '{}' using {sys_py}: {stderr}", + "failed to create venv at '{}' using {python} -m {module}: {stderr}", path.display() )) }; From 0f334ec5dad79667909bfad40d84c0a2a74b3a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Thu, 23 Jan 2025 20:27:01 +0100 Subject: [PATCH 40/41] Update Python 3 versions in tidy Python 3.13 has been released a few months ago. --- src/tools/tidy/src/ext_tool_checks.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tools/tidy/src/ext_tool_checks.rs b/src/tools/tidy/src/ext_tool_checks.rs index 6eef1c9648b61..2a4cff1d12ed5 100644 --- a/src/tools/tidy/src/ext_tool_checks.rs +++ b/src/tools/tidy/src/ext_tool_checks.rs @@ -324,8 +324,16 @@ fn get_or_create_venv(venv_path: &Path, src_reqs_path: &Path) -> Result Result<(), Error> { /// Preferred python versions in order. Newest to oldest then current /// development versions - const TRY_PY: &[&str] = - &["python3.11", "python3.10", "python3.9", "python3", "python", "python3.12", "python3.13"]; + const TRY_PY: &[&str] = &[ + "python3.13", + "python3.12", + "python3.11", + "python3.10", + "python3.9", + "python3", + "python", + "python3.14", + ]; let mut sys_py = None; let mut found = Vec::new(); From 3c3961ba69c6acb9edc1394e6bd7f65fd0b21946 Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Fri, 24 Jan 2025 10:45:39 +0100 Subject: [PATCH 41/41] Doc difference between extend and extend_from_slice fixes #97119 --- library/alloc/src/vec/mod.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index cd2afd7a47319..a2909f6d61f6e 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3016,10 +3016,9 @@ impl Vec { /// Iterates over the slice `other`, clones each element, and then appends /// it to this `Vec`. The `other` slice is traversed in-order. /// - /// Note that this function is same as [`extend`] except that it is - /// specialized to work with slices instead. If and when Rust gets - /// specialization this function will likely be deprecated (but still - /// available). + /// Note that this function is the same as [`extend`], + /// except that it also works with slice elements that are Clone but not Copy. + /// If Rust gets specialization this function may be deprecated. /// /// # Examples ///