-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Closed
Description
The following program:
use std::process::Command;
fn main() {
Command::new("true")
.before_exec(|| {})
.status().unwrap();
}shows an error saying
error[E0599]: no method named `before_exec` found for type `std::process::Command` in the current scope
--> src/main.rs:5:10
|
5 | .before_exec(|| {})
| ^^^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::os::ext::process::CommandExt;
|
However, following that suggestions leads to a program that errors saying
error[E0433]: failed to resolve. Could not find `ext` in `os`
--> src/main.rs:2:14
|
2 | use std::os::ext::process::CommandExt;
| ^^^ Could not find `ext` in `os`
warning: unused import: `std::os::ext::process::CommandExt`
--> src/main.rs:2:5
|
2 | use std::os::ext::process::CommandExt;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error[E0599]: no method named `before_exec` found for type `std::process::Command` in the current scope
--> src/main.rs:6:10
|
6 | .before_exec(|| {})
| ^^^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::os::ext::process::CommandExt;
|
Metadata
Metadata
Assignees
Labels
No labels