From 996ec62cbfce9f25ecc8b573a0b9eb7f4a1b6db9 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Wed, 26 Sep 2012 19:40:05 -0700 Subject: 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. --- src/libsyntax/ast_util.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 329c9f362a4..a2c935ea6f4 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -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} } -- cgit 1.4.1-3-g733a5