diff options
| -rw-r--r-- | src/librustc/ty/context.rs | 13 | ||||
| -rw-r--r-- | src/librustc_mir/build/matches/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustc_session/options.rs | 2 |
3 files changed, 1 insertions, 22 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 39341de6367..e99e00a366d 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -1370,19 +1370,6 @@ impl<'tcx> TyCtxt<'tcx> { self.borrowck_mode().migrate() } - /// If `true`, make MIR codegen for `match` emit a temp that holds a - /// borrow of the input to the match expression. - pub fn generate_borrow_of_any_match_input(&self) -> bool { - self.emit_read_for_match() - } - - /// If `true`, make MIR codegen for `match` emit FakeRead - /// statements (which simulate the maximal effect of executing the - /// patterns in a match arm). - pub fn emit_read_for_match(&self) -> bool { - !self.sess.opts.debugging_opts.nll_dont_emit_read_for_match - } - /// What mode(s) of borrowck should we run? AST? MIR? both? /// (Also considers the `#![feature(nll)]` setting.) pub fn borrowck_mode(&self) -> BorrowckMode { diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs index e1a51e2fb35..60049a3a9fe 100644 --- a/src/librustc_mir/build/matches/mod.rs +++ b/src/librustc_mir/build/matches/mod.rs @@ -108,8 +108,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { scrutinee: ExprRef<'tcx>, arms: Vec<Arm<'tcx>>, ) -> BlockAnd<()> { - let tcx = self.hir.tcx(); - // Step 1. Evaluate the scrutinee and add the fake read of it. let scrutinee_span = scrutinee.span(); @@ -183,11 +181,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // The set of places that we are creating fake borrows of. If there are // no match guards then we don't need any fake borrows, so don't track // them. - let mut fake_borrows = if match_has_guard && tcx.generate_borrow_of_any_match_input() { - Some(FxHashSet::default()) - } else { - None - }; + let mut fake_borrows = if match_has_guard { Some(FxHashSet::default()) } else { None }; // These candidates are kept sorted such that the highest priority // candidate comes first in the list. (i.e., same order as in source) diff --git a/src/librustc_session/options.rs b/src/librustc_session/options.rs index c90213f0958..38c17bbbde7 100644 --- a/src/librustc_session/options.rs +++ b/src/librustc_session/options.rs @@ -872,8 +872,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "choose which RELRO level to use"), nll_facts: bool = (false, parse_bool, [UNTRACKED], "dump facts from NLL analysis into side files"), - nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED], - "in match codegen, do not include FakeRead statements (used by mir-borrowck)"), dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED], "emit diagnostics rather than buffering (breaks NLL error downgrading, sorting)."), polonius: bool = (false, parse_bool, [UNTRACKED], |
