mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Remove ordering traits from rustc_borrowck::constraints::OutlivesConstraint
In two cases where this ordering was used, I've replaced the sorting to use a key that does not include DefId. I'm not sure this is correct in terms of our goals from #90317, or otherwise.
This commit is contained in:
parent
2f004d2d40
commit
7f16d0ed54
@ -72,7 +72,7 @@ impl<'tcx> Index<OutlivesConstraintIndex> for OutlivesConstraintSet<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[derive(Clone, PartialEq, Eq)]
|
||||
pub struct OutlivesConstraint<'tcx> {
|
||||
// NB. The ordering here is not significant for correctness, but
|
||||
// it is for convenience. Before we dump the constraints in the
|
||||
|
@ -72,7 +72,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
}
|
||||
|
||||
let mut constraints: Vec<_> = self.constraints.outlives().iter().collect();
|
||||
constraints.sort();
|
||||
constraints.sort_by_key(|c| (c.sup, c.sub));
|
||||
for constraint in &constraints {
|
||||
let OutlivesConstraint { sup, sub, locations, category, variance_info: _ } = constraint;
|
||||
let (name, arg) = match locations {
|
||||
|
@ -612,7 +612,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
fn propagate_constraints(&mut self, _body: &Body<'tcx>) {
|
||||
debug!("constraints={:#?}", {
|
||||
let mut constraints: Vec<_> = self.constraints.outlives().iter().collect();
|
||||
constraints.sort();
|
||||
constraints.sort_by_key(|c| (c.sup, c.sub));
|
||||
constraints
|
||||
.into_iter()
|
||||
.map(|c| (c, self.constraint_sccs.scc(c.sup), self.constraint_sccs.scc(c.sub)))
|
||||
|
Loading…
Reference in New Issue
Block a user