From f77dd5ac9371897d30dd3a8c43023e14f86dd0bf Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 6 Jul 2021 13:51:25 +0000 Subject: [PATCH] Add test for trait check in prelude collision lint. --- .../future-prelude-collision-unneeded.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs b/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs index 4be82056ad5..8b3b7e74a7f 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs +++ b/src/test/ui/rust-2021/future-prelude-collision-unneeded.rs @@ -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); }