Skip to content

Commit

Permalink
Auto merge of rust-lang#67592 - matthewjasper:cleanup-match, r=Centril
Browse files Browse the repository at this point in the history
Prepare for lowering or-patterns

This is probably best reviewed commit-by-commit.

* Rustfmt `rustc_mir::build::{self, matches}`
* Remove `-Znll-dont-emit-read-for-match`
* Split `match_expr` into smaller functions
* Feature gate or-patterns in const contexts

cc rust-lang#54883

r? @Centril
  • Loading branch information
bors committed Dec 26, 2019
2 parents 3ac40b6 + 0a14cbe commit 3e0a1c0
Show file tree
Hide file tree
Showing 7 changed files with 276 additions and 135 deletions.
13 changes: 0 additions & 13 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 3e0a1c0

Please sign in to comment.