librustc: Allow moves out of self. r=nmatsakis

This commit is contained in:
Patrick Walton
2012-12-10 11:58:37 -08:00
parent 45848b2040
commit cd120736cb
16 changed files with 155 additions and 53 deletions

View File

@@ -71,8 +71,8 @@ pure fn def_id_of_def(d: def) -> def_id {
def_use(id) | def_struct(id) => {
id
}
def_arg(id, _) | def_local(id, _) | def_self(id) |
def_upvar(id, _, _, _) | def_binding(id, _) | def_region(id)
def_arg(id, _) | def_local(id, _) | def_self(id, _) | def_self_ty(id)
| def_upvar(id, _, _, _) | def_binding(id, _) | def_region(id)
| def_typaram_binder(id) | def_label(id) => {
local_def(id)
}
@@ -384,7 +384,7 @@ impl inlined_item: inlined_item_utils {
referring to a def_self */
fn is_self(d: ast::def) -> bool {
match d {
def_self(_) => true,
def_self(*) => true,
def_upvar(_, d, _, _) => is_self(*d),
_ => false
}