about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2013-01-22 15:13:23 -0800
committerTim Chevalier <chevalier@alum.wellesley.edu>2013-01-22 15:13:23 -0800
commit10260bee38fc41b5e089d0be0a217e5eb6ad9d12 (patch)
treea0d95786e9a059e5a32aaf24c07756792e7d1d4c
parenta36eacc4f9b68b99c5f8ed50b1519a410d77d6f0 (diff)
Change debuginfo to not use an option for the output type...
...now without a random libuv change.
-rw-r--r--src/librustc/middle/trans/debuginfo.rs13
-rw-r--r--src/libsyntax/ast_util.rs4
2 files changed, 9 insertions, 8 deletions
diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs
index f6a2574d50d..668c676b18c 100644
--- a/src/librustc/middle/trans/debuginfo.rs
+++ b/src/librustc/middle/trans/debuginfo.rs
@@ -769,22 +769,22 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
       ast_map::node_item(item, _) => {
         match /*bad*/copy item.node {
           ast::item_fn(decl, _, _, _) => {
-            (item.ident, Some(decl.output), item.id)
+            (item.ident, decl.output, item.id)
           }
           _ => fcx.ccx.sess.span_bug(item.span, ~"create_function: item \
                                                   bound to non-function")
         }
       }
       ast_map::node_method(method, _, _) => {
-          (method.ident, Some(method.decl.output), method.id)
+          (method.ident, method.decl.output, method.id)
       }
       ast_map::node_expr(expr) => {
         match /*bad*/copy expr.node {
           ast::expr_fn(_, decl, _, _) => {
-            ((dbg_cx.names)(~"fn"), Some(decl.output), expr.id)
+            ((dbg_cx.names)(~"fn"), decl.output, expr.id)
           }
           ast::expr_fn_block(decl, _, _) => {
-            ((dbg_cx.names)(~"fn"), Some(decl.output), expr.id)
+            ((dbg_cx.names)(~"fn"), decl.output, expr.id)
           }
           _ => fcx.ccx.sess.span_bug(expr.span,
                                      ~"create_function: \
@@ -792,7 +792,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
         }
       }
       ast_map::node_dtor(_, _, did, _) => {
-        ((dbg_cx.names)(~"dtor"), None, did.node)
+        ((dbg_cx.names)(~"dtor"), ast_util::dtor_ty(), did.node)
       }
       _ => fcx.ccx.sess.bug(~"create_function: unexpected \
                               sort of node")
@@ -810,8 +810,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
 
     let loc = cx.sess.codemap.lookup_char_pos(sp.lo);
     let file_node = create_file(cx, loc.file.name).node;
-    let ty_node = if ret_ty.is_some() && cx.sess.opts.extra_debuginfo {
-        let ret_ty = ret_ty.unwrap();
+    let ty_node = if cx.sess.opts.extra_debuginfo {
         match ret_ty.node {
           ast::ty_nil => llnull(),
           _ => create_ty(cx, ty::node_id_to_type(cx.tcx, id), ret_ty).node
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index fe0da2e17b8..3afceeef59e 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -440,8 +440,10 @@ fn operator_prec(op: ast::binop) -> uint {
   }
 }
 
+fn dtor_ty() -> @ast::Ty { @ast::Ty {id: 0, node: ty_nil, span: dummy_sp()} }
+
 fn dtor_dec() -> fn_decl {
-    let nil_t = @ast::Ty { id: 0, node: ty_nil, span: dummy_sp() };
+    let nil_t = dtor_ty();
     // dtor has no args
     ast::fn_decl {
         inputs: ~[],