Skip to content

Commit b16985a

Browse files
committed
Remove mir::StatementKind::EndRegion
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
1 parent f37247f commit b16985a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+33
-1283
lines changed

src/librustc/ich/impls_mir.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ for mir::StatementKind<'gcx> {
217217
mir::StatementKind::StorageDead(ref place) => {
218218
place.hash_stable(hcx, hasher);
219219
}
220-
mir::StatementKind::EndRegion(ref region_scope) => {
221-
region_scope.hash_stable(hcx, hasher);
222-
}
223220
mir::StatementKind::EscapeToRaw(ref place) => {
224221
place.hash_stable(hcx, hasher);
225222
}

src/librustc/mir/mod.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use hir::def::CtorKind;
1616
use hir::def_id::DefId;
1717
use hir::{self, HirId, InlineAsm};
18-
use middle::region;
1918
use mir::interpret::{ConstValue, EvalErrorKind, Scalar};
2019
use mir::visit::MirVisitable;
2120
use rustc_apfloat::ieee::{Double, Single};
@@ -1789,10 +1788,6 @@ pub enum StatementKind<'tcx> {
17891788
/// for more details.
17901789
EscapeToRaw(Operand<'tcx>),
17911790

1792-
/// Mark one terminating point of a region scope (i.e. static region).
1793-
/// (The starting point(s) arise implicitly from borrows.)
1794-
EndRegion(region::Scope),
1795-
17961791
/// Encodes a user's type ascription. These need to be preserved
17971792
/// intact so that NLL can respect them. For example:
17981793
///
@@ -1846,8 +1841,6 @@ impl<'tcx> Debug for Statement<'tcx> {
18461841
match self.kind {
18471842
Assign(ref place, ref rv) => write!(fmt, "{:?} = {:?}", place, rv),
18481843
FakeRead(ref cause, ref place) => write!(fmt, "FakeRead({:?}, {:?})", cause, place),
1849-
// (reuse lifetime rendering policy from ppaux.)
1850-
EndRegion(ref ce) => write!(fmt, "EndRegion({})", ty::ReScope(*ce)),
18511844
Retag { fn_entry, ref place } =>
18521845
write!(fmt, "Retag({}{:?})", if fn_entry { "[fn entry] " } else { "" }, place),
18531846
EscapeToRaw(ref place) => write!(fmt, "EscapeToRaw({:?})", place),
@@ -3028,7 +3021,6 @@ EnumTypeFoldableImpl! {
30283021
(StatementKind::InlineAsm) { asm, outputs, inputs },
30293022
(StatementKind::Retag) { fn_entry, place },
30303023
(StatementKind::EscapeToRaw)(place),
3031-
(StatementKind::EndRegion)(a),
30323024
(StatementKind::AscribeUserType)(a, v, b),
30333025
(StatementKind::Nop),
30343026
}

src/librustc/mir/visit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ macro_rules! make_mir_visitor {
377377
location
378378
);
379379
}
380-
StatementKind::EndRegion(_) => {}
381380
StatementKind::SetDiscriminant{ ref $($mutability)* place, .. } => {
382381
self.visit_place(
383382
place,

src/librustc/session/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,8 +1149,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
11491149
"when debug-printing compiler state, do not include spans"), // o/w tests have closure@path
11501150
identify_regions: bool = (false, parse_bool, [UNTRACKED],
11511151
"make unnamed regions display as '# (where # is some non-ident unique id)"),
1152-
emit_end_regions: bool = (false, parse_bool, [UNTRACKED],
1153-
"emit EndRegion as part of MIR; enable transforms that solely process EndRegion"),
11541152
borrowck: Option<String> = (None, parse_opt_string, [UNTRACKED],
11551153
"select which borrowck is used (`ast`, `mir`, `migrate`, or `compare`)"),
11561154
two_phase_borrows: bool = (false, parse_bool, [UNTRACKED],

src/librustc/ty/context.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,13 +1540,6 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
15401540
}
15411541
}
15421542

1543-
/// Should we emit EndRegion MIR statements? These are consumed by
1544-
/// MIR borrowck, but not when NLL is used.
1545-
pub fn emit_end_regions(self) -> bool {
1546-
self.sess.opts.debugging_opts.emit_end_regions ||
1547-
self.use_mir_borrowck()
1548-
}
1549-
15501543
#[inline]
15511544
pub fn local_crate_exports_generics(self) -> bool {
15521545
debug_assert!(self.sess.opts.share_generics());

src/librustc_codegen_ssa/mir/statement.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
105105
bx
106106
}
107107
mir::StatementKind::FakeRead(..) |
108-
mir::StatementKind::EndRegion(..) |
109108
mir::StatementKind::Retag { .. } |
110109
mir::StatementKind::EscapeToRaw { .. } |
111110
mir::StatementKind::AscribeUserType(..) |

src/librustc_mir/borrow_check/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,6 @@ impl<'cx, 'gcx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx
592592
self.consume_operand(context, (input, span), flow_state);
593593
}
594594
}
595-
StatementKind::EndRegion(ref _rgn) => {
596-
// ignored when consuming results (update to
597-
// flow_state already handled).
598-
}
599595
StatementKind::Nop
600596
| StatementKind::AscribeUserType(..)
601597
| StatementKind::Retag { .. }

src/librustc_mir/borrow_check/nll/invalidation.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ impl<'cx, 'tcx, 'gcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx, 'gcx> {
132132
self.consume_operand(context, input);
133133
}
134134
}
135-
// EndRegion matters to older NLL/MIR AST borrowck, not to alias NLL
136-
StatementKind::EndRegion(..) |
137135
StatementKind::Nop |
138136
StatementKind::AscribeUserType(..) |
139137
StatementKind::Retag { .. } |

src/librustc_mir/borrow_check/nll/renumber.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use rustc::ty::subst::Substs;
1212
use rustc::ty::{self, ClosureSubsts, GeneratorSubsts, Ty, TypeFoldable};
13-
use rustc::mir::{BasicBlock, Location, Mir, Statement, StatementKind, UserTypeAnnotation};
13+
use rustc::mir::{Location, Mir, UserTypeAnnotation};
1414
use rustc::mir::visit::{MutVisitor, TyContext};
1515
use rustc::infer::{InferCtxt, NLLRegionVariableOrigin};
1616

@@ -119,16 +119,4 @@ impl<'a, 'gcx, 'tcx> MutVisitor<'tcx> for NLLVisitor<'a, 'gcx, 'tcx> {
119119

120120
debug!("visit_closure_substs: substs={:?}", substs);
121121
}
122-
123-
fn visit_statement(
124-
&mut self,
125-
block: BasicBlock,
126-
statement: &mut Statement<'tcx>,
127-
location: Location,
128-
) {
129-
if let StatementKind::EndRegion(_) = statement.kind {
130-
statement.kind = StatementKind::Nop;
131-
}
132-
self.super_statement(block, statement, location);
133-
}
134122
}

src/librustc_mir/borrow_check/nll/type_check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,6 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> {
13141314
| StatementKind::StorageLive(..)
13151315
| StatementKind::StorageDead(..)
13161316
| StatementKind::InlineAsm { .. }
1317-
| StatementKind::EndRegion(_)
13181317
| StatementKind::Retag { .. }
13191318
| StatementKind::EscapeToRaw { .. }
13201319
| StatementKind::Nop => {}

0 commit comments

Comments
 (0)