Skip to content

Commit 10260be

Browse files
committed
Change debuginfo to not use an option for the output type...
...now without a random libuv change.
1 parent a36eacc commit 10260be

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/librustc/middle/trans/debuginfo.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -769,30 +769,30 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
769769
ast_map::node_item(item, _) => {
770770
match /*bad*/copy item.node {
771771
ast::item_fn(decl, _, _, _) => {
772-
(item.ident, Some(decl.output), item.id)
772+
(item.ident, decl.output, item.id)
773773
}
774774
_ => fcx.ccx.sess.span_bug(item.span, ~"create_function: item \
775775
bound to non-function")
776776
}
777777
}
778778
ast_map::node_method(method, _, _) => {
779-
(method.ident, Some(method.decl.output), method.id)
779+
(method.ident, method.decl.output, method.id)
780780
}
781781
ast_map::node_expr(expr) => {
782782
match /*bad*/copy expr.node {
783783
ast::expr_fn(_, decl, _, _) => {
784-
((dbg_cx.names)(~"fn"), Some(decl.output), expr.id)
784+
((dbg_cx.names)(~"fn"), decl.output, expr.id)
785785
}
786786
ast::expr_fn_block(decl, _, _) => {
787-
((dbg_cx.names)(~"fn"), Some(decl.output), expr.id)
787+
((dbg_cx.names)(~"fn"), decl.output, expr.id)
788788
}
789789
_ => fcx.ccx.sess.span_bug(expr.span,
790790
~"create_function: \
791791
expected an expr_fn or fn_block here")
792792
}
793793
}
794794
ast_map::node_dtor(_, _, did, _) => {
795-
((dbg_cx.names)(~"dtor"), None, did.node)
795+
((dbg_cx.names)(~"dtor"), ast_util::dtor_ty(), did.node)
796796
}
797797
_ => fcx.ccx.sess.bug(~"create_function: unexpected \
798798
sort of node")
@@ -810,8 +810,7 @@ fn create_function(fcx: fn_ctxt) -> @metadata<subprogram_md> {
810810

811811
let loc = cx.sess.codemap.lookup_char_pos(sp.lo);
812812
let file_node = create_file(cx, loc.file.name).node;
813-
let ty_node = if ret_ty.is_some() && cx.sess.opts.extra_debuginfo {
814-
let ret_ty = ret_ty.unwrap();
813+
let ty_node = if cx.sess.opts.extra_debuginfo {
815814
match ret_ty.node {
816815
ast::ty_nil => llnull(),
817816
_ => create_ty(cx, ty::node_id_to_type(cx.tcx, id), ret_ty).node

src/libsyntax/ast_util.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,10 @@ fn operator_prec(op: ast::binop) -> uint {
440440
}
441441
}
442442

443+
fn dtor_ty() -> @ast::Ty { @ast::Ty {id: 0, node: ty_nil, span: dummy_sp()} }
444+
443445
fn dtor_dec() -> fn_decl {
444-
let nil_t = @ast::Ty { id: 0, node: ty_nil, span: dummy_sp() };
446+
let nil_t = dtor_ty();
445447
// dtor has no args
446448
ast::fn_decl {
447449
inputs: ~[],

0 commit comments

Comments
 (0)