Skip to content

Commit 372e4ae

Browse files
committed
Tweek best_blame_constraint to slightly prefer specific explanations
1 parent 7710d95 commit 372e4ae

File tree

1 file changed

+6
-4
lines changed
  • src/librustc_mir/borrow_check/nll/region_infer/error_reporting

1 file changed

+6
-4
lines changed

src/librustc_mir/borrow_check/nll/region_infer/error_reporting/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,15 @@ impl<'tcx> RegionInferenceContext<'tcx> {
124124
let constraint = &self.constraints[path[i]];
125125

126126
let constraint_sup_scc = self.constraint_sccs.scc(constraint.sup);
127-
if constraint_sup_scc == target_scc {
128-
return false;
129-
}
130127

131128
match categorized_path[i].0 {
132129
ConstraintCategory::Boring => false,
133-
_ => true,
130+
ConstraintCategory::Other => {
131+
// other isn't interesting when the two lifetimes
132+
// are unified.
133+
constraint_sup_scc != self.constraint_sccs.scc(constraint.sub)
134+
}
135+
_ => constraint_sup_scc != target_scc,
134136
}
135137
});
136138
if let Some(i) = best_choice {

0 commit comments

Comments
 (0)