Add test for trait check in prelude collision lint.

This commit is contained in:
Mara Bos 2021-07-06 13:51:25 +00:00
parent 60535441c8
commit f77dd5ac93

View File

@ -11,8 +11,23 @@ fn try_into(self) -> S {
}
}
// See https://github.com/rust-lang/rust/issues/86633
struct X;
trait Hey {
fn from_iter(_: i32) -> Self;
}
impl Hey for X {
fn from_iter(_: i32) -> Self {
X
}
}
fn main() {
// See https://github.com/rust-lang/rust/issues/86633
let s = S;
let s2 = s.try_into();
// See https://github.com/rust-lang/rust/issues/86902
X::from_iter(1);
}