Skip to content

Commit 71ee1c9

Browse files
committed
Rust: Merge Input1 and Input2 modules
1 parent ec6c301 commit 71ee1c9

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

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

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private newtype TTypeArgumentPosition =
3030
} or
3131
TTypeParamTypeArgumentPosition(TypeParam tp)
3232

33-
private module Input1 implements InputSig1<Location> {
33+
private module Input implements InputSig1<Location>, InputSig2<TypeMention> {
3434
private import Type as T
3535
private import codeql.rust.elements.internal.generated.Raw
3636
private import codeql.rust.elements.internal.generated.Synth
@@ -120,21 +120,7 @@ private module Input1 implements InputSig1<Location> {
120120
}
121121

122122
int getTypePathLimit() { result = 10 }
123-
}
124-
125-
private import Input1
126-
127-
private module M1 = Make1<Location, Input1>;
128-
129-
import M1
130-
131-
predicate getTypePathLimit = Input1::getTypePathLimit/0;
132-
133-
class TypePath = M1::TypePath;
134-
135-
module TypePath = M1::TypePath;
136123

137-
private module Input2 implements InputSig2<TypeMention> {
138124
TypeMention getABaseTypeMention(Type t) { none() }
139125

140126
Type getATypeParameterConstraint(TypeParameter tp, TypePath path) {
@@ -208,7 +194,19 @@ private module Input2 implements InputSig2<TypeMention> {
208194
}
209195
}
210196

211-
private module M2 = Make2<TypeMention, Input2>;
197+
private import Input
198+
199+
private module M1 = Make1<Location, Input>;
200+
201+
import M1
202+
203+
predicate getTypePathLimit = Input::getTypePathLimit/0;
204+
205+
class TypePath = M1::TypePath;
206+
207+
module TypePath = M1::TypePath;
208+
209+
private module M2 = Make2<TypeMention, Input>;
212210

213211
import M2
214212

@@ -4145,7 +4143,7 @@ private module Debug {
41454143
TypeAbstraction abs, TypeMention condition, TypeMention constraint, boolean transitive
41464144
) {
41474145
abs = getRelevantLocatable() and
4148-
Input2::conditionSatisfiesConstraint(abs, condition, constraint, transitive)
4146+
Input::conditionSatisfiesConstraint(abs, condition, constraint, transitive)
41494147
}
41504148

41514149
predicate debugInferShorthandSelfType(ShorthandSelfParameterMention self, TypePath path, Type t) {

0 commit comments

Comments
 (0)