Add a pass that checks for unreachable alt arms

This commit is contained in:
Marijn Haverbeke 2011-07-25 13:45:09 +02:00
parent bd81adabff
commit beab6ba8aa
5 changed files with 115 additions and 2 deletions

View file

@ -138,6 +138,8 @@ fn compile_input(session::session sess, ast::crate_cfg cfg, str input,
auto ty_cx = ty::mk_ctxt(sess, d, ast_map, freevars);
time[()](time_passes, "typechecking",
bind typeck::check_crate(ty_cx, crate));
time[()](time_passes, "alt checking",
bind middle::check_alt::check_crate(ty_cx, crate));
if (sess.get_opts().run_typestate) {
time(time_passes, "typestate checking",
bind middle::tstate::ck::check_crate(ty_cx, crate));