Skip to content

Commit 875c7da

Browse files
committed
Rust: Improve comments in type inference
1 parent e2e6fd0 commit 875c7da

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ private predicate methodCandidateTrait(Type type, Trait trait, string name, int
19161916
}
19171917

19181918
/**
1919-
* Holds if `mc` has `rootType` as the root type of the reciever and the target
1919+
* Holds if `mc` has `rootType` as the root type of the receiver and the target
19201920
* method is named `name` and has arity `arity`
19211921
*/
19221922
pragma[nomagic]
@@ -2193,8 +2193,8 @@ private module BlanketImplementation {
21932193
}
21942194

21952195
/**
2196-
* Holds if `impl` is a blanket implementation for a type parameter with trait
2197-
* bound `traitBound`.
2196+
* Holds if `impl` is a blanket implementation for a type parameter and
2197+
* `traitBound` is the first non-trivial trait bound of that type parameter.
21982198
*/
21992199
private predicate blanketImplementationTraitBound(ImplItemNode impl, Trait traitBound) {
22002200
traitBound =
@@ -2214,7 +2214,7 @@ private module BlanketImplementation {
22142214

22152215
/**
22162216
* Holds if `impl` is a relevant blanket implementation that requires the
2217-
* trait `trait` and provides `f`, a method with name `name` and arity
2217+
* trait `traitBound` and provides `f`, a method with name `name` and arity
22182218
* `arity`.
22192219
*/
22202220
private predicate blanketImplementationMethod(
@@ -2233,8 +2233,8 @@ private module BlanketImplementation {
22332233
f = impl.resolveTraitTy().getAssocItem(name)
22342234
) and
22352235
// If the method is already available through one of the trait bounds on the
2236-
// type parameter (because they share a common super trait) then ignore
2237-
// it.
2236+
// type parameter (because they implement the trait targeted by the impl
2237+
// block) then ignore it.
22382238
not impl.getBlanketImplementationTypeParam().resolveABound().(TraitItemNode).getASuccessor(name) =
22392239
f
22402240
}

0 commit comments

Comments
 (0)