diff options
Diffstat (limited to 'crates/hir_ty/src/tests/traits.rs')
-rw-r--r-- | crates/hir_ty/src/tests/traits.rs | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index c830e576e..d237c3998 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs | |||
@@ -704,14 +704,9 @@ mod ops { | |||
704 | fn deref_trait() { | 704 | fn deref_trait() { |
705 | check_types( | 705 | check_types( |
706 | r#" | 706 | r#" |
707 | #[lang = "deref"] | 707 | //- minicore: deref |
708 | trait Deref { | ||
709 | type Target; | ||
710 | fn deref(&self) -> &Self::Target; | ||
711 | } | ||
712 | |||
713 | struct Arc<T>; | 708 | struct Arc<T>; |
714 | impl<T> Deref for Arc<T> { | 709 | impl<T> core::ops::Deref for Arc<T> { |
715 | type Target = T; | 710 | type Target = T; |
716 | } | 711 | } |
717 | 712 | ||
@@ -731,16 +726,10 @@ fn test(s: Arc<S>) { | |||
731 | fn deref_trait_with_inference_var() { | 726 | fn deref_trait_with_inference_var() { |
732 | check_types( | 727 | check_types( |
733 | r#" | 728 | r#" |
734 | //- /main.rs | 729 | //- minicore: deref |
735 | #[lang = "deref"] | ||
736 | trait Deref { | ||
737 | type Target; | ||
738 | fn deref(&self) -> &Self::Target; | ||
739 | } | ||
740 | |||
741 | struct Arc<T>; | 730 | struct Arc<T>; |
742 | fn new_arc<T>() -> Arc<T> {} | 731 | fn new_arc<T>() -> Arc<T> {} |
743 | impl<T> Deref for Arc<T> { | 732 | impl<T> core::ops::Deref for Arc<T> { |
744 | type Target = T; | 733 | type Target = T; |
745 | } | 734 | } |
746 | 735 | ||
@@ -761,15 +750,10 @@ fn test() { | |||
761 | fn deref_trait_infinite_recursion() { | 750 | fn deref_trait_infinite_recursion() { |
762 | check_types( | 751 | check_types( |
763 | r#" | 752 | r#" |
764 | #[lang = "deref"] | 753 | //- minicore: deref |
765 | trait Deref { | ||
766 | type Target; | ||
767 | fn deref(&self) -> &Self::Target; | ||
768 | } | ||
769 | |||
770 | struct S; | 754 | struct S; |
771 | 755 | ||
772 | impl Deref for S { | 756 | impl core::ops::Deref for S { |
773 | type Target = S; | 757 | type Target = S; |
774 | } | 758 | } |
775 | 759 | ||
@@ -784,14 +768,9 @@ fn test(s: S) { | |||
784 | fn deref_trait_with_question_mark_size() { | 768 | fn deref_trait_with_question_mark_size() { |
785 | check_types( | 769 | check_types( |
786 | r#" | 770 | r#" |
787 | #[lang = "deref"] | 771 | //- minicore: deref |
788 | trait Deref { | ||
789 | type Target; | ||
790 | fn deref(&self) -> &Self::Target; | ||
791 | } | ||
792 | |||
793 | struct Arc<T>; | 772 | struct Arc<T>; |
794 | impl<T> Deref for Arc<T> { | 773 | impl<T: ?Sized> core::ops::Deref for Arc<T> { |
795 | type Target = T; | 774 | type Target = T; |
796 | } | 775 | } |
797 | 776 | ||