aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/traits.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/tests/traits.rs')
-rw-r--r--crates/hir_ty/src/tests/traits.rs37
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 {
704fn deref_trait() { 704fn deref_trait() {
705 check_types( 705 check_types(
706 r#" 706 r#"
707#[lang = "deref"] 707//- minicore: deref
708trait Deref {
709 type Target;
710 fn deref(&self) -> &Self::Target;
711}
712
713struct Arc<T>; 708struct Arc<T>;
714impl<T> Deref for Arc<T> { 709impl<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>) {
731fn deref_trait_with_inference_var() { 726fn deref_trait_with_inference_var() {
732 check_types( 727 check_types(
733 r#" 728 r#"
734//- /main.rs 729//- minicore: deref
735#[lang = "deref"]
736trait Deref {
737 type Target;
738 fn deref(&self) -> &Self::Target;
739}
740
741struct Arc<T>; 730struct Arc<T>;
742fn new_arc<T>() -> Arc<T> {} 731fn new_arc<T>() -> Arc<T> {}
743impl<T> Deref for Arc<T> { 732impl<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() {
761fn deref_trait_infinite_recursion() { 750fn deref_trait_infinite_recursion() {
762 check_types( 751 check_types(
763 r#" 752 r#"
764#[lang = "deref"] 753//- minicore: deref
765trait Deref {
766 type Target;
767 fn deref(&self) -> &Self::Target;
768}
769
770struct S; 754struct S;
771 755
772impl Deref for S { 756impl 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) {
784fn deref_trait_with_question_mark_size() { 768fn deref_trait_with_question_mark_size() {
785 check_types( 769 check_types(
786 r#" 770 r#"
787#[lang = "deref"] 771//- minicore: deref
788trait Deref {
789 type Target;
790 fn deref(&self) -> &Self::Target;
791}
792
793struct Arc<T>; 772struct Arc<T>;
794impl<T> Deref for Arc<T> { 773impl<T: ?Sized> core::ops::Deref for Arc<T> {
795 type Target = T; 774 type Target = T;
796} 775}
797 776