From ee7b649d445b9c33486f3b5c3bef29bdb28124bc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 16 Jun 2021 22:54:57 +0300 Subject: [PATCH] internal: switch some tests to minicore --- crates/hir_ty/src/tests/traits.rs | 16 +--------------- crates/test_utils/src/minicore.rs | 7 +++++++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 065cca74f7e..22e0bfc49e3 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -1492,7 +1492,7 @@ fn test>(x: T, y: impl Trait) { fn impl_trait_assoc_binding_projection_bug() { check_types( r#" -//- /main.rs crate:main deps:std +//- minicore: iterator pub trait Language { type Kind; } @@ -1512,20 +1512,6 @@ fn api_walkthrough() { node.clone(); } //^ {unknown} } - -//- /std.rs crate:std -#[prelude_import] use iter::*; -mod iter { - trait IntoIterator { - type Item; - } - trait Iterator { - type Item; - } - impl IntoIterator for T { - type Item = ::Item; - } -} "#, ); } diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index 011d460beb5..a861ff09c94 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs @@ -227,6 +227,13 @@ pub trait IntoIterator { #[lang = "into_iter"] fn into_iter(self) -> Self::IntoIter; } + impl IntoIterator for I { + type Item = I::Item; + type IntoIter = I; + fn into_iter(self) -> I { + self + } + } } pub use self::collect::IntoIterator; pub use self::iterator::Iterator;