Skip to content

Commit 8c09865

Browse files
committed
Remove remnants of implicit self
1 parent 35a4177 commit 8c09865

File tree

14 files changed

+15
-37
lines changed

14 files changed

+15
-37
lines changed

src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl tr for ast::def {
383383
ast::def_method(did0.tr(xcx), did1.map(|did1| did1.tr(xcx)))
384384
}
385385
ast::def_self_ty(nid) => { ast::def_self_ty(xcx.tr_id(nid)) }
386-
ast::def_self(nid, i) => { ast::def_self(xcx.tr_id(nid), i) }
386+
ast::def_self(nid) => { ast::def_self(xcx.tr_id(nid)) }
387387
ast::def_mod(did) => { ast::def_mod(did.tr(xcx)) }
388388
ast::def_foreign_mod(did) => { ast::def_foreign_mod(did.tr(xcx)) }
389389
ast::def_static(did, m) => { ast::def_static(did.tr(xcx), m) }

src/librustc/middle/borrowck/check_loans.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@ impl<'self> CheckLoanCtxt<'self> {
352352

353353
mc::cat_rvalue(*) |
354354
mc::cat_static_item |
355-
mc::cat_implicit_self |
356355
mc::cat_copied_upvar(*) |
357356
mc::cat_deref(_, _, mc::unsafe_ptr(*)) |
358357
mc::cat_deref(_, _, mc::gc_ptr(*)) |
@@ -435,7 +434,6 @@ impl<'self> CheckLoanCtxt<'self> {
435434
mc::cat_self(*) |
436435
mc::cat_deref(_, _, mc::unsafe_ptr(*)) |
437436
mc::cat_static_item(*) |
438-
mc::cat_implicit_self(*) |
439437
mc::cat_deref(_, _, mc::gc_ptr(_)) |
440438
mc::cat_deref(_, _, mc::region_ptr(m_const, _)) |
441439
mc::cat_deref(_, _, mc::region_ptr(m_imm, _)) => {

src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
100100
cmt0: mc::cmt,
101101
cmt: mc::cmt) -> bool {
102102
match cmt.cat {
103-
mc::cat_implicit_self(*) |
104103
mc::cat_deref(_, _, mc::region_ptr(*)) |
105104
mc::cat_deref(_, _, mc::gc_ptr(*)) |
106105
mc::cat_deref(_, _, mc::unsafe_ptr(*)) => {

src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ impl GuaranteeLifetimeContext {
6868
6969
match cmt.cat {
7070
mc::cat_rvalue(*) |
71-
mc::cat_implicit_self |
7271
mc::cat_copied_upvar(*) | // L-Local
7372
mc::cat_local(*) | // L-Local
7473
mc::cat_arg(*) | // L-Local
@@ -301,7 +300,6 @@ impl GuaranteeLifetimeContext {
301300
}
302301
mc::cat_rvalue(*) |
303302
mc::cat_static_item |
304-
mc::cat_implicit_self |
305303
mc::cat_copied_upvar(*) |
306304
mc::cat_deref(*) => {
307305
false
@@ -328,7 +326,6 @@ impl GuaranteeLifetimeContext {
328326
mc::cat_rvalue(cleanup_scope_id) => {
329327
ty::re_scope(cleanup_scope_id)
330328
}
331-
mc::cat_implicit_self |
332329
mc::cat_copied_upvar(_) => {
333330
ty::re_scope(self.item_scope_id)
334331
}

src/librustc/middle/borrowck/gather_loans/restrictions.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ impl RestrictionsContext {
115115

116116
mc::cat_copied_upvar(*) | // FIXME(#2152) allow mutation of upvars
117117
mc::cat_static_item(*) |
118-
mc::cat_implicit_self(*) |
119118
mc::cat_deref(_, _, mc::region_ptr(m_imm, _)) |
120119
mc::cat_deref(_, _, mc::gc_ptr(m_imm)) => {
121120
// R-Deref-Imm-Borrowed

src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ pub fn opt_loan_path(cmt: mc::cmt) -> Option<@LoanPath> {
284284
match cmt.cat {
285285
mc::cat_rvalue(*) |
286286
mc::cat_static_item |
287-
mc::cat_copied_upvar(_) |
288-
mc::cat_implicit_self => {
287+
mc::cat_copied_upvar(_) => {
289288
None
290289
}
291290

src/librustc/middle/mem_categorization.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use syntax::print::pprust;
6161
pub enum categorization {
6262
cat_rvalue(ast::NodeId), // temporary val, argument is its scope
6363
cat_static_item,
64-
cat_implicit_self,
6564
cat_copied_upvar(CopiedUpvar), // upvar copied into @fn or ~fn env
6665
cat_stack_upvar(cmt), // by ref upvar from &fn
6766
cat_local(ast::NodeId), // local variable
@@ -493,17 +492,11 @@ impl mem_categorization_ctxt {
493492
}
494493
}
495494

496-
ast::def_self(self_id, is_implicit) => {
497-
let cat = if is_implicit {
498-
cat_implicit_self
499-
} else {
500-
cat_self(self_id)
501-
};
502-
495+
ast::def_self(self_id) => {
503496
@cmt_ {
504497
id:id,
505498
span:span,
506-
cat:cat,
499+
cat:cat_self(self_id),
507500
mutbl: McImmutable,
508501
ty:expr_ty
509502
}
@@ -1016,9 +1009,6 @@ impl mem_categorization_ctxt {
10161009
cat_static_item => {
10171010
~"static item"
10181011
}
1019-
cat_implicit_self => {
1020-
~"self reference"
1021-
}
10221012
cat_copied_upvar(_) => {
10231013
~"captured outer variable in a heap closure"
10241014
}
@@ -1121,7 +1111,6 @@ impl cmt_ {
11211111
match self.cat {
11221112
cat_rvalue(*) |
11231113
cat_static_item |
1124-
cat_implicit_self |
11251114
cat_copied_upvar(*) |
11261115
cat_local(*) |
11271116
cat_self(*) |
@@ -1167,8 +1156,7 @@ impl cmt_ {
11671156
}
11681157

11691158
cat_copied_upvar(CopiedUpvar {onceness: ast::Many, _}) |
1170-
cat_static_item(*) |
1171-
cat_implicit_self(*) => {
1159+
cat_static_item(*) => {
11721160
Some(AliasableOther)
11731161
}
11741162

@@ -1206,7 +1194,6 @@ impl Repr for categorization {
12061194
fn repr(&self, tcx: ty::ctxt) -> ~str {
12071195
match *self {
12081196
cat_static_item |
1209-
cat_implicit_self |
12101197
cat_rvalue(*) |
12111198
cat_copied_upvar(*) |
12121199
cat_local(*) |

src/librustc/middle/moves.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub fn moved_variable_node_id_from_def(def: def) -> Option<NodeId> {
218218
def_binding(nid, _) |
219219
def_arg(nid, _) |
220220
def_local(nid, _) |
221-
def_self(nid, _) => Some(nid),
221+
def_self(nid) => Some(nid),
222222

223223
_ => None
224224
}

src/librustc/middle/resolve.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub enum Mutability {
125125

126126
pub enum SelfBinding {
127127
NoSelfBinding,
128-
HasSelfBinding(NodeId, bool /* is implicit */)
128+
HasSelfBinding(NodeId)
129129
}
130130

131131
struct ResolveVisitor {
@@ -3769,9 +3769,8 @@ impl Resolver {
37693769
NoSelfBinding => {
37703770
// Nothing to do.
37713771
}
3772-
HasSelfBinding(self_node_id, is_implicit) => {
3773-
let def_like = dl_def(def_self(self_node_id,
3774-
is_implicit));
3772+
HasSelfBinding(self_node_id) => {
3773+
let def_like = dl_def(def_self(self_node_id));
37753774
*function_value_rib.self_binding = Some(def_like);
37763775
}
37773776
}
@@ -3915,7 +3914,7 @@ impl Resolver {
39153914
// we only have self ty if it is a non static method
39163915
let self_binding = match method.explicit_self.node {
39173916
sty_static => { NoSelfBinding }
3918-
_ => { HasSelfBinding(method.self_id, false) }
3917+
_ => { HasSelfBinding(method.self_id) }
39193918
};
39203919

39213920
self.resolve_function(rib_kind,

src/librustc/middle/trans/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,7 @@ pub fn trans_local_var(bcx: @mut Block, def: ast::def) -> Datum {
10881088
ast::def_local(nid, _) | ast::def_binding(nid, _) => {
10891089
take_local(bcx, bcx.fcx.lllocals, nid)
10901090
}
1091-
ast::def_self(nid, _) => {
1091+
ast::def_self(nid) => {
10921092
let self_info: ValSelfData = match bcx.fcx.llself {
10931093
Some(ref self_info) => *self_info,
10941094
None => {

src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3094,7 +3094,7 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt,
30943094
-> ty_param_bounds_and_ty {
30953095

30963096
match defn {
3097-
ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid, _) |
3097+
ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid) |
30983098
ast::def_binding(nid, _) => {
30993099
let typ = fcx.local_ty(sp, nid);
31003100
return no_params(typ);

src/librustc/middle/typeck/check/regionck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn encl_region_of_def(fcx: @mut FnCtxt, def: ast::def) -> ty::Region {
5858
let tcx = fcx.tcx();
5959
match def {
6060
def_local(node_id, _) | def_arg(node_id, _) |
61-
def_self(node_id, _) | def_binding(node_id, _) => {
61+
def_self(node_id) | def_binding(node_id, _) => {
6262
tcx.region_maps.encl_region(node_id)
6363
}
6464
def_upvar(_, subdef, closure_id, body_id) => {

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub enum def {
171171
def_static_method(/* method */ def_id,
172172
/* trait */ Option<def_id>,
173173
purity),
174-
def_self(NodeId, bool /* is_implicit */),
174+
def_self(NodeId),
175175
def_self_ty(/* trait id */ NodeId),
176176
def_mod(def_id),
177177
def_foreign_mod(def_id),

src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn def_id_of_def(d: def) -> def_id {
6464
def_use(id) | def_struct(id) | def_trait(id) | def_method(id, _) => {
6565
id
6666
}
67-
def_arg(id, _) | def_local(id, _) | def_self(id, _) | def_self_ty(id)
67+
def_arg(id, _) | def_local(id, _) | def_self(id) | def_self_ty(id)
6868
| def_upvar(id, _, _, _) | def_binding(id, _) | def_region(id)
6969
| def_typaram_binder(id) | def_label(id) => {
7070
local_def(id)

0 commit comments

Comments
 (0)