From 45dd0632bc63a04cdc1499a392d83139e2e8c348 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 15 May 2017 18:00:35 -0400 Subject: [PATCH] rename `parameter_environment` to `param_env` --- src/librustc/infer/mod.rs | 10 +++++----- src/librustc/traits/mod.rs | 8 ++++---- src/librustc/traits/specialize/mod.rs | 4 ++-- src/librustc/ty/layout.rs | 4 ++-- src/librustc/ty/maps.rs | 2 +- src/librustc/ty/mod.rs | 6 +++--- src/librustc_borrowck/borrowck/check_loans.rs | 2 +- src/librustc_borrowck/borrowck/mir/elaborate_drops.rs | 2 +- src/librustc_borrowck/borrowck/mir/mod.rs | 2 +- src/librustc_const_eval/check_match.rs | 2 +- src/librustc_lint/builtin.rs | 4 ++-- src/librustc_mir/build/mod.rs | 2 +- src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/shim.rs | 2 +- src/librustc_mir/transform/inline.rs | 2 +- src/librustc_mir/transform/qualify_consts.rs | 4 ++-- src/librustc_mir/transform/type_check.rs | 2 +- src/librustc_passes/consts.rs | 2 +- src/librustc_typeck/check/compare_method.rs | 4 ++-- src/librustc_typeck/check/dropck.rs | 2 +- src/librustc_typeck/check/method/probe.rs | 4 ++-- src/librustc_typeck/check/mod.rs | 4 ++-- src/librustc_typeck/check/regionck.rs | 6 +++--- src/librustc_typeck/coherence/builtin.rs | 6 +++--- 24 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index 88606f977ba0..270430f40df0 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -161,7 +161,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { // For region variables. region_vars: RegionVarBindings<'a, 'gcx, 'tcx>, - pub parameter_environment: ty::ParamEnv<'gcx>, + pub param_env: ty::ParamEnv<'gcx>, /// Caches the results of trait selection. This cache is used /// for things that have to do with the parameters in scope. @@ -453,7 +453,7 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId { let def_id = tcx.hir.body_owner_def_id(self); (Some(tcx.typeck_tables_of(def_id)), None, - Some(tcx.parameter_environment(def_id))) + Some(tcx.param_env(def_id))) } } @@ -498,7 +498,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> { int_unification_table: RefCell::new(UnificationTable::new()), float_unification_table: RefCell::new(UnificationTable::new()), region_vars: RegionVarBindings::new(self), - parameter_environment: param_env.unwrap(), + param_env: param_env.unwrap(), selection_cache: traits::SelectionCache::new(), evaluation_cache: traits::EvaluationCache::new(), projection_cache: RefCell::new(traits::ProjectionCache::new()), @@ -535,7 +535,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> { int_unification_table: RefCell::new(UnificationTable::new()), float_unification_table: RefCell::new(UnificationTable::new()), region_vars: RegionVarBindings::new(tcx), - parameter_environment: param_env, + param_env: param_env, selection_cache: traits::SelectionCache::new(), evaluation_cache: traits::EvaluationCache::new(), reported_trait_errors: RefCell::new(FxHashSet()), @@ -1673,7 +1673,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } pub fn param_env(&self) -> ty::ParamEnv<'gcx> { - self.parameter_environment + self.param_env } pub fn closure_kind(&self, diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index fd6efa9fd06c..e358f39bd9a3 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -482,7 +482,7 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, tcx.infer_ctxt(elaborated_env, Reveal::UserFacing).enter(|infcx| { let predicates = match fully_normalize( &infcx, cause, - // You would really want to pass infcx.parameter_environment.caller_bounds here, + // You would really want to pass infcx.param_env.caller_bounds here, // but that is an interned slice, and fully_normalize takes &T and returns T, so // without further refactoring, a slice can't be used. Luckily, we still have the // predicate vector from which we created the ParamEnv in infcx, so we @@ -494,7 +494,7 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, Err(errors) => { infcx.report_fulfillment_errors(&errors); // An unnormalized env is better than nothing. - return infcx.parameter_environment; + return infcx.param_env; } }; @@ -516,13 +516,13 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // all things considered. tcx.sess.span_err(span, &fixup_err.to_string()); // An unnormalized env is better than nothing. - return infcx.parameter_environment; + return infcx.param_env; } }; let predicates = match tcx.lift_to_global(&predicates) { Some(predicates) => predicates, - None => return infcx.parameter_environment + None => return infcx.param_env }; debug!("normalize_param_env_or_error: resolved predicates={:?}", diff --git a/src/librustc/traits/specialize/mod.rs b/src/librustc/traits/specialize/mod.rs index 0e5779f9d179..e0f28e3b49e9 100644 --- a/src/librustc/traits/specialize/mod.rs +++ b/src/librustc/traits/specialize/mod.rs @@ -180,7 +180,7 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } // create a parameter environment corresponding to a (skolemized) instantiation of impl1 - let penv = tcx.parameter_environment(impl1_def_id); + let penv = tcx.param_env(impl1_def_id); let impl1_trait_ref = tcx.impl_trait_ref(impl1_def_id).unwrap(); // Create a infcx, taking the predicates of impl1 as assumptions: @@ -250,7 +250,7 @@ fn fulfill_implication<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>, source_trait_ref, target_trait_ref, errors, - infcx.parameter_environment.caller_bounds); + infcx.param_env.caller_bounds); Err(()) } diff --git a/src/librustc/ty/layout.rs b/src/librustc/ty/layout.rs index 66935dd3a3bb..1a8c74ff1f94 100644 --- a/src/librustc/ty/layout.rs +++ b/src/librustc/ty/layout.rs @@ -1079,7 +1079,7 @@ impl<'a, 'gcx, 'tcx> Layout { let ptr_layout = |pointee: Ty<'gcx>| { let non_zero = !ty.is_unsafe_ptr(); let pointee = infcx.normalize_projections(pointee); - if pointee.is_sized(tcx, infcx.parameter_environment, DUMMY_SP) { + if pointee.is_sized(tcx, infcx.param_env, DUMMY_SP) { Ok(Scalar { value: Pointer, non_zero: non_zero }) } else { let unsized_part = tcx.struct_tail(pointee); @@ -1268,7 +1268,7 @@ impl<'a, 'gcx, 'tcx> Layout { let kind = if def.is_enum() || def.variants[0].fields.len() == 0{ StructKind::AlwaysSizedUnivariant } else { - let param_env = tcx.parameter_environment(def.did); + let param_env = tcx.param_env(def.did); let fields = &def.variants[0].fields; let last_field = &fields[fields.len()-1]; let always_sized = tcx.type_of(last_field.did) diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index 63f3f2ee2d2e..31492a8624da 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -890,7 +890,7 @@ define_maps! { <'tcx> [] specialization_graph_of: SpecializationGraph(DefId) -> Rc, [] is_object_safe: ObjectSafety(DefId) -> bool, - [] parameter_environment: ParamEnv(DefId) -> ty::ParamEnv<'tcx>, + [] param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>, // Trait selection queries. These are best used by invoking `ty.moves_by_default()`, // `ty.is_copy()`, etc, since that will prune the environment where possible. diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index ec49d7ff2c6e..fa731f6dde63 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2518,7 +2518,7 @@ fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Option } /// See `ParamEnv` struct def'n for details. -fn parameter_environment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, +fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> ParamEnv<'tcx> { // Compute the bounds on Self and the type parameters. @@ -2555,7 +2555,7 @@ pub fn provide(providers: &mut ty::maps::Providers) { adt_sized_constraint, adt_dtorck_constraint, def_span, - parameter_environment, + param_env, trait_of_item, trait_impls_of: trait_def::trait_impls_of_provider, relevant_trait_impls_for: trait_def::relevant_trait_impls_provider, @@ -2569,7 +2569,7 @@ pub fn provide_extern(providers: &mut ty::maps::Providers) { adt_dtorck_constraint, trait_impls_of: trait_def::trait_impls_of_provider, relevant_trait_impls_for: trait_def::relevant_trait_impls_provider, - parameter_environment, + param_env, ..*providers }; } diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index fd632d0c7418..722ec6424fec 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -197,7 +197,7 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, dfcx_loans: dfcx_loans, move_data: move_data, all_loans: all_loans, - param_env: &infcx.parameter_environment + param_env: &infcx.param_env }; euv::ExprUseVisitor::new(&mut clcx, &bccx.region_maps, &infcx).consume_body(body); } diff --git a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs index 5f13a080909f..e0d86ff23f86 100644 --- a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs +++ b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs @@ -44,7 +44,7 @@ impl MirPass for ElaborateDrops { _ => return } let id = src.item_id(); - let param_env = tcx.parameter_environment(tcx.hir.local_def_id(id)); + let param_env = tcx.param_env(tcx.hir.local_def_id(id)); let move_data = MoveData::gather_moves(mir, tcx, param_env); let elaborate_patch = { let mir = &*mir; diff --git a/src/librustc_borrowck/borrowck/mir/mod.rs b/src/librustc_borrowck/borrowck/mir/mod.rs index aa7952e493ce..2eb064305e87 100644 --- a/src/librustc_borrowck/borrowck/mir/mod.rs +++ b/src/librustc_borrowck/borrowck/mir/mod.rs @@ -65,7 +65,7 @@ pub fn borrowck_mir(bcx: &mut BorrowckCtxt, // steals it, but it forces the `borrowck` query. let mir = &tcx.mir_validated(def_id).borrow(); - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); let move_data = MoveData::gather_moves(mir, tcx, param_env); let mdpe = MoveDataParamEnv { move_data: move_data, param_env: param_env }; let dead_unwinds = IdxSetBuf::new_empty(mir.basic_blocks().len()); diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index 91886b221fe1..7ed5f620816e 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -52,7 +52,7 @@ impl<'a, 'tcx> Visitor<'tcx> for OuterVisitor<'a, 'tcx> { tcx: self.tcx, tables: self.tcx.body_tables(b), region_maps: &self.tcx.region_maps(def_id), - param_env: self.tcx.parameter_environment(def_id) + param_env: self.tcx.param_env(def_id) }.visit_body(self.tcx.hir.body(b)); } } diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 1a56a2d0777d..39b8e568ab48 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -988,7 +988,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnconditionalRecursion { traits::Obligation::new(traits::ObligationCause::misc(span, expr_id), trait_ref.to_poly_trait_predicate()); - let param_env = tcx.parameter_environment(method.def_id); + let param_env = tcx.param_env(method.def_id); tcx.infer_ctxt(param_env, Reveal::UserFacing).enter(|infcx| { let mut selcx = traits::SelectionContext::new(&infcx); match selcx.select(&obligation) { @@ -1257,7 +1257,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields { fn check_item(&mut self, ctx: &LateContext, item: &hir::Item) { if let hir::ItemUnion(ref vdata, _) = item.node { let item_def_id = ctx.tcx.hir.local_def_id(item.id); - let param_env = ctx.tcx.parameter_environment(item_def_id); + let param_env = ctx.tcx.param_env(item_def_id); for field in vdata.fields() { let field_ty = ctx.tcx.type_of(ctx.tcx.hir.local_def_id(field.id)); if field_ty.needs_drop(ctx.tcx, param_env) { diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index fb173e2487bf..9e151596a1ab 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -172,7 +172,7 @@ fn create_constructor_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, { let span = tcx.hir.span(ctor_id); if let hir::VariantData::Tuple(ref fields, ctor_id) = *v { - let pe = tcx.parameter_environment(tcx.hir.local_def_id(ctor_id)); + let pe = tcx.param_env(tcx.hir.local_def_id(ctor_id)); tcx.infer_ctxt(pe, Reveal::UserFacing).enter(|infcx| { let (mut mir, src) = shim::build_adt_ctor(&infcx, ctor_id, fields, span); diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index d14d4d6c5310..f61e2545f71f 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -168,7 +168,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> { type with inference types/regions", ty); }); - ty.needs_drop(self.tcx.global_tcx(), self.infcx.parameter_environment) + ty.needs_drop(self.tcx.global_tcx(), self.infcx.param_env) } pub fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> { diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs index 14d7be67d644..428685d7f505 100644 --- a/src/librustc_mir/shim.rs +++ b/src/librustc_mir/shim.rs @@ -186,7 +186,7 @@ fn build_drop_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>, if let Some(..) = ty { let patch = { - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); let mut elaborator = DropShimElaborator { mir: &mir, patch: MirPatch::new(&mir), diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs index 5516d84e121a..edb2f44d18e3 100644 --- a/src/librustc_mir/transform/inline.rs +++ b/src/librustc_mir/transform/inline.rs @@ -220,7 +220,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> { // FIXME: Give a bonus to functions with only a single caller let def_id = tcx.hir.local_def_id(self.source.item_id()); - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); let mut first_block = true; let mut cost = 0; diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index c839061df16f..4e84cbe6fecb 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -937,7 +937,7 @@ fn mir_const_qualif<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, return Qualif::NOT_CONST.bits(); } - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); let mut qualifier = Qualifier::new(tcx, param_env, def_id, mir, Mode::Const); qualifier.qualify_const().bits() @@ -965,7 +965,7 @@ impl MirPass for QualifyAndPromoteConstants { MirSource::Const(_) | MirSource::Promoted(..) => return }; - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); if mode == Mode::Fn || mode == Mode::ConstFn { // This is ugly because Qualifier holds onto mir, diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index 82c0d2c1b01c..6d9603ea459d 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -751,7 +751,7 @@ impl MirPass for TypeckMir { // broken MIR, so try not to report duplicate errors. return; } - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); tcx.infer_ctxt(param_env, Reveal::UserFacing).enter(|infcx| { let mut checker = TypeChecker::new(&infcx, item_id); { diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index 6f966be857a1..25845c5768e8 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -139,7 +139,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckCrateVisitor<'a, 'tcx> { } let outer_penv = self.tcx.infer_ctxt(body_id, Reveal::UserFacing).enter(|infcx| { - let param_env = infcx.parameter_environment.clone(); + let param_env = infcx.param_env.clone(); let outer_penv = mem::replace(&mut self.param_env, param_env); let region_maps = &self.tcx.region_maps(item_def_id);; euv::ExprUseVisitor::new(self, region_maps, &infcx).consume_body(body); diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index d89a5e7a5191..767cf8f48cfe 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -223,7 +223,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let infcx = &inh.infcx; debug!("compare_impl_method: caller_bounds={:?}", - infcx.parameter_environment.caller_bounds); + infcx.param_env.caller_bounds); let mut selcx = traits::SelectionContext::new(&infcx); @@ -345,7 +345,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let region_maps = RegionMaps::new(); let mut free_regions = FreeRegionMap::new(); free_regions.relate_free_regions_from_predicates( - &infcx.parameter_environment.caller_bounds); + &infcx.param_env.caller_bounds); infcx.resolve_regions_and_report_errors(impl_m.def_id, ®ion_maps, &free_regions); } else { let fcx = FnCtxt::new(&inh, impl_m_node_id); diff --git a/src/librustc_typeck/check/dropck.rs b/src/librustc_typeck/check/dropck.rs index e02933255963..3ed0da05dc2c 100644 --- a/src/librustc_typeck/check/dropck.rs +++ b/src/librustc_typeck/check/dropck.rs @@ -79,7 +79,7 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>( // check that the impl type can be made to match the trait type. - let impl_param_env = tcx.parameter_environment(self_type_did); + let impl_param_env = tcx.param_env(self_type_did); tcx.infer_ctxt(impl_param_env, Reveal::UserFacing).enter(|ref infcx| { let tcx = infcx.tcx; let mut fulfillment_cx = traits::FulfillmentContext::new(); diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index c1cf5192877c..9ad72b2a137e 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -566,7 +566,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { param_ty: ty::ParamTy) { // FIXME -- Do we want to commit to this behavior for param bounds? - let bounds: Vec<_> = self.parameter_environment + let bounds: Vec<_> = self.param_env .caller_bounds .iter() .filter_map(|predicate| { @@ -893,7 +893,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { debug!("assemble_where_clause_candidates(trait_def_id={:?})", trait_def_id); - let caller_predicates = self.parameter_environment.caller_bounds.to_vec(); + let caller_predicates = self.param_env.caller_bounds.to_vec(); for poly_bound in traits::elaborate_predicates(self.tcx, caller_predicates) .filter_map(|p| p.to_opt_poly_trait_ref()) .filter(|b| b.def_id() == trait_def_id) { diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index d304d79bc52c..24a88140cf04 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -539,7 +539,7 @@ impl<'a, 'gcx, 'tcx> Inherited<'a, 'gcx, 'tcx> { pub fn build(tcx: TyCtxt<'a, 'gcx, 'gcx>, def_id: DefId) -> InheritedBuilder<'a, 'gcx, 'tcx> { let tables = ty::TypeckTables::empty(); - let param_env = tcx.parameter_environment(def_id); + let param_env = tcx.param_env(def_id); InheritedBuilder { infcx: tcx.infer_ctxt((tables, param_env), Reveal::UserFacing), def_id, @@ -1561,7 +1561,7 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> { let index = generics.type_param_to_index[&def_id.index]; ty::GenericPredicates { parent: None, - predicates: self.parameter_environment.caller_bounds.iter().filter(|predicate| { + predicates: self.param_env.caller_bounds.iter().filter(|predicate| { match **predicate { ty::Predicate::Trait(ref data) => { data.0.self_ty().is_param(index) diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 754bd288bfaa..b29bf01ba199 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -138,7 +138,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let subject = self.tcx.hir.local_def_id(item_id); let mut rcx = RegionCtxt::new(self, RepeatingScope(item_id), item_id, Subject(subject)); rcx.free_region_map.relate_free_regions_from_predicates( - &self.parameter_environment.caller_bounds); + &self.param_env.caller_bounds); rcx.relate_free_regions(wf_tys, item_id, span); rcx.visit_region_obligations(item_id); rcx.resolve_regions_and_report_errors(); @@ -158,7 +158,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } rcx.free_region_map.relate_free_regions_from_predicates( - &self.parameter_environment.caller_bounds); + &self.param_env.caller_bounds); rcx.resolve_regions_and_report_errors(); @@ -1682,7 +1682,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> { fn declared_generic_bounds_from_env(&self, generic: GenericKind<'tcx>) -> Vec> { - let param_env = &self.parameter_environment; + let param_env = &self.param_env; // To start, collect bounds from user: let mut param_bounds = self.tcx.required_region_bounds(generic.to_ty(self.tcx), diff --git a/src/librustc_typeck/coherence/builtin.rs b/src/librustc_typeck/coherence/builtin.rs index 556bd618c78c..ff5599fb1bdb 100644 --- a/src/librustc_typeck/coherence/builtin.rs +++ b/src/librustc_typeck/coherence/builtin.rs @@ -105,7 +105,7 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, self_type); let span = tcx.hir.span(impl_node_id); - let param_env = tcx.parameter_environment(impl_did); + let param_env = tcx.param_env(impl_did); assert!(!self_type.has_escaping_regions()); debug!("visit_implementation_of_copy: self_type={:?} (free)", @@ -199,7 +199,7 @@ pub fn coerce_unsized_info<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, target); let span = tcx.hir.span(impl_node_id); - let param_env = tcx.parameter_environment(impl_did); + let param_env = tcx.param_env(impl_did); assert!(!source.has_escaping_regions()); let err_info = CoerceUnsizedInfo { custom_kind: None }; @@ -387,7 +387,7 @@ pub fn coerce_unsized_info<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // Finally, resolve all regions. let region_maps = RegionMaps::new(); let mut free_regions = FreeRegionMap::new(); - free_regions.relate_free_regions_from_predicates(&infcx.parameter_environment + free_regions.relate_free_regions_from_predicates(&infcx.param_env .caller_bounds); infcx.resolve_regions_and_report_errors(impl_did, ®ion_maps, &free_regions);