File tree Expand file tree Collapse file tree
rust/ql/lib/codeql/rust/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -542,9 +542,21 @@ private class BlockExprItemNode extends ItemNode instanceof BlockExpr {
542542}
543543
544544private class TypeParamItemNode extends ItemNode instanceof TypeParam {
545+ private WherePred getAWherePred ( ) {
546+ exists ( ItemNode declaringItem |
547+ this = resolveTypeParamPathTypeRepr ( result .getTypeRepr ( ) ) and
548+ result = declaringItem .getADescendant ( ) and
549+ this = declaringItem .getADescendant ( )
550+ )
551+ }
552+
545553 pragma [ nomagic]
546554 Path getABoundPath ( ) {
547- result = super .getTypeBoundList ( ) .getABound ( ) .getTypeRepr ( ) .( PathTypeRepr ) .getPath ( )
555+ exists ( TypeBoundList tbl | result = tbl .getABound ( ) .getTypeRepr ( ) .( PathTypeRepr ) .getPath ( ) |
556+ tbl = super .getTypeBoundList ( )
557+ or
558+ tbl = this .getAWherePred ( ) .getTypeBoundList ( )
559+ )
548560 }
549561
550562 ItemNode resolveABound ( ) { result = resolvePath ( this .getABoundPath ( ) ) }
@@ -564,11 +576,7 @@ private class TypeParamItemNode extends ItemNode instanceof TypeParam {
564576 predicate hasTraitBound ( ) {
565577 exists ( this .getABoundPath ( ) )
566578 or
567- exists ( ItemNode declaringItem , WherePred wp |
568- this = resolveTypeParamPathTypeRepr ( wp .getTypeRepr ( ) ) and
569- wp = declaringItem .getADescendant ( ) and
570- this = declaringItem .getADescendant ( )
571- )
579+ exists ( this .getAWherePred ( ) )
572580 }
573581
574582 /**
You can’t perform that action at this time.
0 commit comments