diff options
author | Aleksey Kladov <[email protected]> | 2021-06-16 20:54:57 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-16 20:54:57 +0100 |
commit | ee7b649d445b9c33486f3b5c3bef29bdb28124bc (patch) | |
tree | b16bda6464bfac9aefcfb74cd94c00e7c20490e0 /crates | |
parent | 604267088c9ef6afa021807b437dab22d72dfc99 (diff) |
internal: switch some tests to minicore
Diffstat (limited to 'crates')
-rw-r--r-- | crates/hir_ty/src/tests/traits.rs | 16 | ||||
-rw-r--r-- | 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 065cca74f..22e0bfc49 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs | |||
@@ -1492,7 +1492,7 @@ fn test<T: Trait<Type = u32>>(x: T, y: impl Trait<Type = i64>) { | |||
1492 | fn impl_trait_assoc_binding_projection_bug() { | 1492 | fn impl_trait_assoc_binding_projection_bug() { |
1493 | check_types( | 1493 | check_types( |
1494 | r#" | 1494 | r#" |
1495 | //- /main.rs crate:main deps:std | 1495 | //- minicore: iterator |
1496 | pub trait Language { | 1496 | pub trait Language { |
1497 | type Kind; | 1497 | type Kind; |
1498 | } | 1498 | } |
@@ -1512,20 +1512,6 @@ fn api_walkthrough() { | |||
1512 | node.clone(); | 1512 | node.clone(); |
1513 | } //^ {unknown} | 1513 | } //^ {unknown} |
1514 | } | 1514 | } |
1515 | |||
1516 | //- /std.rs crate:std | ||
1517 | #[prelude_import] use iter::*; | ||
1518 | mod iter { | ||
1519 | trait IntoIterator { | ||
1520 | type Item; | ||
1521 | } | ||
1522 | trait Iterator { | ||
1523 | type Item; | ||
1524 | } | ||
1525 | impl<T: Iterator> IntoIterator for T { | ||
1526 | type Item = <T as Iterator>::Item; | ||
1527 | } | ||
1528 | } | ||
1529 | "#, | 1515 | "#, |
1530 | ); | 1516 | ); |
1531 | } | 1517 | } |
diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index 011d460be..a861ff09c 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs | |||
@@ -227,6 +227,13 @@ pub mod iter { | |||
227 | #[lang = "into_iter"] | 227 | #[lang = "into_iter"] |
228 | fn into_iter(self) -> Self::IntoIter; | 228 | fn into_iter(self) -> Self::IntoIter; |
229 | } | 229 | } |
230 | impl<I: Iterator> IntoIterator for I { | ||
231 | type Item = I::Item; | ||
232 | type IntoIter = I; | ||
233 | fn into_iter(self) -> I { | ||
234 | self | ||
235 | } | ||
236 | } | ||
230 | } | 237 | } |
231 | pub use self::collect::IntoIterator; | 238 | pub use self::collect::IntoIterator; |
232 | pub use self::iterator::Iterator; | 239 | pub use self::iterator::Iterator; |