-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help suggests non-existent package std::os::ext::process::CommandExt #39175
Comments
The path is created at |
Other modules show this problem: error[E0432]: unresolved import `std::os::ext::ffi::OsStrExt`
--> src/main.rs:44:5
|
44 | use std::os::ext::ffi::OsStrExt;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `ext` in `os`
error: no method named `as_bytes` found for type `&std::ffi::OsStr` in the current scope
--> src/main.rs:51:41
|
51 | .filter(|n| *(n.unwrap().file_name()).as_bytes() == b".dsc") {
| ^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope; the following trait is implemented but not in scope, perhaps add a `use` for it:
= help: candidate #1: `use std::os::ext::ffi::OsStrExt;`
error: aborting due to previous error Thanks |
Nominating for compiler team. If there's something we can do to fix this, that would be great -- I imagine most beginners hit this fairly often, and even experienced users. I don't know what the underlying problem here is, though, so perhaps it's very hard to fix. |
triage: P-medium This would indeed be good to fix but doesn't rise to the urgency of P-high. The underlying problem is that we often print the "true path" but we should be printing the "visible" path. Not sure who would be best equipped to plan a solution to this -- @jseyfried ? |
Just ran into this with use std::ffi::OsStr;
use std::os::ext::ffi::OsStrExt;
fn main() {
OsStr::new("1234").encode_wide();
} This gives me the following absurd pair of errors:
|
I likewise get this issue with the following snippet: use std::ffi::OsString;
fn main() {
let _ = OsString::from_wide(b"a\x00b\x00c\x00");
}
Relevant
|
Help suggests non-existent package std::os::ext::process::CommandExt Fixes rust-lang#39175.
Help suggests non-existent package std::os::ext::process::CommandExt Fixes #39175.
Normally rustc will suggest what
use
line to add, but for CommandExt its suggestion is impossible.testcase.rs:
Compile with
rustc testcase.rs
. Rust says it can't findexec
and explains:But the suggested trait doesn't exist; adding the suggested line gives an unresolved import error: "Could not find
ext
inos
"Rust should instead suggest the correct trait,
std::os::unix::process::CommandExt
.Tested with (
rustc --version --verbose
):Fedora 25's packaged rust:
And a recent source build:
(The formatting of the error messages differs between versions but the errors are the same.)
The text was updated successfully, but these errors were encountered: