Remove spurious by-ref argument to destructors

Destructors were internally declared with an extra (hidden) nil-typed
argument that was passed in by-ref mode. This was causing spurious
mode warnings. Deleted it. Also some misc. cleanup because I
couldn't help myself.
This commit is contained in:
Tim Chevalier
2012-09-26 19:40:05 -07:00
parent 656cbead49
commit 996ec62cbf
6 changed files with 14 additions and 18 deletions

View File

@@ -398,10 +398,8 @@ fn operator_prec(op: ast::binop) -> uint {
fn dtor_dec() -> fn_decl {
let nil_t = @{id: 0, node: ty_nil, span: dummy_sp()};
// dtor has one argument, of type ()
{inputs: ~[{mode: ast::expl(ast::by_ref),
ty: nil_t, ident: parse::token::special_idents::underscore,
id: 0}],
// dtor has no args
{inputs: ~[],
output: nil_t, cf: return_val}
}