Skip to content

Commit 45dd063

Browse files
committed
rename parameter_environment to param_env
1 parent 697146b commit 45dd063

File tree

24 files changed

+44
-44
lines changed

24 files changed

+44
-44
lines changed

src/librustc/infer/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
161161
// For region variables.
162162
region_vars: RegionVarBindings<'a, 'gcx, 'tcx>,
163163

164-
pub parameter_environment: ty::ParamEnv<'gcx>,
164+
pub param_env: ty::ParamEnv<'gcx>,
165165

166166
/// Caches the results of trait selection. This cache is used
167167
/// for things that have to do with the parameters in scope.
@@ -453,7 +453,7 @@ impl<'a, 'tcx> InferEnv<'a, 'tcx> for hir::BodyId {
453453
let def_id = tcx.hir.body_owner_def_id(self);
454454
(Some(tcx.typeck_tables_of(def_id)),
455455
None,
456-
Some(tcx.parameter_environment(def_id)))
456+
Some(tcx.param_env(def_id)))
457457
}
458458
}
459459

@@ -498,7 +498,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'gcx> {
498498
int_unification_table: RefCell::new(UnificationTable::new()),
499499
float_unification_table: RefCell::new(UnificationTable::new()),
500500
region_vars: RegionVarBindings::new(self),
501-
parameter_environment: param_env.unwrap(),
501+
param_env: param_env.unwrap(),
502502
selection_cache: traits::SelectionCache::new(),
503503
evaluation_cache: traits::EvaluationCache::new(),
504504
projection_cache: RefCell::new(traits::ProjectionCache::new()),
@@ -535,7 +535,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
535535
int_unification_table: RefCell::new(UnificationTable::new()),
536536
float_unification_table: RefCell::new(UnificationTable::new()),
537537
region_vars: RegionVarBindings::new(tcx),
538-
parameter_environment: param_env,
538+
param_env: param_env,
539539
selection_cache: traits::SelectionCache::new(),
540540
evaluation_cache: traits::EvaluationCache::new(),
541541
reported_trait_errors: RefCell::new(FxHashSet()),
@@ -1673,7 +1673,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
16731673
}
16741674

16751675
pub fn param_env(&self) -> ty::ParamEnv<'gcx> {
1676-
self.parameter_environment
1676+
self.param_env
16771677
}
16781678

16791679
pub fn closure_kind(&self,

src/librustc/traits/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
482482
tcx.infer_ctxt(elaborated_env, Reveal::UserFacing).enter(|infcx| {
483483
let predicates = match fully_normalize(
484484
&infcx, cause,
485-
// You would really want to pass infcx.parameter_environment.caller_bounds here,
485+
// You would really want to pass infcx.param_env.caller_bounds here,
486486
// but that is an interned slice, and fully_normalize takes &T and returns T, so
487487
// without further refactoring, a slice can't be used. Luckily, we still have the
488488
// 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>,
494494
Err(errors) => {
495495
infcx.report_fulfillment_errors(&errors);
496496
// An unnormalized env is better than nothing.
497-
return infcx.parameter_environment;
497+
return infcx.param_env;
498498
}
499499
};
500500

@@ -516,13 +516,13 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
516516
// all things considered.
517517
tcx.sess.span_err(span, &fixup_err.to_string());
518518
// An unnormalized env is better than nothing.
519-
return infcx.parameter_environment;
519+
return infcx.param_env;
520520
}
521521
};
522522

523523
let predicates = match tcx.lift_to_global(&predicates) {
524524
Some(predicates) => predicates,
525-
None => return infcx.parameter_environment
525+
None => return infcx.param_env
526526
};
527527

528528
debug!("normalize_param_env_or_error: resolved predicates={:?}",

src/librustc/traits/specialize/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
180180
}
181181

182182
// create a parameter environment corresponding to a (skolemized) instantiation of impl1
183-
let penv = tcx.parameter_environment(impl1_def_id);
183+
let penv = tcx.param_env(impl1_def_id);
184184
let impl1_trait_ref = tcx.impl_trait_ref(impl1_def_id).unwrap();
185185

186186
// 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>,
250250
source_trait_ref,
251251
target_trait_ref,
252252
errors,
253-
infcx.parameter_environment.caller_bounds);
253+
infcx.param_env.caller_bounds);
254254
Err(())
255255
}
256256

src/librustc/ty/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ impl<'a, 'gcx, 'tcx> Layout {
10791079
let ptr_layout = |pointee: Ty<'gcx>| {
10801080
let non_zero = !ty.is_unsafe_ptr();
10811081
let pointee = infcx.normalize_projections(pointee);
1082-
if pointee.is_sized(tcx, infcx.parameter_environment, DUMMY_SP) {
1082+
if pointee.is_sized(tcx, infcx.param_env, DUMMY_SP) {
10831083
Ok(Scalar { value: Pointer, non_zero: non_zero })
10841084
} else {
10851085
let unsized_part = tcx.struct_tail(pointee);
@@ -1268,7 +1268,7 @@ impl<'a, 'gcx, 'tcx> Layout {
12681268
let kind = if def.is_enum() || def.variants[0].fields.len() == 0{
12691269
StructKind::AlwaysSizedUnivariant
12701270
} else {
1271-
let param_env = tcx.parameter_environment(def.did);
1271+
let param_env = tcx.param_env(def.did);
12721272
let fields = &def.variants[0].fields;
12731273
let last_field = &fields[fields.len()-1];
12741274
let always_sized = tcx.type_of(last_field.did)

src/librustc/ty/maps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ define_maps! { <'tcx>
890890
[] specialization_graph_of: SpecializationGraph(DefId) -> Rc<specialization_graph::Graph>,
891891
[] is_object_safe: ObjectSafety(DefId) -> bool,
892892

893-
[] parameter_environment: ParamEnv(DefId) -> ty::ParamEnv<'tcx>,
893+
[] param_env: ParamEnv(DefId) -> ty::ParamEnv<'tcx>,
894894

895895
// Trait selection queries. These are best used by invoking `ty.moves_by_default()`,
896896
// `ty.is_copy()`, etc, since that will prune the environment where possible.

src/librustc/ty/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,7 +2518,7 @@ fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Option
25182518
}
25192519

25202520
/// See `ParamEnv` struct def'n for details.
2521-
fn parameter_environment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
2521+
fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
25222522
def_id: DefId)
25232523
-> ParamEnv<'tcx> {
25242524
// Compute the bounds on Self and the type parameters.
@@ -2555,7 +2555,7 @@ pub fn provide(providers: &mut ty::maps::Providers) {
25552555
adt_sized_constraint,
25562556
adt_dtorck_constraint,
25572557
def_span,
2558-
parameter_environment,
2558+
param_env,
25592559
trait_of_item,
25602560
trait_impls_of: trait_def::trait_impls_of_provider,
25612561
relevant_trait_impls_for: trait_def::relevant_trait_impls_provider,
@@ -2569,7 +2569,7 @@ pub fn provide_extern(providers: &mut ty::maps::Providers) {
25692569
adt_dtorck_constraint,
25702570
trait_impls_of: trait_def::trait_impls_of_provider,
25712571
relevant_trait_impls_for: trait_def::relevant_trait_impls_provider,
2572-
parameter_environment,
2572+
param_env,
25732573
..*providers
25742574
};
25752575
}

src/librustc_borrowck/borrowck/check_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub fn check_loans<'a, 'b, 'c, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
197197
dfcx_loans: dfcx_loans,
198198
move_data: move_data,
199199
all_loans: all_loans,
200-
param_env: &infcx.parameter_environment
200+
param_env: &infcx.param_env
201201
};
202202
euv::ExprUseVisitor::new(&mut clcx, &bccx.region_maps, &infcx).consume_body(body);
203203
}

src/librustc_borrowck/borrowck/mir/elaborate_drops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl MirPass for ElaborateDrops {
4444
_ => return
4545
}
4646
let id = src.item_id();
47-
let param_env = tcx.parameter_environment(tcx.hir.local_def_id(id));
47+
let param_env = tcx.param_env(tcx.hir.local_def_id(id));
4848
let move_data = MoveData::gather_moves(mir, tcx, param_env);
4949
let elaborate_patch = {
5050
let mir = &*mir;

src/librustc_borrowck/borrowck/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn borrowck_mir(bcx: &mut BorrowckCtxt,
6565
// steals it, but it forces the `borrowck` query.
6666
let mir = &tcx.mir_validated(def_id).borrow();
6767

68-
let param_env = tcx.parameter_environment(def_id);
68+
let param_env = tcx.param_env(def_id);
6969
let move_data = MoveData::gather_moves(mir, tcx, param_env);
7070
let mdpe = MoveDataParamEnv { move_data: move_data, param_env: param_env };
7171
let dead_unwinds = IdxSetBuf::new_empty(mir.basic_blocks().len());

src/librustc_const_eval/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a, 'tcx> Visitor<'tcx> for OuterVisitor<'a, 'tcx> {
5252
tcx: self.tcx,
5353
tables: self.tcx.body_tables(b),
5454
region_maps: &self.tcx.region_maps(def_id),
55-
param_env: self.tcx.parameter_environment(def_id)
55+
param_env: self.tcx.param_env(def_id)
5656
}.visit_body(self.tcx.hir.body(b));
5757
}
5858
}

src/librustc_lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnconditionalRecursion {
988988
traits::Obligation::new(traits::ObligationCause::misc(span, expr_id),
989989
trait_ref.to_poly_trait_predicate());
990990

991-
let param_env = tcx.parameter_environment(method.def_id);
991+
let param_env = tcx.param_env(method.def_id);
992992
tcx.infer_ctxt(param_env, Reveal::UserFacing).enter(|infcx| {
993993
let mut selcx = traits::SelectionContext::new(&infcx);
994994
match selcx.select(&obligation) {
@@ -1257,7 +1257,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnionsWithDropFields {
12571257
fn check_item(&mut self, ctx: &LateContext, item: &hir::Item) {
12581258
if let hir::ItemUnion(ref vdata, _) = item.node {
12591259
let item_def_id = ctx.tcx.hir.local_def_id(item.id);
1260-
let param_env = ctx.tcx.parameter_environment(item_def_id);
1260+
let param_env = ctx.tcx.param_env(item_def_id);
12611261
for field in vdata.fields() {
12621262
let field_ty = ctx.tcx.type_of(ctx.tcx.hir.local_def_id(field.id));
12631263
if field_ty.needs_drop(ctx.tcx, param_env) {

src/librustc_mir/build/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ fn create_constructor_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
172172
{
173173
let span = tcx.hir.span(ctor_id);
174174
if let hir::VariantData::Tuple(ref fields, ctor_id) = *v {
175-
let pe = tcx.parameter_environment(tcx.hir.local_def_id(ctor_id));
175+
let pe = tcx.param_env(tcx.hir.local_def_id(ctor_id));
176176
tcx.infer_ctxt(pe, Reveal::UserFacing).enter(|infcx| {
177177
let (mut mir, src) =
178178
shim::build_adt_ctor(&infcx, ctor_id, fields, span);

src/librustc_mir/hair/cx/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'a, 'gcx, 'tcx> Cx<'a, 'gcx, 'tcx> {
168168
type with inference types/regions",
169169
ty);
170170
});
171-
ty.needs_drop(self.tcx.global_tcx(), self.infcx.parameter_environment)
171+
ty.needs_drop(self.tcx.global_tcx(), self.infcx.param_env)
172172
}
173173

174174
pub fn tcx(&self) -> TyCtxt<'a, 'gcx, 'tcx> {

src/librustc_mir/shim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn build_drop_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
186186

187187
if let Some(..) = ty {
188188
let patch = {
189-
let param_env = tcx.parameter_environment(def_id);
189+
let param_env = tcx.param_env(def_id);
190190
let mut elaborator = DropShimElaborator {
191191
mir: &mir,
192192
patch: MirPatch::new(&mir),

src/librustc_mir/transform/inline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> {
220220
// FIXME: Give a bonus to functions with only a single caller
221221

222222
let def_id = tcx.hir.local_def_id(self.source.item_id());
223-
let param_env = tcx.parameter_environment(def_id);
223+
let param_env = tcx.param_env(def_id);
224224

225225
let mut first_block = true;
226226
let mut cost = 0;

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ fn mir_const_qualif<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
937937
return Qualif::NOT_CONST.bits();
938938
}
939939

940-
let param_env = tcx.parameter_environment(def_id);
940+
let param_env = tcx.param_env(def_id);
941941

942942
let mut qualifier = Qualifier::new(tcx, param_env, def_id, mir, Mode::Const);
943943
qualifier.qualify_const().bits()
@@ -965,7 +965,7 @@ impl MirPass for QualifyAndPromoteConstants {
965965
MirSource::Const(_) |
966966
MirSource::Promoted(..) => return
967967
};
968-
let param_env = tcx.parameter_environment(def_id);
968+
let param_env = tcx.param_env(def_id);
969969

970970
if mode == Mode::Fn || mode == Mode::ConstFn {
971971
// This is ugly because Qualifier holds onto mir,

src/librustc_mir/transform/type_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ impl MirPass for TypeckMir {
751751
// broken MIR, so try not to report duplicate errors.
752752
return;
753753
}
754-
let param_env = tcx.parameter_environment(def_id);
754+
let param_env = tcx.param_env(def_id);
755755
tcx.infer_ctxt(param_env, Reveal::UserFacing).enter(|infcx| {
756756
let mut checker = TypeChecker::new(&infcx, item_id);
757757
{

src/librustc_passes/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckCrateVisitor<'a, 'tcx> {
139139
}
140140

141141
let outer_penv = self.tcx.infer_ctxt(body_id, Reveal::UserFacing).enter(|infcx| {
142-
let param_env = infcx.parameter_environment.clone();
142+
let param_env = infcx.param_env.clone();
143143
let outer_penv = mem::replace(&mut self.param_env, param_env);
144144
let region_maps = &self.tcx.region_maps(item_def_id);;
145145
euv::ExprUseVisitor::new(self, region_maps, &infcx).consume_body(body);

src/librustc_typeck/check/compare_method.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
223223
let infcx = &inh.infcx;
224224

225225
debug!("compare_impl_method: caller_bounds={:?}",
226-
infcx.parameter_environment.caller_bounds);
226+
infcx.param_env.caller_bounds);
227227

228228
let mut selcx = traits::SelectionContext::new(&infcx);
229229

@@ -345,7 +345,7 @@ fn compare_predicate_entailment<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
345345
let region_maps = RegionMaps::new();
346346
let mut free_regions = FreeRegionMap::new();
347347
free_regions.relate_free_regions_from_predicates(
348-
&infcx.parameter_environment.caller_bounds);
348+
&infcx.param_env.caller_bounds);
349349
infcx.resolve_regions_and_report_errors(impl_m.def_id, &region_maps, &free_regions);
350350
} else {
351351
let fcx = FnCtxt::new(&inh, impl_m_node_id);

src/librustc_typeck/check/dropck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn ensure_drop_params_and_item_params_correspond<'a, 'tcx>(
7979

8080
// check that the impl type can be made to match the trait type.
8181

82-
let impl_param_env = tcx.parameter_environment(self_type_did);
82+
let impl_param_env = tcx.param_env(self_type_did);
8383
tcx.infer_ctxt(impl_param_env, Reveal::UserFacing).enter(|ref infcx| {
8484
let tcx = infcx.tcx;
8585
let mut fulfillment_cx = traits::FulfillmentContext::new();

src/librustc_typeck/check/method/probe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
566566
param_ty: ty::ParamTy) {
567567
// FIXME -- Do we want to commit to this behavior for param bounds?
568568

569-
let bounds: Vec<_> = self.parameter_environment
569+
let bounds: Vec<_> = self.param_env
570570
.caller_bounds
571571
.iter()
572572
.filter_map(|predicate| {
@@ -893,7 +893,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
893893
debug!("assemble_where_clause_candidates(trait_def_id={:?})",
894894
trait_def_id);
895895

896-
let caller_predicates = self.parameter_environment.caller_bounds.to_vec();
896+
let caller_predicates = self.param_env.caller_bounds.to_vec();
897897
for poly_bound in traits::elaborate_predicates(self.tcx, caller_predicates)
898898
.filter_map(|p| p.to_opt_poly_trait_ref())
899899
.filter(|b| b.def_id() == trait_def_id) {

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a, 'gcx, 'tcx> Inherited<'a, 'gcx, 'tcx> {
539539
pub fn build(tcx: TyCtxt<'a, 'gcx, 'gcx>, def_id: DefId)
540540
-> InheritedBuilder<'a, 'gcx, 'tcx> {
541541
let tables = ty::TypeckTables::empty();
542-
let param_env = tcx.parameter_environment(def_id);
542+
let param_env = tcx.param_env(def_id);
543543
InheritedBuilder {
544544
infcx: tcx.infer_ctxt((tables, param_env), Reveal::UserFacing),
545545
def_id,
@@ -1561,7 +1561,7 @@ impl<'a, 'gcx, 'tcx> AstConv<'gcx, 'tcx> for FnCtxt<'a, 'gcx, 'tcx> {
15611561
let index = generics.type_param_to_index[&def_id.index];
15621562
ty::GenericPredicates {
15631563
parent: None,
1564-
predicates: self.parameter_environment.caller_bounds.iter().filter(|predicate| {
1564+
predicates: self.param_env.caller_bounds.iter().filter(|predicate| {
15651565
match **predicate {
15661566
ty::Predicate::Trait(ref data) => {
15671567
data.0.self_ty().is_param(index)

src/librustc_typeck/check/regionck.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
138138
let subject = self.tcx.hir.local_def_id(item_id);
139139
let mut rcx = RegionCtxt::new(self, RepeatingScope(item_id), item_id, Subject(subject));
140140
rcx.free_region_map.relate_free_regions_from_predicates(
141-
&self.parameter_environment.caller_bounds);
141+
&self.param_env.caller_bounds);
142142
rcx.relate_free_regions(wf_tys, item_id, span);
143143
rcx.visit_region_obligations(item_id);
144144
rcx.resolve_regions_and_report_errors();
@@ -158,7 +158,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
158158
}
159159

160160
rcx.free_region_map.relate_free_regions_from_predicates(
161-
&self.parameter_environment.caller_bounds);
161+
&self.param_env.caller_bounds);
162162

163163
rcx.resolve_regions_and_report_errors();
164164

@@ -1682,7 +1682,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
16821682
fn declared_generic_bounds_from_env(&self, generic: GenericKind<'tcx>)
16831683
-> Vec<ty::Region<'tcx>>
16841684
{
1685-
let param_env = &self.parameter_environment;
1685+
let param_env = &self.param_env;
16861686

16871687
// To start, collect bounds from user:
16881688
let mut param_bounds = self.tcx.required_region_bounds(generic.to_ty(self.tcx),

src/librustc_typeck/coherence/builtin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn visit_implementation_of_copy<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
105105
self_type);
106106

107107
let span = tcx.hir.span(impl_node_id);
108-
let param_env = tcx.parameter_environment(impl_did);
108+
let param_env = tcx.param_env(impl_did);
109109
assert!(!self_type.has_escaping_regions());
110110

111111
debug!("visit_implementation_of_copy: self_type={:?} (free)",
@@ -199,7 +199,7 @@ pub fn coerce_unsized_info<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
199199
target);
200200

201201
let span = tcx.hir.span(impl_node_id);
202-
let param_env = tcx.parameter_environment(impl_did);
202+
let param_env = tcx.param_env(impl_did);
203203
assert!(!source.has_escaping_regions());
204204

205205
let err_info = CoerceUnsizedInfo { custom_kind: None };
@@ -387,7 +387,7 @@ pub fn coerce_unsized_info<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
387387
// Finally, resolve all regions.
388388
let region_maps = RegionMaps::new();
389389
let mut free_regions = FreeRegionMap::new();
390-
free_regions.relate_free_regions_from_predicates(&infcx.parameter_environment
390+
free_regions.relate_free_regions_from_predicates(&infcx.param_env
391391
.caller_bounds);
392392
infcx.resolve_regions_and_report_errors(impl_did, &region_maps, &free_regions);
393393

0 commit comments

Comments
 (0)