Skip to content

Commit 428e6cb

Browse files
committed
Remove unused param_env parameter
1 parent 5fd47f5 commit 428e6cb

File tree

7 files changed

+5
-33
lines changed

7 files changed

+5
-33
lines changed

src/librustc_mir/borrow_check/constraint_generation.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use crate::borrow_check::{
2020

2121
pub(super) fn generate_constraints<'cx, 'tcx>(
2222
infcx: &InferCtxt<'cx, 'tcx>,
23-
param_env: ty::ParamEnv<'tcx>,
2423
liveness_constraints: &mut LivenessValues<RegionVid>,
2524
all_facts: &mut Option<AllFacts>,
2625
location_table: &LocationTable,
@@ -34,7 +33,6 @@ pub(super) fn generate_constraints<'cx, 'tcx>(
3433
location_table,
3534
all_facts,
3635
body,
37-
param_env,
3836
};
3937

4038
for (bb, data) in body.basic_blocks().iter_enumerated() {
@@ -45,7 +43,6 @@ pub(super) fn generate_constraints<'cx, 'tcx>(
4543
/// 'cg = the duration of the constraint generation process itself.
4644
struct ConstraintGeneration<'cg, 'cx, 'tcx> {
4745
infcx: &'cg InferCtxt<'cx, 'tcx>,
48-
param_env: ty::ParamEnv<'tcx>,
4946
all_facts: &'cg mut Option<AllFacts>,
5047
location_table: &'cg LocationTable,
5148
liveness_constraints: &'cg mut LivenessValues<RegionVid>,
@@ -263,7 +260,6 @@ impl<'cx, 'cg, 'tcx> ConstraintGeneration<'cx, 'cg, 'tcx> {
263260
for &borrow_index in borrow_indices {
264261
let places_conflict = places_conflict::places_conflict(
265262
self.infcx.tcx,
266-
self.param_env,
267263
self.body,
268264
&self.borrow_set.borrows[borrow_index].borrowed_place,
269265
place,

src/librustc_mir/borrow_check/invalidation.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc::ty::{self, TyCtxt};
1+
use rustc::ty::TyCtxt;
22
use rustc::mir::visit::Visitor;
33
use rustc::mir::{BasicBlock, Location, Body, Place, ReadOnlyBodyAndCache, Rvalue};
44
use rustc::mir::{Statement, StatementKind};
@@ -19,7 +19,6 @@ use crate::borrow_check::{
1919

2020
pub(super) fn generate_invalidates<'tcx>(
2121
tcx: TyCtxt<'tcx>,
22-
param_env: ty::ParamEnv<'tcx>,
2322
all_facts: &mut Option<AllFacts>,
2423
location_table: &LocationTable,
2524
body: ReadOnlyBodyAndCache<'_, 'tcx>,
@@ -36,7 +35,6 @@ pub(super) fn generate_invalidates<'tcx>(
3635
let mut ig = InvalidationGenerator {
3736
all_facts,
3837
borrow_set,
39-
param_env,
4038
tcx,
4139
location_table,
4240
body: &body,
@@ -48,7 +46,6 @@ pub(super) fn generate_invalidates<'tcx>(
4846

4947
struct InvalidationGenerator<'cx, 'tcx> {
5048
tcx: TyCtxt<'tcx>,
51-
param_env: ty::ParamEnv<'tcx>,
5249
all_facts: &'cx mut AllFacts,
5350
location_table: &'cx LocationTable,
5451
body: &'cx Body<'tcx>,
@@ -421,13 +418,11 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
421418
);
422419
let tcx = self.tcx;
423420
let body = self.body;
424-
let param_env = self.param_env;
425421
let borrow_set = self.borrow_set.clone();
426422
let indices = self.borrow_set.borrows.indices();
427423
each_borrow_involving_path(
428424
self,
429425
tcx,
430-
param_env,
431426
body,
432427
location,
433428
(sd, place),

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ fn do_mir_borrowck<'a, 'tcx>(
241241
def_id,
242242
&attributes,
243243
&dead_unwinds,
244-
Borrows::new(tcx, &body, param_env, regioncx.clone(), &borrow_set),
244+
Borrows::new(tcx, &body, regioncx.clone(), &borrow_set),
245245
|rs, i| DebugFormatted::new(&rs.location(i)),
246246
));
247247
let flow_uninits = FlowAtLocation::new(do_dataflow(
@@ -277,7 +277,6 @@ fn do_mir_borrowck<'a, 'tcx>(
277277
infcx,
278278
body,
279279
mir_def_id: def_id,
280-
param_env,
281280
move_data: &mdpe.move_data,
282281
location_table,
283282
movable_generator,
@@ -416,7 +415,6 @@ crate struct MirBorrowckCtxt<'cx, 'tcx> {
416415
crate infcx: &'cx InferCtxt<'cx, 'tcx>,
417416
body: ReadOnlyBodyAndCache<'cx, 'tcx>,
418417
mir_def_id: DefId,
419-
param_env: ty::ParamEnv<'tcx>,
420418
move_data: &'cx MoveData<'tcx>,
421419

422420
/// Map from MIR `Location` to `LocationIndex`; created
@@ -1001,13 +999,11 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1001999
let tcx = self.infcx.tcx;
10021000
let body = self.body;
10031001
let body: &Body<'_> = &body;
1004-
let param_env = self.param_env;
10051002
let location_table = self.location_table.start_index(location);
10061003
let borrow_set = self.borrow_set.clone();
10071004
each_borrow_involving_path(
10081005
self,
10091006
tcx,
1010-
param_env,
10111007
body,
10121008
location,
10131009
(sd, place_span.0),
@@ -1495,7 +1491,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
14951491

14961492
if places_conflict::borrow_conflicts_with_place(
14971493
self.infcx.tcx,
1498-
self.param_env,
14991494
&self.body,
15001495
place,
15011496
borrow.kind,

src/librustc_mir/borrow_check/nll.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>(
249249

250250
constraint_generation::generate_constraints(
251251
infcx,
252-
param_env,
253252
&mut liveness_constraints,
254253
&mut all_facts,
255254
location_table,
@@ -273,7 +272,6 @@ pub(in crate::borrow_check) fn compute_regions<'cx, 'tcx>(
273272
// Generate various additional constraints.
274273
invalidation::generate_invalidates(
275274
infcx.tcx,
276-
param_env,
277275
&mut all_facts,
278276
location_table,
279277
body,

src/librustc_mir/borrow_check/path_utils.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::borrow_check::AccessDepth;
44
use crate::dataflow::indexes::BorrowIndex;
55
use rustc::mir::{BasicBlock, Location, Body, Place, PlaceBase};
66
use rustc::mir::BorrowKind;
7-
use rustc::ty::{self, TyCtxt};
7+
use rustc::ty::TyCtxt;
88
use rustc_data_structures::graph::dominators::Dominators;
99

1010
/// Returns `true` if the borrow represented by `kind` is
@@ -25,7 +25,6 @@ pub(super) enum Control {
2525
pub(super) fn each_borrow_involving_path<'tcx, F, I, S>(
2626
s: &mut S,
2727
tcx: TyCtxt<'tcx>,
28-
param_env: ty::ParamEnv<'tcx>,
2928
body: &Body<'tcx>,
3029
_location: Location,
3130
access_place: (AccessDepth, &Place<'tcx>),
@@ -48,7 +47,6 @@ pub(super) fn each_borrow_involving_path<'tcx, F, I, S>(
4847

4948
if places_conflict::borrow_conflicts_with_place(
5049
tcx,
51-
param_env,
5250
body,
5351
&borrowed.borrowed_place,
5452
borrowed.kind,

src/librustc_mir/borrow_check/places_conflict.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ crate enum PlaceConflictBias {
2323
/// dataflow).
2424
crate fn places_conflict<'tcx>(
2525
tcx: TyCtxt<'tcx>,
26-
param_env: ty::ParamEnv<'tcx>,
2726
body: &Body<'tcx>,
2827
borrow_place: &Place<'tcx>,
2928
access_place: &Place<'tcx>,
3029
bias: PlaceConflictBias,
3130
) -> bool {
3231
borrow_conflicts_with_place(
3332
tcx,
34-
param_env,
3533
body,
3634
borrow_place,
3735
BorrowKind::Mut { allow_two_phase_borrow: true },
@@ -47,7 +45,6 @@ crate fn places_conflict<'tcx>(
4745
/// order to make the conservative choice and preserve soundness.
4846
pub(super) fn borrow_conflicts_with_place<'tcx>(
4947
tcx: TyCtxt<'tcx>,
50-
param_env: ty::ParamEnv<'tcx>,
5148
body: &Body<'tcx>,
5249
borrow_place: &Place<'tcx>,
5350
borrow_kind: BorrowKind,
@@ -70,7 +67,6 @@ pub(super) fn borrow_conflicts_with_place<'tcx>(
7067

7168
place_components_conflict(
7269
tcx,
73-
param_env,
7470
body,
7571
borrow_place,
7672
borrow_kind,
@@ -82,7 +78,6 @@ pub(super) fn borrow_conflicts_with_place<'tcx>(
8278

8379
fn place_components_conflict<'tcx>(
8480
tcx: TyCtxt<'tcx>,
85-
param_env: ty::ParamEnv<'tcx>,
8681
body: &Body<'tcx>,
8782
borrow_place: &Place<'tcx>,
8883
borrow_kind: BorrowKind,
@@ -135,7 +130,7 @@ fn place_components_conflict<'tcx>(
135130
let borrow_base = &borrow_place.base;
136131
let access_base = access_place.base;
137132

138-
match place_base_conflict(tcx, param_env, borrow_base, access_base) {
133+
match place_base_conflict(tcx, borrow_base, access_base) {
139134
Overlap::Arbitrary => {
140135
bug!("Two base can't return Arbitrary");
141136
}
@@ -310,7 +305,6 @@ fn place_components_conflict<'tcx>(
310305
// between `elem1` and `elem2`.
311306
fn place_base_conflict<'tcx>(
312307
tcx: TyCtxt<'tcx>,
313-
_param_env: ty::ParamEnv<'tcx>,
314308
elem1: &PlaceBase<'tcx>,
315309
elem2: &PlaceBase<'tcx>,
316310
) -> Overlap {

src/librustc_mir/dataflow/impls/borrows.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc::mir::{self, Location, Place, PlaceBase, Body};
2-
use rustc::ty::{self, TyCtxt};
2+
use rustc::ty::TyCtxt;
33
use rustc::ty::RegionVid;
44

55
use rustc_index::bit_set::BitSet;
@@ -30,7 +30,6 @@ rustc_index::newtype_index! {
3030
pub struct Borrows<'a, 'tcx> {
3131
tcx: TyCtxt<'tcx>,
3232
body: &'a Body<'tcx>,
33-
param_env: ty::ParamEnv<'tcx>,
3433

3534
borrow_set: Rc<BorrowSet<'tcx>>,
3635
borrows_out_of_scope_at_location: FxHashMap<Location, Vec<BorrowIndex>>,
@@ -136,7 +135,6 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
136135
crate fn new(
137136
tcx: TyCtxt<'tcx>,
138137
body: &'a Body<'tcx>,
139-
param_env: ty::ParamEnv<'tcx>,
140138
nonlexical_regioncx: Rc<RegionInferenceContext<'tcx>>,
141139
borrow_set: &Rc<BorrowSet<'tcx>>,
142140
) -> Self {
@@ -153,7 +151,6 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
153151
Borrows {
154152
tcx,
155153
body,
156-
param_env,
157154
borrow_set: borrow_set.clone(),
158155
borrows_out_of_scope_at_location,
159156
_nonlexical_regioncx: nonlexical_regioncx,
@@ -221,7 +218,6 @@ impl<'a, 'tcx> Borrows<'a, 'tcx> {
221218
.filter(|&&i| {
222219
places_conflict(
223220
self.tcx,
224-
self.param_env,
225221
self.body,
226222
&self.borrow_set.borrows[i].borrowed_place,
227223
place,

0 commit comments

Comments
 (0)