File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed
ide-completion/src/completions Expand file tree Collapse file tree 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(
11611161 return false ;
11621162 }
11631163 }
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 {
11661167 return false ;
11671168 }
11681169 }
Original file line number Diff line number Diff line change @@ -466,6 +466,23 @@ fn test<T: Iterable>() {
466466 ) ;
467467}
468468
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+
469486#[ test]
470487fn infer_associated_type_bound ( ) {
471488 check_types (
Original file line number Diff line number Diff line change @@ -918,4 +918,26 @@ fn main() {
918918" ,
919919 )
920920 }
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+ }
921943}
You can’t perform that action at this time.
0 commit comments