mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-19 20:24:27 +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,7 +1922,9 @@ impl<'db> SequentMap<'db> {
|
||||||
// if they're related to each other.
|
// if they're related to each other.
|
||||||
let processed = std::mem::take(&mut self.processed);
|
let processed = std::mem::take(&mut self.processed);
|
||||||
for other in &processed {
|
for other in &processed {
|
||||||
self.add_sequents_for_pair(db, constraint, *other);
|
if constraint != *other {
|
||||||
|
self.add_sequents_for_pair(db, constraint, *other);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.processed = processed;
|
self.processed = processed;
|
||||||
|
|
||||||
|
|
@ -1959,6 +1961,9 @@ impl<'db> SequentMap<'db> {
|
||||||
ante2: ConstrainedTypeVar<'db>,
|
ante2: ConstrainedTypeVar<'db>,
|
||||||
post: ConstrainedTypeVar<'db>,
|
post: ConstrainedTypeVar<'db>,
|
||||||
) {
|
) {
|
||||||
|
if ante1 == post || ante2 == post {
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.pair_implications
|
self.pair_implications
|
||||||
.entry(Self::pair_key(db, ante1, ante2))
|
.entry(Self::pair_key(db, ante1, ante2))
|
||||||
.or_default()
|
.or_default()
|
||||||
|
|
@ -1970,6 +1975,9 @@ impl<'db> SequentMap<'db> {
|
||||||
ante: ConstrainedTypeVar<'db>,
|
ante: ConstrainedTypeVar<'db>,
|
||||||
post: ConstrainedTypeVar<'db>,
|
post: ConstrainedTypeVar<'db>,
|
||||||
) {
|
) {
|
||||||
|
if ante == post {
|
||||||
|
return;
|
||||||
|
}
|
||||||
self.single_implications.entry(ante).or_default().push(post);
|
self.single_implications.entry(ante).or_default().push(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue