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 33// the fix to suggested paths is not platform-dependent and will apply on
44// these platforms also.
55
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;`)
98
109use std:: process:: Command ;
1110// use std::os::unix::process::CommandExt;
1211
1312fn main ( ) {
14- Command :: new ( "echo" ) . arg ( "hello" ) . exec ( ) ;
13+ let _ = Command :: new ( "echo" ) . arg ( "hello" ) . exec ( ) ;
1514//~^ ERROR no method named `exec`
1615}
Original file line number Diff line number Diff line change 11error[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
33 |
4- LL | Command::new("echo").arg("hello").exec();
5- | ^^^^
4+ LL | let _ = Command::new("echo").arg("hello").exec();
5+ | ^^^^
66 |
77 = help: items from traits can only be used if the trait is in scope
88help: 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