Skip to content

Commit 001735b

Browse files
committed
Rust: Take internal IDs of a smaller class
1 parent 8acf9ce commit 001735b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ private module Input1 implements InputSig1<Location> {
6969
apos.asMethodTypeArgumentPosition() = ppos.asTypeParam().getPosition()
7070
}
7171

72-
private predicate id(Raw::AstNode x, Raw::AstNode y) { x = y }
72+
/** A raw AST node that might correspond to a type parameter. */
73+
private class RawTypeParameter = @type_param or @trait;
7374

74-
private predicate idOfRaw(Raw::AstNode x, int y) = equivalenceRelation(id/2)(x, y)
75+
private predicate id(RawTypeParameter x, RawTypeParameter y) { x = y }
76+
77+
private predicate idOfRaw(RawTypeParameter x, int y) = equivalenceRelation(id/2)(x, y)
7578

7679
private int idOf(AstNode node) { idOfRaw(Synth::convertAstNodeToRaw(node), result) }
7780

0 commit comments

Comments
 (0)