@@ -9,7 +9,7 @@ use rustc_hir::def_id::DefId;
9
9
use rustc_index:: vec:: IndexVec ;
10
10
use rustc_infer:: infer:: canonical:: QueryOutlivesConstraint ;
11
11
use rustc_infer:: infer:: region_constraints:: { GenericKind , VarInfos , VerifyBound } ;
12
- use rustc_infer:: infer:: { InferCtxt , NLLRegionVariableOrigin , RegionVariableOrigin } ;
12
+ use rustc_infer:: infer:: { InferCtxt , NllRegionVariableOrigin , RegionVariableOrigin } ;
13
13
use rustc_middle:: mir:: {
14
14
Body , ClosureOutlivesRequirement , ClosureOutlivesSubject , ClosureRegionRequirements ,
15
15
ConstraintCategory , Local , Location , ReturnConstraint ,
@@ -143,9 +143,9 @@ pub(crate) struct AppliedMemberConstraint {
143
143
144
144
pub ( crate ) struct RegionDefinition < ' tcx > {
145
145
/// What kind of variable is this -- a free region? existential
146
- /// variable? etc. (See the `NLLRegionVariableOrigin ` for more
146
+ /// variable? etc. (See the `NllRegionVariableOrigin ` for more
147
147
/// info.)
148
- pub ( in crate :: borrow_check) origin : NLLRegionVariableOrigin ,
148
+ pub ( in crate :: borrow_check) origin : NllRegionVariableOrigin ,
149
149
150
150
/// Which universe is this region variable defined in? This is
151
151
/// most often `ty::UniverseIndex::ROOT`, but when we encounter
@@ -451,7 +451,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
451
451
let scc = self . constraint_sccs . scc ( variable) ;
452
452
453
453
match self . definitions [ variable] . origin {
454
- NLLRegionVariableOrigin :: FreeRegion => {
454
+ NllRegionVariableOrigin :: FreeRegion => {
455
455
// For each free, universally quantified region X:
456
456
457
457
// Add all nodes in the CFG to liveness constraints
@@ -462,7 +462,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
462
462
self . scc_values . add_element ( scc, variable) ;
463
463
}
464
464
465
- NLLRegionVariableOrigin :: Placeholder ( placeholder) => {
465
+ NllRegionVariableOrigin :: Placeholder ( placeholder) => {
466
466
// Each placeholder region is only visible from
467
467
// its universe `ui` and its extensions. So we
468
468
// can't just add it into `scc` unless the
@@ -480,8 +480,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
480
480
}
481
481
}
482
482
483
- NLLRegionVariableOrigin :: RootEmptyRegion
484
- | NLLRegionVariableOrigin :: Existential { .. } => {
483
+ NllRegionVariableOrigin :: RootEmptyRegion
484
+ | NllRegionVariableOrigin :: Existential { .. } => {
485
485
// For existential, regions, nothing to do.
486
486
}
487
487
}
@@ -1348,7 +1348,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1348
1348
) {
1349
1349
for ( fr, fr_definition) in self . definitions . iter_enumerated ( ) {
1350
1350
match fr_definition. origin {
1351
- NLLRegionVariableOrigin :: FreeRegion => {
1351
+ NllRegionVariableOrigin :: FreeRegion => {
1352
1352
// Go through each of the universal regions `fr` and check that
1353
1353
// they did not grow too large, accumulating any requirements
1354
1354
// for our caller into the `outlives_requirements` vector.
@@ -1360,12 +1360,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1360
1360
) ;
1361
1361
}
1362
1362
1363
- NLLRegionVariableOrigin :: Placeholder ( placeholder) => {
1363
+ NllRegionVariableOrigin :: Placeholder ( placeholder) => {
1364
1364
self . check_bound_universal_region ( fr, placeholder, errors_buffer) ;
1365
1365
}
1366
1366
1367
- NLLRegionVariableOrigin :: RootEmptyRegion
1368
- | NLLRegionVariableOrigin :: Existential { .. } => {
1367
+ NllRegionVariableOrigin :: RootEmptyRegion
1368
+ | NllRegionVariableOrigin :: Existential { .. } => {
1369
1369
// nothing to check here
1370
1370
}
1371
1371
}
@@ -1449,7 +1449,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1449
1449
errors_buffer. push ( RegionErrorKind :: RegionError {
1450
1450
longer_fr : * longer_fr,
1451
1451
shorter_fr : * shorter_fr,
1452
- fr_origin : NLLRegionVariableOrigin :: FreeRegion ,
1452
+ fr_origin : NllRegionVariableOrigin :: FreeRegion ,
1453
1453
is_reported : true ,
1454
1454
} ) ;
1455
1455
}
@@ -1459,16 +1459,16 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1459
1459
// a more complete picture on how to separate this responsibility.
1460
1460
for ( fr, fr_definition) in self . definitions . iter_enumerated ( ) {
1461
1461
match fr_definition. origin {
1462
- NLLRegionVariableOrigin :: FreeRegion => {
1462
+ NllRegionVariableOrigin :: FreeRegion => {
1463
1463
// handled by polonius above
1464
1464
}
1465
1465
1466
- NLLRegionVariableOrigin :: Placeholder ( placeholder) => {
1466
+ NllRegionVariableOrigin :: Placeholder ( placeholder) => {
1467
1467
self . check_bound_universal_region ( fr, placeholder, errors_buffer) ;
1468
1468
}
1469
1469
1470
- NLLRegionVariableOrigin :: RootEmptyRegion
1471
- | NLLRegionVariableOrigin :: Existential { .. } => {
1470
+ NllRegionVariableOrigin :: RootEmptyRegion
1471
+ | NllRegionVariableOrigin :: Existential { .. } => {
1472
1472
// nothing to check here
1473
1473
}
1474
1474
}
@@ -1516,7 +1516,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1516
1516
errors_buffer. push ( RegionErrorKind :: RegionError {
1517
1517
longer_fr,
1518
1518
shorter_fr : representative,
1519
- fr_origin : NLLRegionVariableOrigin :: FreeRegion ,
1519
+ fr_origin : NllRegionVariableOrigin :: FreeRegion ,
1520
1520
is_reported : true ,
1521
1521
} ) ;
1522
1522
}
@@ -1539,7 +1539,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1539
1539
errors_buffer. push ( RegionErrorKind :: RegionError {
1540
1540
longer_fr,
1541
1541
shorter_fr,
1542
- fr_origin : NLLRegionVariableOrigin :: FreeRegion ,
1542
+ fr_origin : NllRegionVariableOrigin :: FreeRegion ,
1543
1543
is_reported : !error_reported,
1544
1544
} ) ;
1545
1545
@@ -1597,7 +1597,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1597
1597
let blame_span_category = self . find_outlives_blame_span (
1598
1598
body,
1599
1599
longer_fr,
1600
- NLLRegionVariableOrigin :: FreeRegion ,
1600
+ NllRegionVariableOrigin :: FreeRegion ,
1601
1601
shorter_fr,
1602
1602
) ;
1603
1603
@@ -1656,7 +1656,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1656
1656
errors_buffer. push ( RegionErrorKind :: BoundUniversalRegionError {
1657
1657
longer_fr,
1658
1658
error_element,
1659
- fr_origin : NLLRegionVariableOrigin :: Placeholder ( placeholder) ,
1659
+ fr_origin : NllRegionVariableOrigin :: Placeholder ( placeholder) ,
1660
1660
} ) ;
1661
1661
}
1662
1662
@@ -1732,7 +1732,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1732
1732
debug ! ( "cannot_name_value_of(r1={:?}, r2={:?})" , r1, r2) ;
1733
1733
1734
1734
match self . definitions [ r2] . origin {
1735
- NLLRegionVariableOrigin :: Placeholder ( placeholder) => {
1735
+ NllRegionVariableOrigin :: Placeholder ( placeholder) => {
1736
1736
let universe1 = self . definitions [ r1] . universe ;
1737
1737
debug ! (
1738
1738
"cannot_name_value_of: universe1={:?} placeholder={:?}" ,
@@ -1741,9 +1741,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1741
1741
universe1. cannot_name ( placeholder. universe )
1742
1742
}
1743
1743
1744
- NLLRegionVariableOrigin :: RootEmptyRegion
1745
- | NLLRegionVariableOrigin :: FreeRegion
1746
- | NLLRegionVariableOrigin :: Existential { .. } => false ,
1744
+ NllRegionVariableOrigin :: RootEmptyRegion
1745
+ | NllRegionVariableOrigin :: FreeRegion
1746
+ | NllRegionVariableOrigin :: Existential { .. } => false ,
1747
1747
}
1748
1748
}
1749
1749
@@ -1771,7 +1771,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1771
1771
& self ,
1772
1772
body : & Body < ' tcx > ,
1773
1773
fr1 : RegionVid ,
1774
- fr1_origin : NLLRegionVariableOrigin ,
1774
+ fr1_origin : NllRegionVariableOrigin ,
1775
1775
fr2 : RegionVid ,
1776
1776
) -> ( ConstraintCategory , Span ) {
1777
1777
let ( category, _, span) = self . best_blame_constraint ( body, fr1, fr1_origin, |r| {
@@ -1933,7 +1933,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1933
1933
. definitions
1934
1934
. iter_enumerated ( )
1935
1935
. find_map ( |( r, definition) | match definition. origin {
1936
- NLLRegionVariableOrigin :: Placeholder ( p) if p == error_placeholder => Some ( r) ,
1936
+ NllRegionVariableOrigin :: Placeholder ( p) if p == error_placeholder => Some ( r) ,
1937
1937
_ => None ,
1938
1938
} )
1939
1939
. unwrap ( ) ,
@@ -1965,7 +1965,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
1965
1965
& self ,
1966
1966
body : & Body < ' tcx > ,
1967
1967
from_region : RegionVid ,
1968
- from_region_origin : NLLRegionVariableOrigin ,
1968
+ from_region_origin : NllRegionVariableOrigin ,
1969
1969
target_test : impl Fn ( RegionVid ) -> bool ,
1970
1970
) -> ( ConstraintCategory , bool , Span ) {
1971
1971
debug ! (
@@ -2059,11 +2059,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
2059
2059
//
2060
2060
// and here we prefer to blame the source (the y = x statement).
2061
2061
let blame_source = match from_region_origin {
2062
- NLLRegionVariableOrigin :: FreeRegion
2063
- | NLLRegionVariableOrigin :: Existential { from_forall : false } => true ,
2064
- NLLRegionVariableOrigin :: RootEmptyRegion
2065
- | NLLRegionVariableOrigin :: Placeholder ( _)
2066
- | NLLRegionVariableOrigin :: Existential { from_forall : true } => false ,
2062
+ NllRegionVariableOrigin :: FreeRegion
2063
+ | NllRegionVariableOrigin :: Existential { from_forall : false } => true ,
2064
+ NllRegionVariableOrigin :: RootEmptyRegion
2065
+ | NllRegionVariableOrigin :: Placeholder ( _)
2066
+ | NllRegionVariableOrigin :: Existential { from_forall : true } => false ,
2067
2067
} ;
2068
2068
2069
2069
let find_region = |i : & usize | {
@@ -2144,8 +2144,8 @@ impl<'tcx> RegionDefinition<'tcx> {
2144
2144
// `init_universal_regions`.
2145
2145
2146
2146
let origin = match rv_origin {
2147
- RegionVariableOrigin :: NLL ( origin) => origin,
2148
- _ => NLLRegionVariableOrigin :: Existential { from_forall : false } ,
2147
+ RegionVariableOrigin :: Nll ( origin) => origin,
2148
+ _ => NllRegionVariableOrigin :: Existential { from_forall : false } ,
2149
2149
} ;
2150
2150
2151
2151
Self { origin, universe, external_name : None }
0 commit comments