diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-05-15 17:59:55 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-05-15 18:00:41 -0700 |
| commit | fa5cc5bcd0e370a677de141d46455d4ee518dcfc (patch) | |
| tree | b918a6d1643f41eb4f17b65eca80b283c6cefbd7 /src/librustsyntax | |
| parent | 5d625af9f944c7b6567c443a6f796e30dbb01bf2 (diff) | |
| download | rust-fa5cc5bcd0e370a677de141d46455d4ee518dcfc.tar.gz rust-fa5cc5bcd0e370a677de141d46455d4ee518dcfc.zip | |
Generate drop glue correctly for classes with destructors
Diffstat (limited to 'src/librustsyntax')
| -rw-r--r-- | src/librustsyntax/ast_util.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustsyntax/ast_util.rs b/src/librustsyntax/ast_util.rs index eb442e1ec48..06821366f1c 100644 --- a/src/librustsyntax/ast_util.rs +++ b/src/librustsyntax/ast_util.rs @@ -363,8 +363,11 @@ fn operator_prec(op: ast::binop) -> uint { } fn dtor_dec() -> fn_decl { - {inputs: [], output: @{id: 0, node: ty_nil, span: dummy_sp()}, - purity: impure_fn, cf: return_val, constraints: []} + 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: "_", id: 0}], + output: nil_t, purity: impure_fn, cf: return_val, constraints: []} } // Local Variables: |
