File tree 3 files changed +42
-2
lines changed
ide-completion/src/completions
3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -1161,8 +1161,9 @@ pub(crate) fn generic_predicates_for_param_query(
1161
1161
return false ;
1162
1162
}
1163
1163
}
1164
- WherePredicateTypeTarget :: TypeOrConstParam ( local_id) => {
1165
- if * local_id != param_id. local_id {
1164
+ & WherePredicateTypeTarget :: TypeOrConstParam ( local_id) => {
1165
+ let target_id = TypeOrConstParamId { parent : def, local_id } ;
1166
+ if target_id != param_id {
1166
1167
return false ;
1167
1168
}
1168
1169
}
Original file line number Diff line number Diff line change @@ -466,6 +466,23 @@ fn test<T: Iterable>() {
466
466
) ;
467
467
}
468
468
469
+ #[ test]
470
+ fn associated_type_shorthand_from_self_issue_12484 ( ) {
471
+ check_types (
472
+ r#"
473
+ trait Bar {
474
+ type A;
475
+ }
476
+ trait Foo {
477
+ type A;
478
+ fn test(a: Self::A, _: impl Bar) {
479
+ a;
480
+ //^ Foo::A<Self>
481
+ }
482
+ }"# ,
483
+ ) ;
484
+ }
485
+
469
486
#[ test]
470
487
fn infer_associated_type_bound ( ) {
471
488
check_types (
Original file line number Diff line number Diff line change @@ -918,4 +918,26 @@ fn main() {
918
918
" ,
919
919
)
920
920
}
921
+
922
+ #[ test]
923
+ fn issue_12484 ( ) {
924
+ check (
925
+ r#"
926
+ //- minicore: sized
927
+ trait SizeUser {
928
+ type Size;
929
+ }
930
+ trait Closure: SizeUser {}
931
+ trait Encrypt: SizeUser {
932
+ fn encrypt(self, _: impl Closure<Size = Self::Size>);
933
+ }
934
+ fn test(thing: impl Encrypt) {
935
+ thing.$0;
936
+ }
937
+ "# ,
938
+ expect ! [ [ r#"
939
+ me encrypt(…) (as Encrypt) fn(self, impl Closure<Size = <Self as SizeUser>::Size>)
940
+ "# ] ] ,
941
+ )
942
+ }
921
943
}
You can’t perform that action at this time.
0 commit comments