aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/tests')
-rw-r--r--crates/hir_ty/src/tests/regression.rs2
-rw-r--r--crates/hir_ty/src/tests/traits.rs9
2 files changed, 6 insertions, 5 deletions
diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs
index 42d08f12c..94d86b0d1 100644
--- a/crates/hir_ty/src/tests/regression.rs
+++ b/crates/hir_ty/src/tests/regression.rs
@@ -832,7 +832,7 @@ fn issue_4966() {
832 365..390 'Repeat...nner }': Repeat<Map<|&f64| -> f64>> 832 365..390 'Repeat...nner }': Repeat<Map<|&f64| -> f64>>
833 383..388 'inner': Map<|&f64| -> f64> 833 383..388 'inner': Map<|&f64| -> f64>
834 401..404 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 834 401..404 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
835 407..416 'from_iter': fn from_iter<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>, Repeat<Map<|&f64| -> f64>>>(Repeat<Map<|&f64| -> f64>>) -> Vec<<Repeat<Map<|&f64| -> f64>> as IntoIterator>::Item> 835 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>>>>
836 407..424 'from_i...epeat)': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 836 407..424 'from_i...epeat)': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
837 417..423 'repeat': Repeat<Map<|&f64| -> f64>> 837 417..423 'repeat': Repeat<Map<|&f64| -> f64>>
838 431..434 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>> 838 431..434 'vec': Vec<IntoIterator::Item<Repeat<Map<|&f64| -> f64>>>>
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}