auto merge of #6148 : erickt/rust/remove-drop, r=pcwalton
The drop block has been deprecated for quite some time. This patch series removes support for parsing it and all the related machinery that made drop work. As a side feature of all this, I also added the ability to annote fields in structs. This allows comments to be properly associated with an individual field. However, I didn't update `rustdoc` to integrate these comment blocks into the documentation it generates.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
use ast::*;
|
||||
use ast;
|
||||
use ast_util;
|
||||
use codemap::{span, dummy_sp, spanned};
|
||||
use codemap::{span, spanned};
|
||||
use parse::token;
|
||||
use visit;
|
||||
use opt_vec;
|
||||
@@ -302,7 +302,6 @@ impl inlined_item_utils for inlined_item {
|
||||
ii_item(i) => /* FIXME (#2543) */ copy i.ident,
|
||||
ii_foreign(i) => /* FIXME (#2543) */ copy i.ident,
|
||||
ii_method(_, m) => /* FIXME (#2543) */ copy m.ident,
|
||||
ii_dtor(_, nm, _, _) => /* FIXME (#2543) */ copy nm
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +310,6 @@ impl inlined_item_utils for inlined_item {
|
||||
ii_item(i) => i.id,
|
||||
ii_foreign(i) => i.id,
|
||||
ii_method(_, m) => m.id,
|
||||
ii_dtor(ref dtor, _, _, _) => (*dtor).node.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,10 +318,6 @@ impl inlined_item_utils for inlined_item {
|
||||
ii_item(i) => (v.visit_item)(i, e, v),
|
||||
ii_foreign(i) => (v.visit_foreign_item)(i, e, v),
|
||||
ii_method(_, m) => visit::visit_method_helper(m, e, v),
|
||||
ii_dtor(/*bad*/ copy dtor, _, ref generics, parent_id) => {
|
||||
visit::visit_struct_dtor_helper(dtor, generics,
|
||||
parent_id, e, v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,20 +353,6 @@ pub fn operator_prec(op: ast::binop) -> uint {
|
||||
/// not appearing in the prior table.
|
||||
pub static as_prec: uint = 11u;
|
||||
|
||||
pub fn dtor_ty() -> @ast::Ty {
|
||||
@ast::Ty {id: 0, node: ty_nil, span: dummy_sp()}
|
||||
}
|
||||
|
||||
pub fn dtor_dec() -> fn_decl {
|
||||
let nil_t = dtor_ty();
|
||||
// dtor has no args
|
||||
ast::fn_decl {
|
||||
inputs: ~[],
|
||||
output: nil_t,
|
||||
cf: return_val,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn empty_generics() -> Generics {
|
||||
Generics {lifetimes: opt_vec::Empty,
|
||||
ty_params: opt_vec::Empty}
|
||||
@@ -457,12 +437,6 @@ pub fn id_visitor(vfn: @fn(node_id)) -> visit::vt<()> {
|
||||
vfn(id);
|
||||
|
||||
match *fk {
|
||||
visit::fk_dtor(generics, _, self_id, parent_id) => {
|
||||
visit_generics(generics);
|
||||
vfn(id);
|
||||
vfn(self_id);
|
||||
vfn(parent_id.node);
|
||||
}
|
||||
visit::fk_item_fn(_, generics, _, _) => {
|
||||
visit_generics(generics);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user