Closed
Description
I tried this code:
#![allow(unused)]
#![warn(rust_2021_prelude_collisions)]
pub mod my_try {
pub trait MyTry: Sized {
fn try_from<V>(value: V) -> Result<Self, ()>;
}
}
use my_try::*;
struct Foo;
struct Bar;
impl MyTry for Bar {
fn try_from<V>(value: V) -> Result<Self, ()> {
unimplemented!()
}
}
pub fn foo() {
let x = Foo;
let y = Bar::try_from(x);
}
This has the suggestion to replace the code with:
let y = <Bar as >::try_from(x);
which is invalid syntax. The suggestion should be something like:
let y = <Bar as MyTry>::try_from(x);
Found in 2021 crater run for:
Meta
rustc --version --verbose
:
rustc 1.56.0-nightly (5eacec9ec 2021-08-28)
binary: rustc
commit-hash: 5eacec9ec7e112a0de1011519a57c45586d58414
commit-date: 2021-08-28
host: x86_64-apple-darwin
release: 1.56.0-nightly
LLVM version: 13.0.0