1
Fork 0

Revert "Clean up previous commit to not require an Option"

I made a mistake and included some submodule weirdness.
About to re-push the patch without that.

This reverts commit 17ea548275.
This commit is contained in:
Tim Chevalier 2013-01-22 15:12:24 -08:00
parent 17ea548275
commit a36eacc4f9
3 changed files with 9 additions and 10 deletions

View file

@ -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, decl.output, item.id)
(item.ident, Some(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, method.decl.output, method.id)
(method.ident, Some(method.decl.output), method.id)
}
ast_map::node_expr(expr) => {
match /*bad*/copy expr.node {
ast::expr_fn(_, decl, _, _) => {
((dbg_cx.names)(~"fn"), decl.output, expr.id)
((dbg_cx.names)(~"fn"), Some(decl.output), expr.id)
}
ast::expr_fn_block(decl, _, _) => {
((dbg_cx.names)(~"fn"), decl.output, expr.id)
((dbg_cx.names)(~"fn"), Some(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"), ast_util::dtor_ty(), did.node)
((dbg_cx.names)(~"dtor"), None, did.node)
}
_ => fcx.ccx.sess.bug(~"create_function: unexpected \
sort of node")
@ -810,7 +810,8 @@ 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 cx.sess.opts.extra_debuginfo {
let ty_node = if ret_ty.is_some() && cx.sess.opts.extra_debuginfo {
let ret_ty = ret_ty.unwrap();
match ret_ty.node {
ast::ty_nil => llnull(),
_ => create_ty(cx, ty::node_id_to_type(cx.tcx, id), ret_ty).node

View file

@ -440,10 +440,8 @@ 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 = dtor_ty();
let nil_t = @ast::Ty { id: 0, node: ty_nil, span: dummy_sp() };
// dtor has no args
ast::fn_decl {
inputs: ~[],

@ -1 +1 @@
Subproject commit 4d392c86feb6389f550d8110d36fa90d66c09251
Subproject commit 1170ffba3ac5191930b40c897d4569a9d8a296a3