mirror of https://github.com/astral-sh/ruff
remove now-moot lifetime
This commit is contained in:
parent
8c2603f2d2
commit
1bc64d6e22
|
|
@ -548,7 +548,7 @@ impl<'db> PropertyInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default())
|
self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default())
|
||||||
}
|
}
|
||||||
|
|
@ -557,7 +557,7 @@ impl<'db> PropertyInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
let getter_equivalence = if let Some(getter) = self.getter(db) {
|
let getter_equivalence = if let Some(getter) = self.getter(db) {
|
||||||
|
|
@ -1286,7 +1286,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> Type<'db> {
|
) -> Type<'db> {
|
||||||
self.filter_union(db, |elem| {
|
self.filter_union(db, |elem| {
|
||||||
!elem
|
!elem
|
||||||
|
|
@ -1613,7 +1613,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to(db, target, inferable, TypeRelation::Subtyping)
|
self.has_relation_to(db, target, inferable, TypeRelation::Subtyping)
|
||||||
}
|
}
|
||||||
|
|
@ -1627,7 +1627,7 @@ impl<'db> Type<'db> {
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
constraints: ConstraintSet<'db>,
|
constraints: ConstraintSet<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to(
|
self.has_relation_to(
|
||||||
db,
|
db,
|
||||||
|
|
@ -1649,7 +1649,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to(db, target, inferable, TypeRelation::Assignability)
|
self.has_relation_to(db, target, inferable, TypeRelation::Assignability)
|
||||||
}
|
}
|
||||||
|
|
@ -1667,7 +1667,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to_impl(
|
self.has_relation_to_impl(
|
||||||
|
|
@ -1684,7 +1684,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
target: Type<'db>,
|
target: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -2552,7 +2552,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default())
|
self.is_equivalent_to_impl(db, other, inferable, &IsEquivalentVisitor::default())
|
||||||
}
|
}
|
||||||
|
|
@ -2561,7 +2561,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
@ -2679,7 +2679,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.is_disjoint_from_impl(
|
self.is_disjoint_from_impl(
|
||||||
db,
|
db,
|
||||||
|
|
@ -2694,7 +2694,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -2702,7 +2702,7 @@ impl<'db> Type<'db> {
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
protocol: ProtocolInstanceType<'db>,
|
protocol: ProtocolInstanceType<'db>,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -10541,7 +10541,7 @@ impl<'db> BoundMethodType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -10575,7 +10575,7 @@ impl<'db> BoundMethodType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.function(db)
|
self.function(db)
|
||||||
|
|
@ -10708,7 +10708,7 @@ impl<'db> CallableType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -10733,7 +10733,7 @@ impl<'db> CallableType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
@ -10817,7 +10817,7 @@ impl<'db> KnownBoundMethodType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -10919,7 +10919,7 @@ impl<'db> KnownBoundMethodType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
|
|
@ -11964,7 +11964,7 @@ impl<'db> UnionType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
_inferable: InferableTypeVars<'_, 'db>,
|
_inferable: InferableTypeVars<'db>,
|
||||||
_visitor: &IsEquivalentVisitor<'db>,
|
_visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
@ -12066,7 +12066,7 @@ impl<'db> IntersectionType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
_inferable: InferableTypeVars<'_, 'db>,
|
_inferable: InferableTypeVars<'db>,
|
||||||
_visitor: &IsEquivalentVisitor<'db>,
|
_visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
|
||||||
|
|
@ -2690,7 +2690,7 @@ struct ArgumentTypeChecker<'a, 'db> {
|
||||||
return_ty: Type<'db>,
|
return_ty: Type<'db>,
|
||||||
errors: &'a mut Vec<BindingError<'db>>,
|
errors: &'a mut Vec<BindingError<'db>>,
|
||||||
|
|
||||||
inferable_typevars: InferableTypeVars<'db, 'db>,
|
inferable_typevars: InferableTypeVars<'db>,
|
||||||
specialization: Option<Specialization<'db>>,
|
specialization: Option<Specialization<'db>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3039,7 +3039,7 @@ impl<'a, 'db> ArgumentTypeChecker<'a, 'db> {
|
||||||
fn finish(
|
fn finish(
|
||||||
self,
|
self,
|
||||||
) -> (
|
) -> (
|
||||||
InferableTypeVars<'db, 'db>,
|
InferableTypeVars<'db>,
|
||||||
Option<Specialization<'db>>,
|
Option<Specialization<'db>>,
|
||||||
Type<'db>,
|
Type<'db>,
|
||||||
) {
|
) {
|
||||||
|
|
@ -3109,7 +3109,7 @@ pub(crate) struct Binding<'db> {
|
||||||
return_ty: Type<'db>,
|
return_ty: Type<'db>,
|
||||||
|
|
||||||
/// The inferable typevars in this signature.
|
/// The inferable typevars in this signature.
|
||||||
inferable_typevars: InferableTypeVars<'db, 'db>,
|
inferable_typevars: InferableTypeVars<'db>,
|
||||||
|
|
||||||
/// The specialization that was inferred from the argument types, if the callable is generic.
|
/// The specialization that was inferred from the argument types, if the callable is generic.
|
||||||
specialization: Option<Specialization<'db>>,
|
specialization: Option<Specialization<'db>>,
|
||||||
|
|
@ -3361,7 +3361,7 @@ impl<'db> Binding<'db> {
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
struct BindingSnapshot<'db> {
|
struct BindingSnapshot<'db> {
|
||||||
return_ty: Type<'db>,
|
return_ty: Type<'db>,
|
||||||
inferable_typevars: InferableTypeVars<'db, 'db>,
|
inferable_typevars: InferableTypeVars<'db>,
|
||||||
specialization: Option<Specialization<'db>>,
|
specialization: Option<Specialization<'db>>,
|
||||||
argument_matches: Box<[MatchedArgument<'db>]>,
|
argument_matches: Box<[MatchedArgument<'db>]>,
|
||||||
parameter_tys: Box<[Option<Type<'db>>]>,
|
parameter_tys: Box<[Option<Type<'db>>]>,
|
||||||
|
|
|
||||||
|
|
@ -524,7 +524,7 @@ impl<'db> ClassType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: ClassType<'db>,
|
other: ClassType<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to_impl(
|
self.has_relation_to_impl(
|
||||||
db,
|
db,
|
||||||
|
|
@ -540,7 +540,7 @@ impl<'db> ClassType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -593,7 +593,7 @@ impl<'db> ClassType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: ClassType<'db>,
|
other: ClassType<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ impl<'db> ConstraintSet<'db> {
|
||||||
pub(crate) fn satisfied_by_all_typevars(
|
pub(crate) fn satisfied_by_all_typevars(
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
self.node.satisfied_by_all_typevars(db, inferable)
|
self.node.satisfied_by_all_typevars(db, inferable)
|
||||||
}
|
}
|
||||||
|
|
@ -816,11 +816,7 @@ impl<'db> Node<'db> {
|
||||||
self.satisfies(db, constraint)
|
self.satisfies(db, constraint)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn satisfied_by_all_typevars(
|
fn satisfied_by_all_typevars(self, db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> bool {
|
||||||
self,
|
|
||||||
db: &'db dyn Db,
|
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
|
||||||
) -> bool {
|
|
||||||
match self {
|
match self {
|
||||||
Node::AlwaysTrue => return true,
|
Node::AlwaysTrue => return true,
|
||||||
Node::AlwaysFalse => return false,
|
Node::AlwaysFalse => return false,
|
||||||
|
|
|
||||||
|
|
@ -970,7 +970,7 @@ impl<'db> FunctionType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -1009,7 +1009,7 @@ impl<'db> FunctionType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self.normalized(db) == other.normalized(db) {
|
if self.normalized(db) == other.normalized(db) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::hash_map::Entry;
|
use std::collections::hash_map::Entry;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::marker::PhantomData;
|
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use ruff_python_ast as ast;
|
use ruff_python_ast as ast;
|
||||||
|
|
@ -121,9 +120,9 @@ pub(crate) fn typing_self<'db>(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub(crate) enum InferableTypeVars<'a, 'db> {
|
pub(crate) enum InferableTypeVars<'db> {
|
||||||
None,
|
None,
|
||||||
One(InferableTypeVarsInner<'db>, PhantomData<&'a ()>),
|
One(InferableTypeVarsInner<'db>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[salsa::tracked(debug, heap_size=ruff_memory_usage::heap_size)]
|
#[salsa::tracked(debug, heap_size=ruff_memory_usage::heap_size)]
|
||||||
|
|
@ -136,14 +135,10 @@ pub(crate) struct InferableTypeVarsInner<'db> {
|
||||||
impl get_size2::GetSize for InferableTypeVarsInner<'_> {}
|
impl get_size2::GetSize for InferableTypeVarsInner<'_> {}
|
||||||
|
|
||||||
impl<'db> BoundTypeVarInstance<'db> {
|
impl<'db> BoundTypeVarInstance<'db> {
|
||||||
pub(crate) fn is_inferable(
|
pub(crate) fn is_inferable(self, db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> bool {
|
||||||
self,
|
|
||||||
db: &'db dyn Db,
|
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
|
||||||
) -> bool {
|
|
||||||
match inferable {
|
match inferable {
|
||||||
InferableTypeVars::None => false,
|
InferableTypeVars::None => false,
|
||||||
InferableTypeVars::One(inner, _) => inner
|
InferableTypeVars::One(inner) => inner
|
||||||
.inferable(db)
|
.inferable(db)
|
||||||
.binary_search(&self.identity(db))
|
.binary_search(&self.identity(db))
|
||||||
.is_ok(),
|
.is_ok(),
|
||||||
|
|
@ -151,24 +146,24 @@ impl<'db> BoundTypeVarInstance<'db> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'db> InferableTypeVars<'_, 'db> {
|
impl<'db> InferableTypeVars<'db> {
|
||||||
pub(crate) fn from_bound_typevars(
|
pub(crate) fn from_bound_typevars(
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
bound_typevars: impl IntoIterator<Item = BoundTypeVarIdentity<'db>>,
|
bound_typevars: impl IntoIterator<Item = BoundTypeVarIdentity<'db>>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
InferableTypeVars::One(
|
InferableTypeVars::One(InferableTypeVarsInner::from_bound_typevars(
|
||||||
InferableTypeVarsInner::from_bound_typevars(db, bound_typevars),
|
db,
|
||||||
PhantomData,
|
bound_typevars,
|
||||||
)
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn merge(self, db: &'db dyn Db, other: Self) -> Self {
|
pub(crate) fn merge(self, db: &'db dyn Db, other: Self) -> Self {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
(InferableTypeVars::None, InferableTypeVars::None) => self,
|
(InferableTypeVars::None, InferableTypeVars::None) => self,
|
||||||
(InferableTypeVars::One(_, _), InferableTypeVars::None) => self,
|
(InferableTypeVars::One(_), InferableTypeVars::None) => self,
|
||||||
(InferableTypeVars::None, InferableTypeVars::One(_, _)) => other,
|
(InferableTypeVars::None, InferableTypeVars::One(_)) => other,
|
||||||
(InferableTypeVars::One(self_inner, _), InferableTypeVars::One(other_inner, _)) => {
|
(InferableTypeVars::One(self_inner), InferableTypeVars::One(other_inner)) => {
|
||||||
InferableTypeVars::One(self_inner.merge(db, other_inner), PhantomData)
|
InferableTypeVars::One(self_inner.merge(db, other_inner))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -177,7 +172,7 @@ impl<'db> InferableTypeVars<'_, 'db> {
|
||||||
#[expect(dead_code)]
|
#[expect(dead_code)]
|
||||||
pub(crate) fn display(self, db: &'db dyn Db) -> impl Display {
|
pub(crate) fn display(self, db: &'db dyn Db) -> impl Display {
|
||||||
let inferable = match self {
|
let inferable = match self {
|
||||||
InferableTypeVars::One(inner, _) => inner.inferable(db),
|
InferableTypeVars::One(inner) => inner.inferable(db),
|
||||||
InferableTypeVars::None => return String::from("[]"),
|
InferableTypeVars::None => return String::from("[]"),
|
||||||
};
|
};
|
||||||
format!(
|
format!(
|
||||||
|
|
@ -319,7 +314,7 @@ impl<'db> GenericContext<'db> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn inferable_typevars(self, db: &'db dyn Db) -> InferableTypeVars<'db, 'db> {
|
pub(crate) fn inferable_typevars(self, db: &'db dyn Db) -> InferableTypeVars<'db> {
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct CollectTypeVars<'db> {
|
struct CollectTypeVars<'db> {
|
||||||
typevars: RefCell<SmallVec<[BoundTypeVarIdentity<'db>; 4]>>,
|
typevars: RefCell<SmallVec<[BoundTypeVarIdentity<'db>; 4]>>,
|
||||||
|
|
@ -366,7 +361,7 @@ impl<'db> GenericContext<'db> {
|
||||||
// This ensures that salsa caches the InferableTypeVarsInner, not the InferableTypeVars
|
// This ensures that salsa caches the InferableTypeVarsInner, not the InferableTypeVars
|
||||||
// that wraps it. (That way InferableTypeVars can contain a reference, and doesn't need to
|
// that wraps it. (That way InferableTypeVars can contain a reference, and doesn't need to
|
||||||
// impl salsa::Update.)
|
// impl salsa::Update.)
|
||||||
InferableTypeVars::One(inferable_typevars_inner(db, self), PhantomData)
|
InferableTypeVars::One(inferable_typevars_inner(db, self))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn variables(
|
pub(crate) fn variables(
|
||||||
|
|
@ -727,7 +722,7 @@ fn is_subtype_in_invariant_position<'db>(
|
||||||
derived_materialization: MaterializationKind,
|
derived_materialization: MaterializationKind,
|
||||||
base_type: &Type<'db>,
|
base_type: &Type<'db>,
|
||||||
base_materialization: MaterializationKind,
|
base_materialization: MaterializationKind,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -805,7 +800,7 @@ fn has_relation_in_invariant_position<'db>(
|
||||||
derived_materialization: Option<MaterializationKind>,
|
derived_materialization: Option<MaterializationKind>,
|
||||||
base_type: &Type<'db>,
|
base_type: &Type<'db>,
|
||||||
base_materialization: Option<MaterializationKind>,
|
base_materialization: Option<MaterializationKind>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -1153,7 +1148,7 @@ impl<'db> Specialization<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -1231,7 +1226,7 @@ impl<'db> Specialization<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Specialization<'db>,
|
other: Specialization<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self.materialization_kind(db) != other.materialization_kind(db) {
|
if self.materialization_kind(db) != other.materialization_kind(db) {
|
||||||
|
|
@ -1345,12 +1340,12 @@ impl<'db> PartialSpecialization<'_, 'db> {
|
||||||
/// specialization of a generic function.
|
/// specialization of a generic function.
|
||||||
pub(crate) struct SpecializationBuilder<'db> {
|
pub(crate) struct SpecializationBuilder<'db> {
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
inferable: InferableTypeVars<'db, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
types: FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>,
|
types: FxHashMap<BoundTypeVarIdentity<'db>, Type<'db>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'db> SpecializationBuilder<'db> {
|
impl<'db> SpecializationBuilder<'db> {
|
||||||
pub(crate) fn new(db: &'db dyn Db, inferable: InferableTypeVars<'db, 'db>) -> Self {
|
pub(crate) fn new(db: &'db dyn Db, inferable: InferableTypeVars<'db>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
db,
|
db,
|
||||||
inferable,
|
inferable,
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ impl<'db> Type<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
protocol: ProtocolInstanceType<'db>,
|
protocol: ProtocolInstanceType<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -365,7 +365,7 @@ impl<'db> NominalInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -398,7 +398,7 @@ impl<'db> NominalInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
match (self.0, other.0) {
|
match (self.0, other.0) {
|
||||||
|
|
@ -420,7 +420,7 @@ impl<'db> NominalInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -719,7 +719,7 @@ impl<'db> ProtocolInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
_inferable: InferableTypeVars<'_, 'db>,
|
_inferable: InferableTypeVars<'db>,
|
||||||
_visitor: &IsEquivalentVisitor<'db>,
|
_visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
if self == other {
|
if self == other {
|
||||||
|
|
@ -741,7 +741,7 @@ impl<'db> ProtocolInstanceType<'db> {
|
||||||
self,
|
self,
|
||||||
_db: &'db dyn Db,
|
_db: &'db dyn Db,
|
||||||
_other: Self,
|
_other: Self,
|
||||||
_inferable: InferableTypeVars<'_, 'db>,
|
_inferable: InferableTypeVars<'db>,
|
||||||
_visitor: &IsDisjointVisitor<'db>,
|
_visitor: &IsDisjointVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
ConstraintSet::from(false)
|
ConstraintSet::from(false)
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ impl<'db> ProtocolInterface<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -608,7 +608,7 @@ impl<'a, 'db> ProtocolMember<'a, 'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -633,7 +633,7 @@ impl<'a, 'db> ProtocolMember<'a, 'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Type<'db>,
|
other: Type<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ impl<'db> CallableSignature<'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.has_relation_to_impl(
|
self.has_relation_to_impl(
|
||||||
db,
|
db,
|
||||||
|
|
@ -233,7 +233,7 @@ impl<'db> CallableSignature<'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -255,7 +255,7 @@ impl<'db> CallableSignature<'db> {
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
self_signatures: &[Signature<'db>],
|
self_signatures: &[Signature<'db>],
|
||||||
other_signatures: &[Signature<'db>],
|
other_signatures: &[Signature<'db>],
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -321,7 +321,7 @@ impl<'db> CallableSignature<'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
match (self.overloads.as_slice(), other.overloads.as_slice()) {
|
match (self.overloads.as_slice(), other.overloads.as_slice()) {
|
||||||
|
|
@ -628,7 +628,7 @@ impl<'db> Signature<'db> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn inferable_typevars(&self, db: &'db dyn Db) -> InferableTypeVars<'db, 'db> {
|
fn inferable_typevars(&self, db: &'db dyn Db) -> InferableTypeVars<'db> {
|
||||||
match self.generic_context {
|
match self.generic_context {
|
||||||
Some(generic_context) => generic_context.inferable_typevars(db),
|
Some(generic_context) => generic_context.inferable_typevars(db),
|
||||||
None => InferableTypeVars::None,
|
None => InferableTypeVars::None,
|
||||||
|
|
@ -642,7 +642,7 @@ impl<'db> Signature<'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Signature<'db>,
|
other: &Signature<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
// The typevars in self and other should also be considered inferable when checking whether
|
// The typevars in self and other should also be considered inferable when checking whether
|
||||||
|
|
@ -734,7 +734,7 @@ impl<'db> Signature<'db> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Signature<'db>,
|
other: &Signature<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ impl<'db> SubclassOfType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: SubclassOfType<'db>,
|
other: SubclassOfType<'db>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -174,7 +174,7 @@ impl<'db> SubclassOfType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
_inferable: InferableTypeVars<'_, 'db>,
|
_inferable: InferableTypeVars<'db>,
|
||||||
_visitor: &IsDisjointVisitor<'db>,
|
_visitor: &IsDisjointVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
match (self.subclass_of, other.subclass_of) {
|
match (self.subclass_of, other.subclass_of) {
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ impl<'db> TupleType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -278,7 +278,7 @@ impl<'db> TupleType<'db> {
|
||||||
self,
|
self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: Self,
|
other: Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.tuple(db)
|
self.tuple(db)
|
||||||
|
|
@ -441,7 +441,7 @@ impl<'db> FixedLengthTuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Tuple<Type<'db>>,
|
other: &Tuple<Type<'db>>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -528,7 +528,7 @@ impl<'db> FixedLengthTuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
ConstraintSet::from(self.0.len() == other.0.len()).and(db, || {
|
ConstraintSet::from(self.0.len() == other.0.len()).and(db, || {
|
||||||
|
|
@ -798,7 +798,7 @@ impl<'db> VariableLengthTuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Tuple<Type<'db>>,
|
other: &Tuple<Type<'db>>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -977,7 +977,7 @@ impl<'db> VariableLengthTuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
self.variable
|
self.variable
|
||||||
|
|
@ -1190,7 +1190,7 @@ impl<'db> Tuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
relation: TypeRelation<'db>,
|
relation: TypeRelation<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
|
|
@ -1219,7 +1219,7 @@ impl<'db> Tuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
visitor: &IsEquivalentVisitor<'db>,
|
visitor: &IsEquivalentVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
|
|
@ -1239,7 +1239,7 @@ impl<'db> Tuple<Type<'db>> {
|
||||||
&self,
|
&self,
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
other: &Self,
|
other: &Self,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db> {
|
) -> ConstraintSet<'db> {
|
||||||
|
|
@ -1259,7 +1259,7 @@ impl<'db> Tuple<Type<'db>> {
|
||||||
db: &'db dyn Db,
|
db: &'db dyn Db,
|
||||||
a: impl IntoIterator<Item = &'s Type<'db>>,
|
a: impl IntoIterator<Item = &'s Type<'db>>,
|
||||||
b: impl IntoIterator<Item = &'s Type<'db>>,
|
b: impl IntoIterator<Item = &'s Type<'db>>,
|
||||||
inferable: InferableTypeVars<'_, 'db>,
|
inferable: InferableTypeVars<'db>,
|
||||||
disjointness_visitor: &IsDisjointVisitor<'db>,
|
disjointness_visitor: &IsDisjointVisitor<'db>,
|
||||||
relation_visitor: &HasRelationToVisitor<'db>,
|
relation_visitor: &HasRelationToVisitor<'db>,
|
||||||
) -> ConstraintSet<'db>
|
) -> ConstraintSet<'db>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue