Rust: Adapt to changes in shared type inference library

This commit is contained in:
Simon Friis Vindum
2026-01-26 09:33:50 +01:00
parent a7fecaaa1b
commit 7100ca4262
2 changed files with 12 additions and 8 deletions

View File

@@ -134,12 +134,8 @@ class TypePath = M1::TypePath;
module TypePath = M1::TypePath;
private module Input2 implements InputSig2 {
private import TypeMention as TM
class TypeMention = TM::TypeMention;
TypeMention getABaseTypeMention(Type t) { none() }
private module Input2 implements InputSig2<TypeMentionTypeTree> {
TypeMentionTypeTree getABaseTypeMention(Type t) { none() }
Type getATypeParameterConstraint(TypeParameter tp, TypePath path) {
exists(TypeMention tm | result = tm.resolveTypeAt(path) |
@@ -162,7 +158,8 @@ private module Input2 implements InputSig2 {
* inference module for more information.
*/
predicate conditionSatisfiesConstraint(
TypeAbstraction abs, TypeMention condition, TypeMention constraint, boolean transitive
TypeAbstraction abs, TypeMentionTypeTree condition, TypeMentionTypeTree constraint,
boolean transitive
) {
// `impl` blocks implementing traits
transitive = false and
@@ -212,7 +209,7 @@ private module Input2 implements InputSig2 {
}
}
private module M2 = Make2<Input2>;
private module M2 = Make2<TypeMentionTypeTree, Input2>;
import M2

View File

@@ -18,6 +18,13 @@ abstract class TypeMention extends AstNode {
final Type resolveType() { result = this.resolveTypeAt(TypePath::nil()) }
}
final private class FinalTypeMention = TypeMention;
/** An adapter for type mentions to implement `HasTypeTreeSig`. */
final class TypeMentionTypeTree extends FinalTypeMention {
Type getTypeAt(TypePath path) { result = this.resolveTypeAt(path) }
}
class TupleTypeReprMention extends TypeMention instanceof TupleTypeRepr {
override Type resolveTypeAt(TypePath path) {
path.isEmpty() and