add pass to check that unsafe fns cannot be used as values
This commit is contained in:
parent
e39db5a100
commit
81533ff737
4 changed files with 85 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import metadata::{creader, cstore};
|
|||
import syntax::parse::{parser, token};
|
||||
import syntax::{ast, codemap};
|
||||
import front::attr;
|
||||
import middle::{trans, resolve, freevars, kind, ty, typeck};
|
||||
import middle::{trans, resolve, freevars, kind, ty, typeck, unsafeck};
|
||||
import middle::tstate::ck;
|
||||
import syntax::print::{pp, pprust};
|
||||
import util::{ppaux, common, filesearch};
|
||||
|
|
@ -129,6 +129,8 @@ fn compile_input(sess: session::session, cfg: ast::crate_cfg, input: str,
|
|||
bind freevars::annotate_freevars(def_map, crate));
|
||||
let ty_cx = ty::mk_ctxt(sess, def_map, ext_map, ast_map, freevars);
|
||||
time(time_passes, "typechecking", bind typeck::check_crate(ty_cx, crate));
|
||||
time(time_passes, "unsafechecking",
|
||||
bind unsafeck::unsafeck_crate(ty_cx, crate));
|
||||
time(time_passes, "alt checking",
|
||||
bind middle::check_alt::check_crate(ty_cx, crate));
|
||||
if sess.get_opts().run_typestate {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue