File tree Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change
1
+ // This test ignores some platforms as the particular extension trait used
2
+ // to demonstrate the issue is only available on unix. This is fine as
3
+ // the fix to suggested paths is not platform-dependent and will apply on
4
+ // these platforms also.
5
+
6
+ //@ run-rustfix
7
+ //@ only-unix (the diagnostics is influenced by `use std::os::unix::process::CommandExt;`)
8
+
9
+ use std::os::unix::process::CommandExt;
10
+ use std::process::Command;
11
+ // use std::os::unix::process::CommandExt;
12
+
13
+ fn main() {
14
+ let _ = Command::new("echo").arg("hello").exec();
15
+ //~^ ERROR no method named `exec`
16
+ }
Original file line number Diff line number Diff line change 3
3
// the fix to suggested paths is not platform-dependent and will apply on
4
4
// these platforms also.
5
5
6
- //@ ignore-windows
7
- //@ ignore-wasm32 no processes
8
- //@ ignore-sgx no processes
6
+ //@ run-rustfix
7
+ //@ only-unix (the diagnostics is influenced by `use std::os::unix::process::CommandExt;`)
9
8
10
9
use std:: process:: Command ;
11
10
// use std::os::unix::process::CommandExt;
12
11
13
12
fn main ( ) {
14
- Command :: new ( "echo" ) . arg ( "hello" ) . exec ( ) ;
13
+ let _ = Command :: new ( "echo" ) . arg ( "hello" ) . exec ( ) ;
15
14
//~^ ERROR no method named `exec`
16
15
}
Original file line number Diff line number Diff line change 1
1
error[E0599]: no method named `exec` found for mutable reference `&mut Command` in the current scope
2
- --> $DIR/issue-39175.rs:14:39
2
+ --> $DIR/issue-39175.rs:13:47
3
3
|
4
- LL | Command::new("echo").arg("hello").exec();
5
- | ^^^^
4
+ LL | let _ = Command::new("echo").arg("hello").exec();
5
+ | ^^^^
6
6
|
7
7
= help: items from traits can only be used if the trait is in scope
8
8
help: there is a method `pre_exec` with a similar name, but with different arguments
You can’t perform that action at this time.
0 commit comments