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
}

0 commit comments

Comments
 (0)