Skip to content

Commit be1fdf9

Browse files
committed
Promote 'impl' from restricted keyword to strict
1 parent 3d2a74a commit be1fdf9

File tree

10 files changed

+18
-19
lines changed

10 files changed

+18
-19
lines changed

src/libcore/os.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@ mod global_env {
188188
loop {
189189
match comm::select2(msg_po, weak_po) {
190190
either::Left(MsgGetEnv(n, resp_ch)) => {
191-
comm::send(resp_ch, impl::getenv(n))
191+
comm::send(resp_ch, impl_::getenv(n))
192192
}
193193
either::Left(MsgSetEnv(n, v, resp_ch)) => {
194-
comm::send(resp_ch, impl::setenv(n, v))
194+
comm::send(resp_ch, impl_::setenv(n, v))
195195
}
196196
either::Left(MsgEnv(resp_ch)) => {
197-
comm::send(resp_ch, impl::env())
197+
comm::send(resp_ch, impl_::env())
198198
}
199199
either::Right(_) => break
200200
}
@@ -203,7 +203,7 @@ mod global_env {
203203
}
204204
}
205205

206-
mod impl {
206+
mod impl_ {
207207
extern mod rustrt {
208208
fn rust_env_pairs() -> ~[~str];
209209
}

src/libsyntax/parse/token.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ fn restricted_keyword_table() -> HashMap<~str, ()> {
416416
let keys = ~[
417417
~"const", ~"copy",
418418
~"fail", ~"fn",
419-
~"impl",
420419
~"unsafe"
421420
];
422421
for keys.each |word| {
@@ -434,7 +433,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
434433
~"do", ~"drop",
435434
~"else", ~"enum", ~"export", ~"extern",
436435
~"false", ~"for",
437-
~"if",
436+
~"if", ~"impl",
438437
~"let", ~"log", ~"loop",
439438
~"match", ~"mod", ~"move", ~"mut",
440439
~"priv", ~"pub", ~"pure",

src/rustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,7 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
18381838
}
18391839
}
18401840
ast::item_impl(tps, _, _, ms) => {
1841-
impl::trans_impl(ccx, *path, item.ident, ms, tps);
1841+
meth::trans_impl(ccx, *path, item.ident, ms, tps);
18421842
}
18431843
ast::item_mod(m) => {
18441844
trans_mod(ccx, m);
@@ -1890,15 +1890,15 @@ fn trans_struct_def(ccx: @crate_ctxt, struct_def: @ast::struct_def,
18901890
// If there are ty params, the ctor will get monomorphized
18911891

18921892
// Translate methods
1893-
impl::trans_impl(ccx, *path, ident, struct_def.methods, tps);
1893+
meth::trans_impl(ccx, *path, ident, struct_def.methods, tps);
18941894
}
18951895

18961896
fn trans_trait(ccx: @crate_ctxt, tps: ~[ast::ty_param],
18971897
trait_methods: ~[ast::trait_method],
18981898
path: @ast_map::path, ident: ast::ident) {
18991899
// Translate any methods that have provided implementations
19001900
let (_, provided_methods) = ast_util::split_trait_methods(trait_methods);
1901-
impl::trans_impl(ccx, *path, ident, provided_methods, tps);
1901+
meth::trans_impl(ccx, *path, ident, provided_methods, tps);
19021902
}
19031903

19041904
// Translate a module. Doing this amounts to translating the items in the

src/rustc/middle/trans/callee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fn trans(bcx: block, expr: @ast::expr) -> Callee {
5353
ast::expr_field(base, _, _) => {
5454
match bcx.ccx().maps.method_map.find(expr.id) {
5555
Some(origin) => { // An impl method
56-
return impl::trans_method_callee(bcx, expr.id,
56+
return meth::trans_method_callee(bcx, expr.id,
5757
base, origin);
5858
}
5959
None => {} // not a method, just a field
@@ -79,7 +79,7 @@ fn trans(bcx: block, expr: @ast::expr) -> Callee {
7979
fn_callee(bcx, trans_fn_ref(bcx, did, ref_expr.id))
8080
}
8181
ast::def_static_method(did, _) => {
82-
fn_callee(bcx, impl::trans_static_method_callee(bcx, did,
82+
fn_callee(bcx, meth::trans_static_method_callee(bcx, did,
8383
ref_expr.id))
8484
}
8585
ast::def_variant(tid, vid) => {

src/rustc/middle/trans/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
12071207
fn node_vtables(bcx: block, id: ast::node_id) -> Option<typeck::vtable_res> {
12081208
let raw_vtables = bcx.ccx().maps.vtable_map.find(id);
12091209
raw_vtables.map(
1210-
|vts| impl::resolve_vtables_in_fn_ctxt(bcx.fcx, vts))
1210+
|vts| meth::resolve_vtables_in_fn_ctxt(bcx.fcx, vts))
12111211
}
12121212
12131213
fn resolve_vtables_in_fn_ctxt(fcx: fn_ctxt, vts: typeck::vtable_res)

src/rustc/middle/trans/expr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ fn trans_rvalue_dps(bcx: block, expr: @ast::expr, dest: Dest) -> block {
519519
return trans_overloaded_op(bcx, expr, base, ~[idx], dest);
520520
}
521521
ast::expr_cast(val, _) => {
522-
return impl::trans_trait_cast(bcx, val, expr.id, dest);
522+
return meth::trans_trait_cast(bcx, val, expr.id, dest);
523523
}
524524
ast::expr_assign_op(op, dst, src) => {
525525
return trans_assign_op(bcx, expr, op, dst, src);
@@ -549,7 +549,7 @@ fn trans_def_dps(bcx: block, ref_expr: @ast::expr,
549549
return fn_data_to_datum(bcx, did, fn_data, lldest);
550550
}
551551
ast::def_static_method(did, _) => {
552-
let fn_data = impl::trans_static_method_callee(bcx, did,
552+
let fn_data = meth::trans_static_method_callee(bcx, did,
553553
ref_expr.id);
554554
return fn_data_to_datum(bcx, did, fn_data, lldest);
555555
}
@@ -1222,7 +1222,7 @@ fn trans_overloaded_op(bcx: block,
12221222
return callee::trans_call_inner(
12231223
bcx, expr.info(), fty,
12241224
expr_ty(bcx, expr),
1225-
|bcx| impl::trans_method_callee(bcx, expr.callee_id, rcvr, origin),
1225+
|bcx| meth::trans_method_callee(bcx, expr.callee_id, rcvr, origin),
12261226
callee::ArgExprs(args), dest);
12271227
}
12281228

File renamed without changes.

src/rustc/middle/trans/monomorphize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ fn monomorphic_fn(ccx: @crate_ctxt,
156156
ast_map::node_method(mth, _, _) => {
157157
let d = mk_lldecl();
158158
set_inline_hint_if_appr(mth.attrs, d);
159-
impl::trans_method(ccx, pt, mth, psubsts, d);
159+
meth::trans_method(ccx, pt, mth, psubsts, d);
160160
d
161161
}
162162
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],
244244
for vec::each(*bounds) |bound| {
245245
match bound {
246246
ty::bound_trait(_) => {
247-
vec::push(v, impl::vtable_id(ccx, vts[i]));
247+
vec::push(v, meth::vtable_id(ccx, vts[i]));
248248
i += 1u;
249249
}
250250
_ => ()

src/rustc/middle/trans/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl reflector {
7272
let scratch = scratch_datum(bcx, bool_ty, false);
7373
let bcx = callee::trans_call_inner(
7474
self.bcx, None, mth_ty, bool_ty,
75-
|bcx| impl::trans_trait_callee_from_llval(bcx, mth_ty,
75+
|bcx| meth::trans_trait_callee_from_llval(bcx, mth_ty,
7676
mth_idx, v),
7777
ArgVals(args), SaveIn(scratch.val));
7878
let result = scratch.to_value_llval(bcx);

src/rustc/rustc.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ mod middle {
5151
mod uniq;
5252
mod closure;
5353
mod tvec;
54-
mod impl;
54+
mod meth;
5555
mod foreign;
5656
mod reflect;
5757
mod shape;

0 commit comments

Comments
 (0)