mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 06:47:34 +00:00
Remove remnants of implicit self
This commit is contained in:
parent
35a4177550
commit
8c09865b66
@ -383,7 +383,7 @@ impl tr for ast::def {
|
||||
ast::def_method(did0.tr(xcx), did1.map(|did1| did1.tr(xcx)))
|
||||
}
|
||||
ast::def_self_ty(nid) => { ast::def_self_ty(xcx.tr_id(nid)) }
|
||||
ast::def_self(nid, i) => { ast::def_self(xcx.tr_id(nid), i) }
|
||||
ast::def_self(nid) => { ast::def_self(xcx.tr_id(nid)) }
|
||||
ast::def_mod(did) => { ast::def_mod(did.tr(xcx)) }
|
||||
ast::def_foreign_mod(did) => { ast::def_foreign_mod(did.tr(xcx)) }
|
||||
ast::def_static(did, m) => { ast::def_static(did.tr(xcx), m) }
|
||||
|
@ -352,7 +352,6 @@ impl<'self> CheckLoanCtxt<'self> {
|
||||
|
||||
mc::cat_rvalue(*) |
|
||||
mc::cat_static_item |
|
||||
mc::cat_implicit_self |
|
||||
mc::cat_copied_upvar(*) |
|
||||
mc::cat_deref(_, _, mc::unsafe_ptr(*)) |
|
||||
mc::cat_deref(_, _, mc::gc_ptr(*)) |
|
||||
@ -435,7 +434,6 @@ impl<'self> CheckLoanCtxt<'self> {
|
||||
mc::cat_self(*) |
|
||||
mc::cat_deref(_, _, mc::unsafe_ptr(*)) |
|
||||
mc::cat_static_item(*) |
|
||||
mc::cat_implicit_self(*) |
|
||||
mc::cat_deref(_, _, mc::gc_ptr(_)) |
|
||||
mc::cat_deref(_, _, mc::region_ptr(m_const, _)) |
|
||||
mc::cat_deref(_, _, mc::region_ptr(m_imm, _)) => {
|
||||
|
@ -100,7 +100,6 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
|
||||
cmt0: mc::cmt,
|
||||
cmt: mc::cmt) -> bool {
|
||||
match cmt.cat {
|
||||
mc::cat_implicit_self(*) |
|
||||
mc::cat_deref(_, _, mc::region_ptr(*)) |
|
||||
mc::cat_deref(_, _, mc::gc_ptr(*)) |
|
||||
mc::cat_deref(_, _, mc::unsafe_ptr(*)) => {
|
||||
|
@ -68,7 +68,6 @@ impl GuaranteeLifetimeContext {
|
||||
|
||||
match cmt.cat {
|
||||
mc::cat_rvalue(*) |
|
||||
mc::cat_implicit_self |
|
||||
mc::cat_copied_upvar(*) | // L-Local
|
||||
mc::cat_local(*) | // L-Local
|
||||
mc::cat_arg(*) | // L-Local
|
||||
@ -301,7 +300,6 @@ impl GuaranteeLifetimeContext {
|
||||
}
|
||||
mc::cat_rvalue(*) |
|
||||
mc::cat_static_item |
|
||||
mc::cat_implicit_self |
|
||||
mc::cat_copied_upvar(*) |
|
||||
mc::cat_deref(*) => {
|
||||
false
|
||||
@ -328,7 +326,6 @@ impl GuaranteeLifetimeContext {
|
||||
mc::cat_rvalue(cleanup_scope_id) => {
|
||||
ty::re_scope(cleanup_scope_id)
|
||||
}
|
||||
mc::cat_implicit_self |
|
||||
mc::cat_copied_upvar(_) => {
|
||||
ty::re_scope(self.item_scope_id)
|
||||
}
|
||||
|
@ -115,7 +115,6 @@ impl RestrictionsContext {
|
||||
|
||||
mc::cat_copied_upvar(*) | // FIXME(#2152) allow mutation of upvars
|
||||
mc::cat_static_item(*) |
|
||||
mc::cat_implicit_self(*) |
|
||||
mc::cat_deref(_, _, mc::region_ptr(m_imm, _)) |
|
||||
mc::cat_deref(_, _, mc::gc_ptr(m_imm)) => {
|
||||
// R-Deref-Imm-Borrowed
|
||||
|
@ -284,8 +284,7 @@ pub fn opt_loan_path(cmt: mc::cmt) -> Option<@LoanPath> {
|
||||
match cmt.cat {
|
||||
mc::cat_rvalue(*) |
|
||||
mc::cat_static_item |
|
||||
mc::cat_copied_upvar(_) |
|
||||
mc::cat_implicit_self => {
|
||||
mc::cat_copied_upvar(_) => {
|
||||
None
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,6 @@ use syntax::print::pprust;
|
||||
pub enum categorization {
|
||||
cat_rvalue(ast::NodeId), // temporary val, argument is its scope
|
||||
cat_static_item,
|
||||
cat_implicit_self,
|
||||
cat_copied_upvar(CopiedUpvar), // upvar copied into @fn or ~fn env
|
||||
cat_stack_upvar(cmt), // by ref upvar from &fn
|
||||
cat_local(ast::NodeId), // local variable
|
||||
@ -493,17 +492,11 @@ impl mem_categorization_ctxt {
|
||||
}
|
||||
}
|
||||
|
||||
ast::def_self(self_id, is_implicit) => {
|
||||
let cat = if is_implicit {
|
||||
cat_implicit_self
|
||||
} else {
|
||||
cat_self(self_id)
|
||||
};
|
||||
|
||||
ast::def_self(self_id) => {
|
||||
@cmt_ {
|
||||
id:id,
|
||||
span:span,
|
||||
cat:cat,
|
||||
cat:cat_self(self_id),
|
||||
mutbl: McImmutable,
|
||||
ty:expr_ty
|
||||
}
|
||||
@ -1016,9 +1009,6 @@ impl mem_categorization_ctxt {
|
||||
cat_static_item => {
|
||||
~"static item"
|
||||
}
|
||||
cat_implicit_self => {
|
||||
~"self reference"
|
||||
}
|
||||
cat_copied_upvar(_) => {
|
||||
~"captured outer variable in a heap closure"
|
||||
}
|
||||
@ -1121,7 +1111,6 @@ impl cmt_ {
|
||||
match self.cat {
|
||||
cat_rvalue(*) |
|
||||
cat_static_item |
|
||||
cat_implicit_self |
|
||||
cat_copied_upvar(*) |
|
||||
cat_local(*) |
|
||||
cat_self(*) |
|
||||
@ -1167,8 +1156,7 @@ impl cmt_ {
|
||||
}
|
||||
|
||||
cat_copied_upvar(CopiedUpvar {onceness: ast::Many, _}) |
|
||||
cat_static_item(*) |
|
||||
cat_implicit_self(*) => {
|
||||
cat_static_item(*) => {
|
||||
Some(AliasableOther)
|
||||
}
|
||||
|
||||
@ -1206,7 +1194,6 @@ impl Repr for categorization {
|
||||
fn repr(&self, tcx: ty::ctxt) -> ~str {
|
||||
match *self {
|
||||
cat_static_item |
|
||||
cat_implicit_self |
|
||||
cat_rvalue(*) |
|
||||
cat_copied_upvar(*) |
|
||||
cat_local(*) |
|
||||
|
@ -218,7 +218,7 @@ pub fn moved_variable_node_id_from_def(def: def) -> Option<NodeId> {
|
||||
def_binding(nid, _) |
|
||||
def_arg(nid, _) |
|
||||
def_local(nid, _) |
|
||||
def_self(nid, _) => Some(nid),
|
||||
def_self(nid) => Some(nid),
|
||||
|
||||
_ => None
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ pub enum Mutability {
|
||||
|
||||
pub enum SelfBinding {
|
||||
NoSelfBinding,
|
||||
HasSelfBinding(NodeId, bool /* is implicit */)
|
||||
HasSelfBinding(NodeId)
|
||||
}
|
||||
|
||||
struct ResolveVisitor {
|
||||
@ -3769,9 +3769,8 @@ impl Resolver {
|
||||
NoSelfBinding => {
|
||||
// Nothing to do.
|
||||
}
|
||||
HasSelfBinding(self_node_id, is_implicit) => {
|
||||
let def_like = dl_def(def_self(self_node_id,
|
||||
is_implicit));
|
||||
HasSelfBinding(self_node_id) => {
|
||||
let def_like = dl_def(def_self(self_node_id));
|
||||
*function_value_rib.self_binding = Some(def_like);
|
||||
}
|
||||
}
|
||||
@ -3915,7 +3914,7 @@ impl Resolver {
|
||||
// we only have self ty if it is a non static method
|
||||
let self_binding = match method.explicit_self.node {
|
||||
sty_static => { NoSelfBinding }
|
||||
_ => { HasSelfBinding(method.self_id, false) }
|
||||
_ => { HasSelfBinding(method.self_id) }
|
||||
};
|
||||
|
||||
self.resolve_function(rib_kind,
|
||||
|
@ -1088,7 +1088,7 @@ pub fn trans_local_var(bcx: @mut Block, def: ast::def) -> Datum {
|
||||
ast::def_local(nid, _) | ast::def_binding(nid, _) => {
|
||||
take_local(bcx, bcx.fcx.lllocals, nid)
|
||||
}
|
||||
ast::def_self(nid, _) => {
|
||||
ast::def_self(nid) => {
|
||||
let self_info: ValSelfData = match bcx.fcx.llself {
|
||||
Some(ref self_info) => *self_info,
|
||||
None => {
|
||||
|
@ -3094,7 +3094,7 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt,
|
||||
-> ty_param_bounds_and_ty {
|
||||
|
||||
match defn {
|
||||
ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid, _) |
|
||||
ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid) |
|
||||
ast::def_binding(nid, _) => {
|
||||
let typ = fcx.local_ty(sp, nid);
|
||||
return no_params(typ);
|
||||
|
@ -58,7 +58,7 @@ fn encl_region_of_def(fcx: @mut FnCtxt, def: ast::def) -> ty::Region {
|
||||
let tcx = fcx.tcx();
|
||||
match def {
|
||||
def_local(node_id, _) | def_arg(node_id, _) |
|
||||
def_self(node_id, _) | def_binding(node_id, _) => {
|
||||
def_self(node_id) | def_binding(node_id, _) => {
|
||||
tcx.region_maps.encl_region(node_id)
|
||||
}
|
||||
def_upvar(_, subdef, closure_id, body_id) => {
|
||||
|
@ -171,7 +171,7 @@ pub enum def {
|
||||
def_static_method(/* method */ def_id,
|
||||
/* trait */ Option<def_id>,
|
||||
purity),
|
||||
def_self(NodeId, bool /* is_implicit */),
|
||||
def_self(NodeId),
|
||||
def_self_ty(/* trait id */ NodeId),
|
||||
def_mod(def_id),
|
||||
def_foreign_mod(def_id),
|
||||
|
@ -64,7 +64,7 @@ pub fn def_id_of_def(d: def) -> def_id {
|
||||
def_use(id) | def_struct(id) | def_trait(id) | def_method(id, _) => {
|
||||
id
|
||||
}
|
||||
def_arg(id, _) | def_local(id, _) | def_self(id, _) | def_self_ty(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)
|
||||
|
Loading…
Reference in New Issue
Block a user