mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 03:48:29 +00:00
don't include unhelpful sequents
This commit is contained in:
parent
cd87da208f
commit
fec701e92d
1 changed files with 9 additions and 1 deletions
|
|
@ -1922,8 +1922,10 @@ impl<'db> SequentMap<'db> {
|
|||
// if they're related to each other.
|
||||
let processed = std::mem::take(&mut self.processed);
|
||||
for other in &processed {
|
||||
if constraint != *other {
|
||||
self.add_sequents_for_pair(db, constraint, *other);
|
||||
}
|
||||
}
|
||||
self.processed = processed;
|
||||
|
||||
// And see if we can create any sequents from the constraint on its own.
|
||||
|
|
@ -1959,6 +1961,9 @@ impl<'db> SequentMap<'db> {
|
|||
ante2: ConstrainedTypeVar<'db>,
|
||||
post: ConstrainedTypeVar<'db>,
|
||||
) {
|
||||
if ante1 == post || ante2 == post {
|
||||
return;
|
||||
}
|
||||
self.pair_implications
|
||||
.entry(Self::pair_key(db, ante1, ante2))
|
||||
.or_default()
|
||||
|
|
@ -1970,6 +1975,9 @@ impl<'db> SequentMap<'db> {
|
|||
ante: ConstrainedTypeVar<'db>,
|
||||
post: ConstrainedTypeVar<'db>,
|
||||
) {
|
||||
if ante == post {
|
||||
return;
|
||||
}
|
||||
self.single_implications.entry(ante).or_default().push(post);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue