Open
Description
Background
Within std I'm attempting to add an unstable type to a trait (see here for the impl). However, after compiling the new std, the unstable type is shown in error messages even without the feature enabled.
Code
struct Biscuits;
fn main() {
std::fs::metadata(&Biscuits).unwrap();
}
Current Output
error[E0277]: the trait bound `Biscuits: AsRef<Path>` is not satisfied
--> temp.rs:3:21
|
3 | std::fs::metadata(&Biscuits).unwrap();
| ----------------- ^^^^^^^^ the trait `AsRef<Path>` is not implemented for `Biscuits`
| |
| required by a bound introduced by this call
|
= help: the trait `AsPath` is implemented for `&NativePath`
= note: required for `&Biscuits` to implement `AsRef<Path>`
= note: required for `&Biscuits` to implement `AsPath`
note: required by a bound in `std::fs::metadata`
--> R:\rust\library\std\src\fs.rs:1848:20
|
1848 | pub fn metadata<P: AsPath>(path: P) -> io::Result<Metadata> {
| ^^^^^^ required by this bound in `metadata`
Desired Output
Remove the first help:
message.
error[E0277]: the trait bound `Biscuits: AsRef<Path>` is not satisfied
--> temp.rs:3:21
|
3 | std::fs::metadata(&Biscuits).unwrap();
| ----------------- ^^^^^^^^ the trait `AsRef<Path>` is not implemented for `Biscuits`
| |
| required by a bound introduced by this call
|
= note: required for `&Biscuits` to implement `AsRef<Path>`
= note: required for `&Biscuits` to implement `AsPath`
note: required by a bound in `std::fs::metadata`
--> R:\rust\library\std\src\fs.rs:1848:20
|
1848 | pub fn metadata<P: AsPath>(path: P) -> io::Result<Metadata> {
| ^^^^^^ required by this bound in `metadata`