My recent trouble:
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::os::ext::ffi::OsStringExt;
|
So I happily put use std::os::ext::ffi::OsStringExt;
where needed only to get this error message:
error[E0433]: failed to resolve. Could not find `ext` in `os`
--> src/lib.rs:37:22
|
37 | use std::os::ext::ffi::OsStringExt;
| ^^^ Could not find `ext` in `os`
warning: unused import: `std::os::ext::ffi::OsStringExt`
--> src/lib.rs:37:13
|
37 | use std::os::ext::ffi::OsStringExt;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
error[E0599]: no function or associated item named `from_vec` found for type `std::ffi::OsString` in the current scope
...
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::os::ext::ffi::OsStringExt;
|
Which is quite ridiculous.
This was confusing too:
error[E0308]: mismatched types
--> src/lib.rs:26:25
|
26 | Err(_) => true,
| ^^^^^^ expected struct `std::vec::Vec`, found enum `std::result::Result`
|
= note: expected type `std::vec::Vec<u8>`
found type `std::result::Result<_, _>`
I don’t remember how I solved this (I found it in terminal output), so I have no idea what the problem was.
Also, sometimes compiler prints out helpful “did you mean?” message and sometimes it doesn’t even if it probably could if it tried harder (looking into more modules). Ideally I could write use Whatever
and get the list of all valid imports.