about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/issues/issue-39175.fixed16
-rw-r--r--tests/ui/issues/issue-39175.rs7
-rw-r--r--tests/ui/issues/issue-39175.stderr6
3 files changed, 22 insertions, 7 deletions
diff --git a/tests/ui/issues/issue-39175.fixed b/tests/ui/issues/issue-39175.fixed
new file mode 100644
index 00000000000..1f2b5b8b0ce
--- /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 7b801317b71..a7e6134b2d9 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 bbe8badb652..163b4989aae 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