Skip to content

Commit 2f31698

Browse files
committed
use RegionBoundPairs type alias
1 parent d5d2232 commit 2f31698

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

src/librustc/infer/outlives/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> {
9797
}
9898

9999
/// Borrows current value of the `region_bound_pairs`.
100-
pub fn region_bound_pairs(&self) -> &[(ty::Region<'tcx>, GenericKind<'tcx>)] {
100+
pub fn region_bound_pairs(&self) -> &RegionBoundPairs<'tcx> {
101101
&self.region_bound_pairs_accum
102102
}
103103

src/librustc/infer/outlives/obligations.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
7272
use hir::def_id::DefId;
7373
use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
74+
use infer::outlives::env::RegionBoundPairs;
7475
use syntax::ast;
7576
use traits::{self, ObligationCause};
7677
use ty::outlives::Component;
@@ -158,7 +159,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
158159
/// processed.
159160
pub fn process_registered_region_obligations(
160161
&self,
161-
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
162+
region_bound_pairs: &RegionBoundPairs<'tcx>,
162163
implicit_region_bound: Option<ty::Region<'tcx>>,
163164
param_env: ty::ParamEnv<'tcx>,
164165
body_id: ast::NodeId,
@@ -207,7 +208,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
207208
/// registered in advance.
208209
pub fn type_must_outlive(
209210
&self,
210-
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
211+
region_bound_pairs: &RegionBoundPairs<'tcx>,
211212
implicit_region_bound: Option<ty::Region<'tcx>>,
212213
param_env: ty::ParamEnv<'tcx>,
213214
origin: infer::SubregionOrigin<'tcx>,
@@ -240,7 +241,7 @@ where
240241
// of these fields.
241242
delegate: D,
242243
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
243-
region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)],
244+
region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
244245
implicit_region_bound: Option<ty::Region<'tcx>>,
245246
param_env: ty::ParamEnv<'tcx>,
246247
}
@@ -269,7 +270,7 @@ where
269270
pub fn new(
270271
delegate: D,
271272
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
272-
region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)],
273+
region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
273274
implicit_region_bound: Option<ty::Region<'tcx>>,
274275
param_env: ty::ParamEnv<'tcx>,
275276
) -> Self {

src/librustc/traits/auto_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
239239
.collect();
240240

241241
for id in body_ids {
242-
infcx.process_registered_region_obligations(&[], None, full_env.clone(), id);
242+
infcx.process_registered_region_obligations(&vec![], None, full_env.clone(), id);
243243
}
244244

245245
let region_data = infcx

src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use borrow_check::nll::region_infer::{RegionTest, TypeTest};
1515
use borrow_check::nll::type_check::Locations;
1616
use borrow_check::nll::universal_regions::UniversalRegions;
1717
use rustc::infer::canonical::QueryRegionConstraint;
18+
use rustc::infer::outlives::env::RegionBoundPairs;
1819
use rustc::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
1920
use rustc::infer::region_constraints::{GenericKind, VerifyBound};
2021
use rustc::infer::{self, SubregionOrigin};
@@ -26,7 +27,7 @@ crate struct ConstraintConversion<'a, 'gcx: 'tcx, 'tcx: 'a> {
2627
tcx: TyCtxt<'a, 'gcx, 'tcx>,
2728
universal_regions: &'a UniversalRegions<'tcx>,
2829
location_table: &'a LocationTable,
29-
region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
30+
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
3031
implicit_region_bound: Option<ty::Region<'tcx>>,
3132
param_env: ty::ParamEnv<'tcx>,
3233
locations: Locations,
@@ -41,7 +42,7 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> {
4142
tcx: TyCtxt<'a, 'gcx, 'tcx>,
4243
universal_regions: &'a UniversalRegions<'tcx>,
4344
location_table: &'a LocationTable,
44-
region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
45+
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
4546
implicit_region_bound: Option<ty::Region<'tcx>>,
4647
param_env: ty::ParamEnv<'tcx>,
4748
locations: Locations,

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use dataflow::MaybeInitializedPlaces;
2929
use rustc::hir;
3030
use rustc::hir::def_id::DefId;
3131
use rustc::infer::canonical::QueryRegionConstraint;
32-
use rustc::infer::region_constraints::GenericKind;
32+
use rustc::infer::outlives::env::RegionBoundPairs;
3333
use rustc::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
3434
use rustc::mir::interpret::EvalErrorKind::BoundsCheck;
3535
use rustc::mir::tcx::PlaceTy;
@@ -182,7 +182,7 @@ fn type_check_internal<'a, 'gcx, 'tcx, R>(
182182
mir_def_id: DefId,
183183
param_env: ty::ParamEnv<'gcx>,
184184
mir: &'a Mir<'tcx>,
185-
region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
185+
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
186186
implicit_region_bound: Option<ty::Region<'tcx>>,
187187
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
188188
universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@@ -693,7 +693,7 @@ struct TypeChecker<'a, 'gcx: 'tcx, 'tcx: 'a> {
693693
last_span: Span,
694694
mir: &'a Mir<'tcx>,
695695
mir_def_id: DefId,
696-
region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
696+
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
697697
implicit_region_bound: Option<ty::Region<'tcx>>,
698698
reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
699699
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
@@ -802,7 +802,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
802802
mir: &'a Mir<'tcx>,
803803
mir_def_id: DefId,
804804
param_env: ty::ParamEnv<'gcx>,
805-
region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
805+
region_bound_pairs: &'a RegionBoundPairs<'tcx>,
806806
implicit_region_bound: Option<ty::Region<'tcx>>,
807807
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
808808
universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@@ -2232,7 +2232,7 @@ impl MirPass for TypeckMir {
22322232
def_id,
22332233
param_env,
22342234
mir,
2235-
&[],
2235+
&vec![],
22362236
None,
22372237
None,
22382238
None,

0 commit comments

Comments
 (0)