1
Fork 0

use RegionBoundPairs type alias

This commit is contained in:
Niko Matsakis 2018-09-12 17:45:00 -04:00
parent d5d2232838
commit 2f31698c26
5 changed files with 15 additions and 13 deletions

View file

@ -97,7 +97,7 @@ impl<'a, 'gcx: 'tcx, 'tcx: 'a> OutlivesEnvironment<'tcx> {
} }
/// Borrows current value of the `region_bound_pairs`. /// 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 &self.region_bound_pairs_accum
} }

View file

@ -71,6 +71,7 @@
use hir::def_id::DefId; use hir::def_id::DefId;
use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound}; use infer::{self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, VerifyBound};
use infer::outlives::env::RegionBoundPairs;
use syntax::ast; use syntax::ast;
use traits::{self, ObligationCause}; use traits::{self, ObligationCause};
use ty::outlives::Component; use ty::outlives::Component;
@ -158,7 +159,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
/// processed. /// processed.
pub fn process_registered_region_obligations( pub fn process_registered_region_obligations(
&self, &self,
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)], region_bound_pairs: &RegionBoundPairs<'tcx>,
implicit_region_bound: Option<ty::Region<'tcx>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
body_id: ast::NodeId, body_id: ast::NodeId,
@ -207,7 +208,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
/// registered in advance. /// registered in advance.
pub fn type_must_outlive( pub fn type_must_outlive(
&self, &self,
region_bound_pairs: &[(ty::Region<'tcx>, GenericKind<'tcx>)], region_bound_pairs: &RegionBoundPairs<'tcx>,
implicit_region_bound: Option<ty::Region<'tcx>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
origin: infer::SubregionOrigin<'tcx>, origin: infer::SubregionOrigin<'tcx>,
@ -240,7 +241,7 @@ where
// of these fields. // of these fields.
delegate: D, delegate: D,
tcx: TyCtxt<'cx, 'gcx, 'tcx>, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
} }
@ -269,7 +270,7 @@ where
pub fn new( pub fn new(
delegate: D, delegate: D,
tcx: TyCtxt<'cx, 'gcx, 'tcx>, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
) -> Self { ) -> Self {

View file

@ -239,7 +239,7 @@ impl<'a, 'tcx> AutoTraitFinder<'a, 'tcx> {
.collect(); .collect();
for id in body_ids { 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 let region_data = infcx

View file

@ -15,6 +15,7 @@ use borrow_check::nll::region_infer::{RegionTest, TypeTest};
use borrow_check::nll::type_check::Locations; use borrow_check::nll::type_check::Locations;
use borrow_check::nll::universal_regions::UniversalRegions; use borrow_check::nll::universal_regions::UniversalRegions;
use rustc::infer::canonical::QueryRegionConstraint; use rustc::infer::canonical::QueryRegionConstraint;
use rustc::infer::outlives::env::RegionBoundPairs;
use rustc::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate}; use rustc::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
use rustc::infer::region_constraints::{GenericKind, VerifyBound}; use rustc::infer::region_constraints::{GenericKind, VerifyBound};
use rustc::infer::{self, SubregionOrigin}; use rustc::infer::{self, SubregionOrigin};
@ -26,7 +27,7 @@ crate struct ConstraintConversion<'a, 'gcx: 'tcx, 'tcx: 'a> {
tcx: TyCtxt<'a, 'gcx, 'tcx>, tcx: TyCtxt<'a, 'gcx, 'tcx>,
universal_regions: &'a UniversalRegions<'tcx>, universal_regions: &'a UniversalRegions<'tcx>,
location_table: &'a LocationTable, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
locations: Locations, locations: Locations,
@ -41,7 +42,7 @@ impl<'a, 'gcx, 'tcx> ConstraintConversion<'a, 'gcx, 'tcx> {
tcx: TyCtxt<'a, 'gcx, 'tcx>, tcx: TyCtxt<'a, 'gcx, 'tcx>,
universal_regions: &'a UniversalRegions<'tcx>, universal_regions: &'a UniversalRegions<'tcx>,
location_table: &'a LocationTable, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
param_env: ty::ParamEnv<'tcx>, param_env: ty::ParamEnv<'tcx>,
locations: Locations, locations: Locations,

View file

@ -29,7 +29,7 @@ use dataflow::MaybeInitializedPlaces;
use rustc::hir; use rustc::hir;
use rustc::hir::def_id::DefId; use rustc::hir::def_id::DefId;
use rustc::infer::canonical::QueryRegionConstraint; 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::infer::{InferCtxt, InferOk, LateBoundRegionConversionTime};
use rustc::mir::interpret::EvalErrorKind::BoundsCheck; use rustc::mir::interpret::EvalErrorKind::BoundsCheck;
use rustc::mir::tcx::PlaceTy; use rustc::mir::tcx::PlaceTy;
@ -182,7 +182,7 @@ fn type_check_internal<'a, 'gcx, 'tcx, R>(
mir_def_id: DefId, mir_def_id: DefId,
param_env: ty::ParamEnv<'gcx>, param_env: ty::ParamEnv<'gcx>,
mir: &'a Mir<'tcx>, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>, universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@ -693,7 +693,7 @@ struct TypeChecker<'a, 'gcx: 'tcx, 'tcx: 'a> {
last_span: Span, last_span: Span,
mir: &'a Mir<'tcx>, mir: &'a Mir<'tcx>,
mir_def_id: DefId, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
reported_errors: FxHashSet<(Ty<'tcx>, Span)>, reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
@ -802,7 +802,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
mir: &'a Mir<'tcx>, mir: &'a Mir<'tcx>,
mir_def_id: DefId, mir_def_id: DefId,
param_env: ty::ParamEnv<'gcx>, 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>>, implicit_region_bound: Option<ty::Region<'tcx>>,
borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>, borrowck_context: Option<&'a mut BorrowCheckContext<'a, 'tcx>>,
universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>, universal_region_relations: Option<&'a UniversalRegionRelations<'tcx>>,
@ -2232,7 +2232,7 @@ impl MirPass for TypeckMir {
def_id, def_id,
param_env, param_env,
mir, mir,
&[], &vec![],
None, None,
None, None,
None, None,