aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/regression.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/tests/regression.rs')
-rw-r--r--crates/hir_ty/src/tests/regression.rs64
1 files changed, 28 insertions, 36 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index e0ad41fb9..0f418ea49 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -705,12 +705,8 @@ fn issue_4931() {
705fn issue_4885() { 705fn issue_4885() {
706 check_infer( 706 check_infer(
707 r#" 707 r#"
708 #[lang = "coerce_unsized"] 708 //- minicore: coerce_unsized, future
709 pub trait CoerceUnsized<T> {} 709 use core::future::Future;
710
711 trait Future {
712 type Output;
713 }
714 trait Foo<R> { 710 trait Foo<R> {
715 type Bar; 711 type Bar;
716 } 712 }
@@ -727,13 +723,13 @@ fn issue_4885() {
727 } 723 }
728 "#, 724 "#,
729 expect![[r#" 725 expect![[r#"
730 136..139 'key': &K 726 70..73 'key': &K
731 198..214 '{ ...key) }': impl Future<Output = <K as Foo<R>>::Bar> 727 132..148 '{ ...key) }': impl Future<Output = <K as Foo<R>>::Bar>
732 204..207 'bar': fn bar<R, K>(&K) -> impl Future<Output = <K as Foo<R>>::Bar> 728 138..141 'bar': fn bar<R, K>(&K) -> impl Future<Output = <K as Foo<R>>::Bar>
733 204..212 'bar(key)': impl Future<Output = <K as Foo<R>>::Bar> 729 138..146 'bar(key)': impl Future<Output = <K as Foo<R>>::Bar>
734 208..211 'key': &K 730 142..145 'key': &K
735 228..231 'key': &K 731 162..165 'key': &K
736 290..293 '{ }': () 732 224..227 '{ }': ()
737 "#]], 733 "#]],
738 ); 734 );
739} 735}
@@ -796,6 +792,7 @@ fn issue_4800() {
796fn issue_4966() { 792fn issue_4966() {
797 check_infer( 793 check_infer(
798 r#" 794 r#"
795 //- minicore: deref
799 pub trait IntoIterator { 796 pub trait IntoIterator {
800 type Item; 797 type Item;
801 } 798 }
@@ -806,12 +803,7 @@ fn issue_4966() {
806 803
807 struct Vec<T> {} 804 struct Vec<T> {}
808 805
809 #[lang = "deref"] 806 impl<T> core::ops::Deref for Vec<T> {
810 pub trait Deref {
811 type Target;
812 }
813
814 impl<T> Deref for Vec<T> {
815 type Target = [T]; 807 type Target = [T];
816 } 808 }
817 809
@@ -828,23 +820,23 @@ fn issue_4966() {
828 } 820 }
829 "#, 821 "#,
830 expect![[r#" 822 expect![[r#"
831 270..274 'iter': T 823 225..229 'iter': T
832 289..291 '{}': () 824 244..246 '{}': ()
833 303..447 '{ ...r(); }': () 825 258..402 '{ ...r(); }': ()
834 313..318 'inner': Map<|&f64| -> f64> 826 268..273 'inner': Map<|&f64| -> f64>
835 321..345 'Map { ... 0.0 }': Map<|&f64| -> f64> 827 276..300 'Map { ... 0.0 }': Map<|&f64| -> f64>
836 330..343 '|_: &f64| 0.0': |&f64| -> f64 828 285..298 '|_: &f64| 0.0': |&f64| -> f64
837 331..332 '_': &f64 829 286..287 '_': &f64
838 340..343 '0.0': f64 830 295..298 '0.0': f64
839 356..362 'repeat': Repeat<Map<|&f64| -> f64>> 831 311..317 'repeat': Repeat<Map<|&f64| -> f64>>
840 365..390 'Repeat...nner }': Repeat<Map<|&f64| -> f64>> 832 320..345 'Repeat...nner }': Repeat<Map<|&f64| -> f64>>
841 383..388 'inner': Map<|&f64| -> f64> 833 338..343 'inner': Map<|&f64| -> f64>
842 401..404 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 834 356..359 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
843 407..416 'from_iter': fn from_iter<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>, Repeat<Map<|&f64| -> f64>>>(Repeat<Map<|&f64| -> f64>>) -> Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 835 362..371 'from_iter': fn from_iter<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>, Repeat<Map<|&f64| -> f64>>>(Repeat<Map<|&f64| -> f64>>) -> Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
844 407..424 'from_i...epeat)': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 836 362..379 'from_i...epeat)': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
845 417..423 'repeat': Repeat<Map<|&f64| -> f64>> 837 372..378 'repeat': Repeat<Map<|&f64| -> f64>>
846 431..434 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 838 386..389 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
847 431..444 'vec.foo_bar()': {unknown} 839 386..399 'vec.foo_bar()': {unknown}
848 "#]], 840 "#]],
849 ); 841 );
850} 842}