diff options
Diffstat (limited to 'crates/hir_ty/src/tests/regression.rs')
-rw-r--r-- | crates/hir_ty/src/tests/regression.rs | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index 1e0233b55..abd9c385a 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs | |||
@@ -975,37 +975,33 @@ fn param_overrides_fn() { | |||
975 | fn lifetime_from_chalk_during_deref() { | 975 | fn lifetime_from_chalk_during_deref() { |
976 | check_types( | 976 | check_types( |
977 | r#" | 977 | r#" |
978 | #[lang = "deref"] | 978 | //- minicore: deref |
979 | pub trait Deref { | 979 | struct Box<T: ?Sized> {} |
980 | type Target; | 980 | impl<T> core::ops::Deref for Box<T> { |
981 | } | 981 | type Target = T; |
982 | |||
983 | struct Box<T: ?Sized> {} | ||
984 | impl<T> Deref for Box<T> { | ||
985 | type Target = T; | ||
986 | 982 | ||
987 | fn deref(&self) -> &Self::Target { | 983 | fn deref(&self) -> &Self::Target { |
988 | loop {} | 984 | loop {} |
989 | } | 985 | } |
990 | } | 986 | } |
991 | 987 | ||
992 | trait Iterator { | 988 | trait Iterator { |
993 | type Item; | 989 | type Item; |
994 | } | 990 | } |
995 | 991 | ||
996 | pub struct Iter<'a, T: 'a> { | 992 | pub struct Iter<'a, T: 'a> { |
997 | inner: Box<dyn IterTrait<'a, T, Item = &'a T> + 'a>, | 993 | inner: Box<dyn IterTrait<'a, T, Item = &'a T> + 'a>, |
998 | } | 994 | } |
999 | 995 | ||
1000 | trait IterTrait<'a, T: 'a>: Iterator<Item = &'a T> { | 996 | trait IterTrait<'a, T: 'a>: Iterator<Item = &'a T> { |
1001 | fn clone_box(&self); | 997 | fn clone_box(&self); |
1002 | } | 998 | } |
1003 | 999 | ||
1004 | fn clone_iter<T>(s: Iter<T>) { | 1000 | fn clone_iter<T>(s: Iter<T>) { |
1005 | s.inner.clone_box(); | 1001 | s.inner.clone_box(); |
1006 | //^^^^^^^^^^^^^^^^^^^ () | 1002 | //^^^^^^^^^^^^^^^^^^^ () |
1007 | } | 1003 | } |
1008 | "#, | 1004 | "#, |
1009 | ) | 1005 | ) |
1010 | } | 1006 | } |
1011 | 1007 | ||