Skip to content

Commit b2ee625

Browse files
committed
Rust: Expand doc and make predicate private
1 parent 466bf85 commit b2ee625

File tree

1 file changed

+14
-2
lines changed
  • rust/ql/lib/codeql/rust/internal

1 file changed

+14
-2
lines changed

rust/ql/lib/codeql/rust/internal/Type.qll

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,20 @@ private import codeql.rust.internal.CachedStages
77
private import codeql.rust.elements.internal.generated.Raw
88
private import codeql.rust.elements.internal.generated.Synth
99

10-
/** Holds if a dyn trait type should have a type parameter associated with `n`. */
11-
predicate dynTraitTypeParameter(Trait trait, AstNode n) {
10+
/**
11+
* Holds if a dyn trait type should have a type parameter associated with `n`. A
12+
* dyn trait type inherits the type parameters of the trait it implements. That
13+
* includes the type parameters corresponding to associated types.
14+
*
15+
* For instance in
16+
* ```rust
17+
* trait SomeTrait<A> {
18+
* type AssociatedType;
19+
* }
20+
* ```
21+
* this predicate holds for the nodes `A` and `type AssociatedType`.
22+
*/
23+
private predicate dynTraitTypeParameter(Trait trait, AstNode n) {
1224
trait = any(DynTraitTypeRepr dt).getTrait() and
1325
(
1426
n = trait.getGenericParamList().getATypeParam() or

0 commit comments

Comments
 (0)