Skip to content

Commit 18df721

Browse files
committed
Remove -Znll-dont-emit-read-for-match
1 parent 83a8200 commit 18df721

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

src/librustc/ty/context.rs

-13
Original file line numberDiff line numberDiff line change
@@ -1370,19 +1370,6 @@ impl<'tcx> TyCtxt<'tcx> {
13701370
self.borrowck_mode().migrate()
13711371
}
13721372

1373-
/// If `true`, make MIR codegen for `match` emit a temp that holds a
1374-
/// borrow of the input to the match expression.
1375-
pub fn generate_borrow_of_any_match_input(&self) -> bool {
1376-
self.emit_read_for_match()
1377-
}
1378-
1379-
/// If `true`, make MIR codegen for `match` emit FakeRead
1380-
/// statements (which simulate the maximal effect of executing the
1381-
/// patterns in a match arm).
1382-
pub fn emit_read_for_match(&self) -> bool {
1383-
!self.sess.opts.debugging_opts.nll_dont_emit_read_for_match
1384-
}
1385-
13861373
/// What mode(s) of borrowck should we run? AST? MIR? both?
13871374
/// (Also considers the `#![feature(nll)]` setting.)
13881375
pub fn borrowck_mode(&self) -> BorrowckMode {

src/librustc_mir/build/matches/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
108108
scrutinee: ExprRef<'tcx>,
109109
arms: Vec<Arm<'tcx>>,
110110
) -> BlockAnd<()> {
111-
let tcx = self.hir.tcx();
112-
113111
// Step 1. Evaluate the scrutinee and add the fake read of it.
114112

115113
let scrutinee_span = scrutinee.span();
@@ -183,11 +181,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
183181
// The set of places that we are creating fake borrows of. If there are
184182
// no match guards then we don't need any fake borrows, so don't track
185183
// them.
186-
let mut fake_borrows = if match_has_guard && tcx.generate_borrow_of_any_match_input() {
187-
Some(FxHashSet::default())
188-
} else {
189-
None
190-
};
184+
let mut fake_borrows = if match_has_guard { Some(FxHashSet::default()) } else { None };
191185

192186
// These candidates are kept sorted such that the highest priority
193187
// candidate comes first in the list. (i.e., same order as in source)

src/librustc_session/options.rs

-2
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
872872
"choose which RELRO level to use"),
873873
nll_facts: bool = (false, parse_bool, [UNTRACKED],
874874
"dump facts from NLL analysis into side files"),
875-
nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
876-
"in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
877875
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],
878876
"emit diagnostics rather than buffering (breaks NLL error downgrading, sorting)."),
879877
polonius: bool = (false, parse_bool, [UNTRACKED],

0 commit comments

Comments
 (0)