diff options
Diffstat (limited to 'crates/hir_ty/src/tests/coercion.rs')
-rw-r--r-- | crates/hir_ty/src/tests/coercion.rs | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/crates/hir_ty/src/tests/coercion.rs b/crates/hir_ty/src/tests/coercion.rs index 71047703d..4f859fc85 100644 --- a/crates/hir_ty/src/tests/coercion.rs +++ b/crates/hir_ty/src/tests/coercion.rs | |||
@@ -741,10 +741,24 @@ fn coerce_unsize_trait_object_simple() { | |||
741 | } | 741 | } |
742 | 742 | ||
743 | #[test] | 743 | #[test] |
744 | // The rust reference says this should be possible, but rustc doesn't implement | ||
745 | // it. We used to support it, but Chalk doesn't. | ||
746 | #[ignore] | ||
747 | fn coerce_unsize_trait_object_to_trait_object() { | 744 | fn coerce_unsize_trait_object_to_trait_object() { |
745 | // FIXME: The rust reference says this should be possible, but rustc doesn't | ||
746 | // implement it. We used to support it, but Chalk doesn't. Here's the | ||
747 | // correct expect: | ||
748 | // | ||
749 | // 424..609 '{ ...bj2; }': () | ||
750 | // 434..437 'obj': &dyn Baz<i8, i16> | ||
751 | // 459..461 '&S': &S<i8, i16> | ||
752 | // 460..461 'S': S<i8, i16> | ||
753 | // 471..474 'obj': &dyn Bar<usize, i8, i16> | ||
754 | // 496..499 'obj': &dyn Baz<i8, i16> | ||
755 | // 509..512 'obj': &dyn Foo<i8, usize> | ||
756 | // 531..534 'obj': &dyn Bar<usize, i8, i16> | ||
757 | // 544..548 'obj2': &dyn Baz<i8, i16> | ||
758 | // 570..572 '&S': &S<i8, i16> | ||
759 | // 571..572 'S': S<i8, i16> | ||
760 | // 582..583 '_': &dyn Foo<i8, usize> | ||
761 | // 602..606 'obj2': &dyn Baz<i8, i16> | ||
748 | check_infer_with_mismatches( | 762 | check_infer_with_mismatches( |
749 | r#" | 763 | r#" |
750 | #[lang = "sized"] | 764 | #[lang = "sized"] |
@@ -773,21 +787,24 @@ fn coerce_unsize_trait_object_to_trait_object() { | |||
773 | let _: &dyn Foo<_, _> = obj2; | 787 | let _: &dyn Foo<_, _> = obj2; |
774 | } | 788 | } |
775 | "#, | 789 | "#, |
776 | expect![[r" | 790 | expect![[r#" |
777 | 424..609 '{ ...bj2; }': () | 791 | 424..609 '{ ...bj2; }': () |
778 | 434..437 'obj': &dyn Baz<i8, i16> | 792 | 434..437 'obj': &dyn Baz<i8, i16> |
779 | 459..461 '&S': &S<i8, i16> | 793 | 459..461 '&S': &S<i8, i16> |
780 | 460..461 'S': S<i8, i16> | 794 | 460..461 'S': S<i8, i16> |
781 | 471..474 'obj': &dyn Bar<usize, i8, i16> | 795 | 471..474 'obj': &dyn Bar<{unknown}, {unknown}, {unknown}> |
782 | 496..499 'obj': &dyn Baz<i8, i16> | 796 | 496..499 'obj': &dyn Baz<i8, i16> |
783 | 509..512 'obj': &dyn Foo<i8, usize> | 797 | 509..512 'obj': &dyn Foo<{unknown}, {unknown}> |
784 | 531..534 'obj': &dyn Bar<usize, i8, i16> | 798 | 531..534 'obj': &dyn Bar<{unknown}, {unknown}, {unknown}> |
785 | 544..548 'obj2': &dyn Baz<i8, i16> | 799 | 544..548 'obj2': &dyn Baz<i8, i16> |
786 | 570..572 '&S': &S<i8, i16> | 800 | 570..572 '&S': &S<i8, i16> |
787 | 571..572 'S': S<i8, i16> | 801 | 571..572 'S': S<i8, i16> |
788 | 582..583 '_': &dyn Foo<i8, usize> | 802 | 582..583 '_': &dyn Foo<{unknown}, {unknown}> |
789 | 602..606 'obj2': &dyn Baz<i8, i16> | 803 | 602..606 'obj2': &dyn Baz<i8, i16> |
790 | "]], | 804 | 496..499: expected &dyn Bar<{unknown}, {unknown}, {unknown}>, got &dyn Baz<i8, i16> |
805 | 531..534: expected &dyn Foo<{unknown}, {unknown}>, got &dyn Bar<{unknown}, {unknown}, {unknown}> | ||
806 | 602..606: expected &dyn Foo<{unknown}, {unknown}>, got &dyn Baz<i8, i16> | ||
807 | "#]], | ||
791 | ); | 808 | ); |
792 | } | 809 | } |
793 | 810 | ||