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.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs
index 4d193dea9..41d097519 100644
--- a/crates/hir_ty/src/tests/traits.rs
+++ b/crates/hir_ty/src/tests/traits.rs
@@ -907,7 +907,8 @@ fn test<T: Trait>(t: T) { (*t); }
907} 907}
908 908
909#[test] 909#[test]
910fn associated_type_inlay_hints() { 910fn associated_type_placeholder() {
911 // inside the generic function, the associated type gets normalized to a placeholder `ApplL::Out<T>` [https://rust-lang.github.io/rustc-guide/traits/associated-types.html#placeholder-associated-types].
911 check_types( 912 check_types(
912 r#" 913 r#"
913pub trait ApplyL { 914pub trait ApplyL {
@@ -923,13 +924,13 @@ impl<T> ApplyL for RefMutL<T> {
923fn test<T: ApplyL>() { 924fn test<T: ApplyL>() {
924 let y: <RefMutL<T> as ApplyL>::Out = no_matter; 925 let y: <RefMutL<T> as ApplyL>::Out = no_matter;
925 y; 926 y;
926} //^ <T as ApplyL>::Out 927} //^ ApplyL::Out<T>
927"#, 928"#,
928 ); 929 );
929} 930}
930 931
931#[test] 932#[test]
932fn associated_type_inlay_hints_2() { 933fn associated_type_placeholder_2() {
933 check_types( 934 check_types(
934 r#" 935 r#"
935pub trait ApplyL { 936pub trait ApplyL {
@@ -940,7 +941,7 @@ fn foo<T: ApplyL>(t: T) -> <T as ApplyL>::Out;
940fn test<T: ApplyL>(t: T) { 941fn test<T: ApplyL>(t: T) {
941 let y = foo(t); 942 let y = foo(t);
942 y; 943 y;
943} //^ <T as ApplyL>::Out 944} //^ ApplyL::Out<T>
944"#, 945"#,
945 ); 946 );
946} 947}