group typevars by binding context

This commit is contained in:
Douglas Creager 2025-12-08 19:14:57 -05:00
parent f29200c789
commit f23ae75b5d
1 changed files with 5 additions and 1 deletions

View File

@ -646,7 +646,11 @@ impl<'db> ConstrainedTypeVar<'db> {
/// simplifications that we perform that operate on constraints with the same typevar, and this /// simplifications that we perform that operate on constraints with the same typevar, and this
/// ensures that we can find all candidate simplifications more easily. /// ensures that we can find all candidate simplifications more easily.
fn ordering(self, db: &'db dyn Db) -> impl Ord { fn ordering(self, db: &'db dyn Db) -> impl Ord {
(self.typevar(db).identity(db), self.as_id()) (
self.typevar(db).binding_context(db),
self.typevar(db).identity(db),
self.as_id(),
)
} }
/// Returns whether this constraint implies another — i.e., whether every type that /// Returns whether this constraint implies another — i.e., whether every type that