Skip to content

Commit

Permalink
Add note to address check_match errors
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Mar 23, 2019
1 parent afdc38d commit 5723632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/build/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
self.simplify_candidate(&mut candidate);

if !candidate.match_pairs.is_empty() {
// Only abort compilation if no other errors have been emitted. This used to be a hard
// error that wouldn't be reached because `hair::pattern::check_match::check_match`
// wouldn't have let the compiler continue. In our tests this is only ever hit by
// ICE if no other errors have been emitted. This used to be a hard error that wouldn't
// be reached because `hair::pattern::check_match::check_match` wouldn't have let the
// compiler continue. In our tests this is only ever hit by
// `ui/consts/const-match-check.rs` with `--cfg eval1`, and that file already generates
// a different error before hand.
self.hir.tcx().sess.delay_span_bug(
Expand Down
1 change: 1 addition & 0 deletions src/librustc_mir/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
let tables = tcx.typeck_tables_of(def_id);

// Do match-check before building MIR
// FIXME(#59378) check_match may have errored but we're not checking for that anymore
tcx.check_match(def_id);

if let hir::BodyOwnerKind::Const = tcx.hir().body_owner_kind_by_hir_id(id) {
Expand Down

0 comments on commit 5723632

Please sign in to comment.