1
Fork 0

Run check_match and check_liveness when MIR is built instead of having an explicit phase for them

This commit is contained in:
Oli Scherer 2023-02-16 10:06:59 +00:00
parent 5bb58a68de
commit 334423263a
18 changed files with 321 additions and 328 deletions

View file

@ -98,6 +98,7 @@ use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{self, RootVariableMinCaptureList, Ty, TyCtxt};
use rustc_session::lint;
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::DUMMY_SP;
use rustc_span::{BytePos, Span};
use std::collections::VecDeque;
@ -586,8 +587,13 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
}
fn assigned_on_exit(&self, ln: LiveNode, var: Variable) -> bool {
let successor = self.successors[ln].unwrap();
self.assigned_on_entry(successor, var)
match self.successors[ln] {
Some(successor) => self.assigned_on_entry(successor, var),
None => {
self.ir.tcx.sess.delay_span_bug(DUMMY_SP, "no successor");
true
}
}
}
fn write_vars<F>(&self, wr: &mut dyn Write, mut test: F) -> io::Result<()>