When I do try!(file.metadata()).mtime() without MetadataExt in scope, the compiler suggests that I import std::sys::ext::fs::MetadataExt. It does not suggest any other candidates:
<anon>:17:15: 17:22 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:
<anon>:17:15: 17:22 help: candidate #1: use `std::sys::ext::fs::MetadataExt`
error: aborting due to previous error
But that trait is private, so a use of it will not work.
It turns out that I can do use std::os::unix::fs::MetadataExt; (which I assume is an alternative path to the same trait), and that path is publicly accessible.
playpen demo: https://play.rust-lang.org/?gist=557a8c49fbf072db1033&version=nightly
(This is related to #25358 but is not a dupe of it; that bug is about the suggestion of traits to implement, while this bug is about the suggestion of traits to pull into scope via use)
When I do
try!(file.metadata()).mtime()withoutMetadataExtin scope, the compiler suggests that I importstd::sys::ext::fs::MetadataExt. It does not suggest any other candidates:But that trait is private, so a
useof it will not work.It turns out that I can do
use std::os::unix::fs::MetadataExt;(which I assume is an alternative path to the same trait), and that path is publicly accessible.playpen demo: https://play.rust-lang.org/?gist=557a8c49fbf072db1033&version=nightly
(This is related to #25358 but is not a dupe of it; that bug is about the suggestion of traits to implement, while this bug is about the suggestion of traits to pull into scope via
use)