Skip to content

Commit 3f392e8

Browse files
committed
Rust: Remove type at self position for tuple-like constructors
1 parent f2e7dca commit 3f392e8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,9 +3103,6 @@ abstract private class TupleLikeConstructor extends Addressable {
31033103
or
31043104
pos.isReturn() and
31053105
result = this.getReturnType(path)
3106-
or
3107-
pos.isSelf() and
3108-
result = this.getReturnType(path)
31093106
}
31103107

31113108
Type getParameterType(FunctionPosition pos, TypePath path) {
@@ -3840,15 +3837,15 @@ private module TupleStructPatMatchingInput implements MatchingInputSig {
38403837
result = this.getField(apos.asPosition())
38413838
or
38423839
result = this and
3843-
apos.isSelf()
3840+
apos.isReturn()
38443841
}
38453842

38463843
Type getInferredType(AccessPosition apos, TypePath path) {
38473844
result = inferType(this.getNodeAt(apos), path)
38483845
or
38493846
// The struct/enum type is supplied explicitly as a type qualifier, e.g.
38503847
// `let Option::<Foo>::Some(x) = ...`.
3851-
apos.isSelf() and
3848+
apos.isReturn() and
38523849
result = this.getPath().(TypeMention).getTypeAt(path)
38533850
}
38543851

0 commit comments

Comments
 (0)