File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
compiler/rustc_borrowck/src/region_infer Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,12 @@ use super::*;
13
13
14
14
fn render_outlives_constraint ( constraint : & OutlivesConstraint < ' _ > ) -> String {
15
15
if let ConstraintCategory :: OutlivesUnnameablePlaceholder ( from, to) = constraint. category {
16
- return format ! ( "b/c {from:?}: {to:?}" ) ;
17
- }
18
- match constraint. locations {
19
- Locations :: All ( _) => "All(...)" . to_string ( ) ,
20
- Locations :: Single ( loc) => format ! ( "{loc:?}" ) ,
16
+ format ! ( "b/c {from:?}: {to:?}" )
17
+ } else {
18
+ match constraint. locations {
19
+ Locations :: All ( _) => "All(...)" . to_string ( ) ,
20
+ Locations :: Single ( loc) => format ! ( "{loc:?}" ) ,
21
+ }
21
22
}
22
23
}
23
24
Original file line number Diff line number Diff line change @@ -1736,7 +1736,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1736
1736
trace ! ( scc = ?self . constraint_sccs. scc( fr1) ) ;
1737
1737
trace ! ( universe = ?self . max_nameable_universe( self . constraint_sccs. scc( fr1) ) ) ;
1738
1738
self . constraint_path_to ( fr1, |r| {
1739
- // First look for some `r` such that `fr1: r` and `r` is live at `location`
1740
1739
trace ! ( ?r, liveness_constraints=?self . liveness_constraints. pretty_print_live_points( r) ) ;
1741
1740
self . liveness_constraints . is_live_at ( r, location)
1742
1741
} , true ) . unwrap ( ) . 1
@@ -1796,13 +1795,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1796
1795
1797
1796
// If we are passing through a constraint added because `'lt: 'unnameable`,
1798
1797
// where cannot name `'unnameable`, redirect search towards `'unnameable`.
1799
- let path = if let Some ( ( lt , unnameable ) ) = path. iter ( ) . find_map ( |c| {
1798
+ let due_to_placeholder_outlives = path. iter ( ) . find_map ( |c| {
1800
1799
if let ConstraintCategory :: OutlivesUnnameablePlaceholder ( lt, unnameable) = c. category {
1801
1800
Some ( ( lt, unnameable) )
1802
1801
} else {
1803
1802
None
1804
1803
}
1805
- } ) {
1804
+ } ) ;
1805
+ let path = if let Some ( ( lt, unnameable) ) = due_to_placeholder_outlives {
1806
1806
// This the `false` argument is what prevents circular reasoning here!
1807
1807
self . constraint_path_to ( lt, |r| r == unnameable, false ) . unwrap ( ) . 0
1808
1808
} else {
You can’t perform that action at this time.
0 commit comments