Remove -Znll-dont-emit-read-for-match

This commit is contained in:
Matthew Jasper 2019-12-24 14:31:03 +00:00
parent 83a820047f
commit 18df72142a
3 changed files with 1 additions and 22 deletions

View file

@ -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 {

View file

@ -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)

View file

@ -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],