diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 43d138c9e1a..2e2bf37da77 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -5,7 +5,7 @@ import syntax::parse::{parser, token}; import syntax::{ast, codemap}; import front::attr; -import middle::{trans, resolve, freevars, kind, ty, typeck, unsafeck}; +import middle::{trans, resolve, freevars, kind, ty, typeck, fn_usage}; import middle::tstate::ck; import syntax::print::{pp, pprust}; import util::{ppaux, common, filesearch}; @@ -129,8 +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, "function usage", + bind fn_usage::check_crate_fn_usage(ty_cx, crate)); time(time_passes, "alt checking", bind middle::check_alt::check_crate(ty_cx, crate)); if sess.get_opts().run_typestate { diff --git a/src/comp/middle/unsafeck.rs b/src/comp/middle/fn_usage.rs similarity index 76% rename from src/comp/middle/unsafeck.rs rename to src/comp/middle/fn_usage.rs index 251258f11a8..3e170f19d16 100644 --- a/src/comp/middle/unsafeck.rs +++ b/src/comp/middle/fn_usage.rs @@ -3,22 +3,22 @@ import std::option::some; import syntax::print::pprust::{expr_to_str, path_to_str}; -export unsafeck_crate; +export check_crate_fn_usage; -type unsafe_ctx = { +type fn_usage_ctx = { tcx: ty::ctxt, unsafe_fn_legal: bool }; -fn unsafeck_view_item(_vi: @ast::view_item, - _ctx: unsafe_ctx, - _v: visit::vt) { +fn fn_usage_view_item(_vi: @ast::view_item, + _ctx: fn_usage_ctx, + _v: visit::vt) { // Ignore paths that appear in use, import, etc } -fn unsafeck_expr(expr: @ast::expr, - ctx: unsafe_ctx, - v: visit::vt) { +fn fn_usage_expr(expr: @ast::expr, + ctx: fn_usage_ctx, + v: visit::vt) { alt expr.node { ast::expr_path(path) { if !ctx.unsafe_fn_legal { @@ -51,11 +51,11 @@ fn unsafeck_expr(expr: @ast::expr, } } -fn unsafeck_crate(tcx: ty::ctxt, crate: @ast::crate) { +fn check_crate_fn_usage(tcx: ty::ctxt, crate: @ast::crate) { let visit = visit::mk_vt( - @{visit_expr: unsafeck_expr, - visit_view_item: unsafeck_view_item + @{visit_expr: fn_usage_expr, + visit_view_item: fn_usage_view_item with *visit::default_visitor()}); let ctx = {tcx: tcx, unsafe_fn_legal: false}; visit::visit_crate(*crate, ctx, visit); diff --git a/src/comp/rustc.rc b/src/comp/rustc.rc index 2f861155e1c..34170db8131 100644 --- a/src/comp/rustc.rc +++ b/src/comp/rustc.rc @@ -25,7 +25,7 @@ mod middle { mod ast_map; mod resolve; mod typeck; - mod unsafeck; + mod fn_usage; mod check_alt; mod mut; mod alias;