Promote 'impl' from restricted keyword to strict
This commit is contained in:
parent
3d2a74a160
commit
be1fdf983f
|
@ -188,13 +188,13 @@ mod global_env {
|
|||
loop {
|
||||
match comm::select2(msg_po, weak_po) {
|
||||
either::Left(MsgGetEnv(n, resp_ch)) => {
|
||||
comm::send(resp_ch, impl::getenv(n))
|
||||
comm::send(resp_ch, impl_::getenv(n))
|
||||
}
|
||||
either::Left(MsgSetEnv(n, v, resp_ch)) => {
|
||||
comm::send(resp_ch, impl::setenv(n, v))
|
||||
comm::send(resp_ch, impl_::setenv(n, v))
|
||||
}
|
||||
either::Left(MsgEnv(resp_ch)) => {
|
||||
comm::send(resp_ch, impl::env())
|
||||
comm::send(resp_ch, impl_::env())
|
||||
}
|
||||
either::Right(_) => break
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ mod global_env {
|
|||
}
|
||||
}
|
||||
|
||||
mod impl {
|
||||
mod impl_ {
|
||||
extern mod rustrt {
|
||||
fn rust_env_pairs() -> ~[~str];
|
||||
}
|
||||
|
|
|
@ -416,7 +416,6 @@ fn restricted_keyword_table() -> HashMap<~str, ()> {
|
|||
let keys = ~[
|
||||
~"const", ~"copy",
|
||||
~"fail", ~"fn",
|
||||
~"impl",
|
||||
~"unsafe"
|
||||
];
|
||||
for keys.each |word| {
|
||||
|
@ -434,7 +433,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
|
|||
~"do", ~"drop",
|
||||
~"else", ~"enum", ~"export", ~"extern",
|
||||
~"false", ~"for",
|
||||
~"if",
|
||||
~"if", ~"impl",
|
||||
~"let", ~"log", ~"loop",
|
||||
~"match", ~"mod", ~"move", ~"mut",
|
||||
~"priv", ~"pub", ~"pure",
|
||||
|
|
|
@ -1838,7 +1838,7 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
|
|||
}
|
||||
}
|
||||
ast::item_impl(tps, _, _, ms) => {
|
||||
impl::trans_impl(ccx, *path, item.ident, ms, tps);
|
||||
meth::trans_impl(ccx, *path, item.ident, ms, tps);
|
||||
}
|
||||
ast::item_mod(m) => {
|
||||
trans_mod(ccx, m);
|
||||
|
@ -1890,7 +1890,7 @@ fn trans_struct_def(ccx: @crate_ctxt, struct_def: @ast::struct_def,
|
|||
// If there are ty params, the ctor will get monomorphized
|
||||
|
||||
// Translate methods
|
||||
impl::trans_impl(ccx, *path, ident, struct_def.methods, tps);
|
||||
meth::trans_impl(ccx, *path, ident, struct_def.methods, tps);
|
||||
}
|
||||
|
||||
fn trans_trait(ccx: @crate_ctxt, tps: ~[ast::ty_param],
|
||||
|
@ -1898,7 +1898,7 @@ fn trans_trait(ccx: @crate_ctxt, tps: ~[ast::ty_param],
|
|||
path: @ast_map::path, ident: ast::ident) {
|
||||
// Translate any methods that have provided implementations
|
||||
let (_, provided_methods) = ast_util::split_trait_methods(trait_methods);
|
||||
impl::trans_impl(ccx, *path, ident, provided_methods, tps);
|
||||
meth::trans_impl(ccx, *path, ident, provided_methods, tps);
|
||||
}
|
||||
|
||||
// Translate a module. Doing this amounts to translating the items in the
|
||||
|
|
|
@ -53,7 +53,7 @@ fn trans(bcx: block, expr: @ast::expr) -> Callee {
|
|||
ast::expr_field(base, _, _) => {
|
||||
match bcx.ccx().maps.method_map.find(expr.id) {
|
||||
Some(origin) => { // An impl method
|
||||
return impl::trans_method_callee(bcx, expr.id,
|
||||
return meth::trans_method_callee(bcx, expr.id,
|
||||
base, origin);
|
||||
}
|
||||
None => {} // not a method, just a field
|
||||
|
@ -79,7 +79,7 @@ fn trans(bcx: block, expr: @ast::expr) -> Callee {
|
|||
fn_callee(bcx, trans_fn_ref(bcx, did, ref_expr.id))
|
||||
}
|
||||
ast::def_static_method(did, _) => {
|
||||
fn_callee(bcx, impl::trans_static_method_callee(bcx, did,
|
||||
fn_callee(bcx, meth::trans_static_method_callee(bcx, did,
|
||||
ref_expr.id))
|
||||
}
|
||||
ast::def_variant(tid, vid) => {
|
||||
|
|
|
@ -1207,7 +1207,7 @@ fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
|
|||
fn node_vtables(bcx: block, id: ast::node_id) -> Option<typeck::vtable_res> {
|
||||
let raw_vtables = bcx.ccx().maps.vtable_map.find(id);
|
||||
raw_vtables.map(
|
||||
|vts| impl::resolve_vtables_in_fn_ctxt(bcx.fcx, vts))
|
||||
|vts| meth::resolve_vtables_in_fn_ctxt(bcx.fcx, vts))
|
||||
}
|
||||
|
||||
fn resolve_vtables_in_fn_ctxt(fcx: fn_ctxt, vts: typeck::vtable_res)
|
||||
|
|
|
@ -519,7 +519,7 @@ fn trans_rvalue_dps(bcx: block, expr: @ast::expr, dest: Dest) -> block {
|
|||
return trans_overloaded_op(bcx, expr, base, ~[idx], dest);
|
||||
}
|
||||
ast::expr_cast(val, _) => {
|
||||
return impl::trans_trait_cast(bcx, val, expr.id, dest);
|
||||
return meth::trans_trait_cast(bcx, val, expr.id, dest);
|
||||
}
|
||||
ast::expr_assign_op(op, dst, src) => {
|
||||
return trans_assign_op(bcx, expr, op, dst, src);
|
||||
|
@ -549,7 +549,7 @@ fn trans_def_dps(bcx: block, ref_expr: @ast::expr,
|
|||
return fn_data_to_datum(bcx, did, fn_data, lldest);
|
||||
}
|
||||
ast::def_static_method(did, _) => {
|
||||
let fn_data = impl::trans_static_method_callee(bcx, did,
|
||||
let fn_data = meth::trans_static_method_callee(bcx, did,
|
||||
ref_expr.id);
|
||||
return fn_data_to_datum(bcx, did, fn_data, lldest);
|
||||
}
|
||||
|
@ -1222,7 +1222,7 @@ fn trans_overloaded_op(bcx: block,
|
|||
return callee::trans_call_inner(
|
||||
bcx, expr.info(), fty,
|
||||
expr_ty(bcx, expr),
|
||||
|bcx| impl::trans_method_callee(bcx, expr.callee_id, rcvr, origin),
|
||||
|bcx| meth::trans_method_callee(bcx, expr.callee_id, rcvr, origin),
|
||||
callee::ArgExprs(args), dest);
|
||||
}
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ fn monomorphic_fn(ccx: @crate_ctxt,
|
|||
ast_map::node_method(mth, _, _) => {
|
||||
let d = mk_lldecl();
|
||||
set_inline_hint_if_appr(mth.attrs, d);
|
||||
impl::trans_method(ccx, pt, mth, psubsts, d);
|
||||
meth::trans_method(ccx, pt, mth, psubsts, d);
|
||||
d
|
||||
}
|
||||
ast_map::node_ctor(_, tps, ctor, parent_id, _) => {
|
||||
|
@ -244,7 +244,7 @@ fn make_mono_id(ccx: @crate_ctxt, item: ast::def_id, substs: ~[ty::t],
|
|||
for vec::each(*bounds) |bound| {
|
||||
match bound {
|
||||
ty::bound_trait(_) => {
|
||||
vec::push(v, impl::vtable_id(ccx, vts[i]));
|
||||
vec::push(v, meth::vtable_id(ccx, vts[i]));
|
||||
i += 1u;
|
||||
}
|
||||
_ => ()
|
||||
|
|
|
@ -72,7 +72,7 @@ impl reflector {
|
|||
let scratch = scratch_datum(bcx, bool_ty, false);
|
||||
let bcx = callee::trans_call_inner(
|
||||
self.bcx, None, mth_ty, bool_ty,
|
||||
|bcx| impl::trans_trait_callee_from_llval(bcx, mth_ty,
|
||||
|bcx| meth::trans_trait_callee_from_llval(bcx, mth_ty,
|
||||
mth_idx, v),
|
||||
ArgVals(args), SaveIn(scratch.val));
|
||||
let result = scratch.to_value_llval(bcx);
|
||||
|
|
|
@ -51,7 +51,7 @@ mod middle {
|
|||
mod uniq;
|
||||
mod closure;
|
||||
mod tvec;
|
||||
mod impl;
|
||||
mod meth;
|
||||
mod foreign;
|
||||
mod reflect;
|
||||
mod shape;
|
||||
|
|
Loading…
Reference in New Issue