]> git.lizzy.rs Git - rust.git/commitdiff
use `RegionBoundPairs` type alias
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 12 Sep 2018 21:45:00 +0000 (17:45 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 26 Sep 2018 13:37:02 +0000 (09:37 -0400)
src/librustc/infer/outlives/env.rs
src/librustc/infer/outlives/obligations.rs
src/librustc/traits/auto_trait.rs
src/librustc_mir/borrow_check/nll/type_check/constraint_conversion.rs
src/librustc_mir/borrow_check/nll/type_check/mod.rs

index 6808e9dc9e33ebf0f35d7269e8c76c00c3e07f1e..8deabacab5c837918c1e94be6c2d2af053ace826 100644 (file)
@@ -97,7 +97,7 @@ pub fn free_region_map(&self) -> &FreeRegionMap<'tcx> {
     }
 
     /// Borrows current value of the `region_bound_pairs`.
-    pub fn region_bound_pairs(&self) -> &[(ty::Region<'tcx>, GenericKind<'tcx>)] {
+    pub fn region_bound_pairs(&self) -> &RegionBoundPairs<'tcx> {
         &self.region_bound_pairs_accum
     }
 
index 700881ea5329fefc625dc21fe42380fd471b5fa8..e1f7dcfd90acb5e40715a08b171c8e83cd79ddd2 100644 (file)
@@ -71,6 +71,7 @@
 
 use hir::def_id::DefId;
 use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
+use infer::outlives::env::RegionBoundPairs;
 use syntax::ast;
 use traits::{self, ObligationCause};
 use ty::outlives::Component;
@@ -158,7 +159,7 @@ pub fn take_registered_region_obligations(&self) -> Vec<(ast::NodeId, RegionObli
     /// processed.
     pub fn process_registered_region_obligations(
         &self,
-        region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
+        region_bound_pairs: &RegionBoundPairs<'tcx>,
         implicit_region_bound: Option<ty::Region<'tcx>>,
         param_env: ty::ParamEnv<'tcx>,
         body_id: ast::NodeId,
@@ -207,7 +208,7 @@ pub fn process_registered_region_obligations(
     /// registered in advance.
     pub fn type_must_outlive(
         &self,
-        region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)],
+        region_bound_pairs: &RegionBoundPairs<'tcx>,
         implicit_region_bound: Option<ty::Region<'tcx>>,
         param_env: ty::ParamEnv<'tcx>,
         origin: infer::SubregionOrigin<'tcx>,
@@ -240,7 +241,7 @@ pub struct TypeOutlives<'cx, 'gcx: 'tcx, 'tcx: 'cx, D>
     // of these fields.
     delegate: D,
     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
-    region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)],
+    region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
     implicit_region_bound: Option<ty::Region<'tcx>>,
     param_env: ty::ParamEnv<'tcx>,
 }
@@ -269,7 +270,7 @@ impl<'cx, 'gcx, 'tcx, D> TypeOutlives<'cx, 'gcx, 'tcx, D>
     pub fn new(
         delegate: D,
         tcx: TyCtxt<'cx, 'gcx, 'tcx>,
-        region_bound_pairs: &'cx [(ty::Region<'tcx>, GenericKind<'tcx>)],
+        region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
         implicit_region_bound: Option<ty::Region<'tcx>>,
         param_env: ty::ParamEnv<'tcx>,
     ) -> Self {
index b445adea558a1f8224ed447ea1c9baecf7225094..e177382430b3b39267d9cfa3c0a0c90b7a66cecb 100644 (file)
@@ -239,7 +239,7 @@ pub fn find_auto_trait_generics<A>(
                 .collect();
 
             for id in body_ids {
-                infcx.process_registered_region_obligations(&[], None, full_env.clone(), id);
+                infcx.process_registered_region_obligations(&vec![], None, full_env.clone(), id);
             }
 
             let region_data = infcx
index 430c8d673921b57cde4e0b2fe153d3254427ba91..220cbfe4fff3d833df9665cbec5df46791d1e3eb 100644 (file)
@@ -15,6 +15,7 @@
 use borrow_check::nll::type_check::Locations;
 use borrow_check::nll::universal_regions::UniversalRegions;
 use rustc::infer::canonical::QueryRegionConstraint;
+use rustc::infer::outlives::env::RegionBoundPairs;
 use rustc::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
 use rustc::infer::region_constraints::{GenericKind, VerifyBound};
 use rustc::infer::{self, SubregionOrigin};
@@ -26,7 +27,7 @@
     tcx: TyCtxt<'a, 'gcx, 'tcx>,
     universal_regions: &'a UniversalRegions<'tcx>,
     location_table: &'a LocationTable,
-    region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
+    region_bound_pairs: &'a RegionBoundPairs<'tcx>,
     implicit_region_bound: Option<ty::Region<'tcx>>,
     param_env: ty::ParamEnv<'tcx>,
     locations: Locations,
@@ -41,7 +42,7 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> {
         tcx: TyCtxt<'a, 'gcx, 'tcx>,
         universal_regions: &'a UniversalRegions<'tcx>,
         location_table: &'a LocationTable,
-        region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
+        region_bound_pairs: &'a RegionBoundPairs<'tcx>,
         implicit_region_bound: Option<ty::Region<'tcx>>,
         param_env: ty::ParamEnv<'tcx>,
         locations: Locations,
index 70687d0efa4025e168082fff1bb9748d25b3f0a0..d4719064c28a153166967e3844ed738641a1cc30 100644 (file)
@@ -29,7 +29,7 @@
 use rustc::hir;
 use rustc::hir::def_id::DefId;
 use rustc::infer::canonical::QueryRegionConstraint;
-use rustc::infer::region_constraints::GenericKind;
+use rustc::infer::outlives::env::RegionBoundPairs;
 use rustc::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
 use rustc::mir::interpret::EvalErrorKind::BoundsCheck;
 use rustc::mir::tcx::PlaceTy;
@@ -182,7 +182,7 @@ fn type_check_internal<'a, 'gcx, 'tcx, R>(
     mir_def_id: DefId,
     param_env: ty::ParamEnv<'gcx>,
     mir: &'a Mir<'tcx>,
-    region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
+    region_bound_pairs: &'a RegionBoundPairs<'tcx>,
     implicit_region_bound: Option<ty::Region<'tcx>>,
     borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
     universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@@ -693,7 +693,7 @@ struct TypeChecker<'a, 'gcx: 'tcx, 'tcx: 'a> {
     last_span: Span,
     mir: &'a Mir<'tcx>,
     mir_def_id: DefId,
-    region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
+    region_bound_pairs: &'a RegionBoundPairs<'tcx>,
     implicit_region_bound: Option<ty::Region<'tcx>>,
     reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
     borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
@@ -802,7 +802,7 @@ fn new(
         mir: &'a Mir<'tcx>,
         mir_def_id: DefId,
         param_env: ty::ParamEnv<'gcx>,
-        region_bound_pairs: &'a [(ty::Region<'tcx>, GenericKind<'tcx>)],
+        region_bound_pairs: &'a RegionBoundPairs<'tcx>,
         implicit_region_bound: Option<ty::Region<'tcx>>,
         borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
         universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@@ -2232,7 +2232,7 @@ fn run_pass<'a, 'tcx>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, src: MirSource, mir: &
                 def_id,
                 param_env,
                 mir,
-                &[],
+                &vec![],
                 None,
                 None,
                 None,