Skip to content

Commit a254b75

Browse files
committed
---
yaml --- r: 220732 b: refs/heads/master c: 47128b8 h: refs/heads/master v: v3
1 parent 7786610 commit a254b75

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1373c4fcf21930a22150210200bdc14f5f935b3c
2+
refs/heads/master: 47128b8c7ed38b28e1e7788bc9d5197959d450e8
33
refs/heads/snap-stage3: d4432b37378ec55450e06799f5344b4b0f4b94e0
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc_trans/trans/debuginfo/mod.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use middle::subst::{self, Substs};
3030
use rustc::ast_map;
3131
use trans::common::{NodeIdAndSpan, CrateContext, FunctionContext, Block};
3232
use trans;
33-
use trans::monomorphize;
33+
use trans::{monomorphize, type_of};
3434
use middle::ty::{self, Ty};
3535
use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo};
3636
use util::nodemap::{NodeMap, FnvHashMap, FnvHashSet};
@@ -41,7 +41,7 @@ use std::ffi::CString;
4141
use std::ptr;
4242
use std::rc::Rc;
4343
use syntax::codemap::{Span, Pos};
44-
use syntax::{ast, codemap, ast_util};
44+
use syntax::{abi, ast, codemap, ast_util};
4545
use syntax::attr::IntType;
4646
use syntax::parse::token::{self, special_idents};
4747

@@ -412,12 +412,13 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
412412
assert_type_for_node_id(cx, fn_ast_id, error_reporting_span);
413413
let fn_type = cx.tcx().node_id_to_type(fn_ast_id);
414414

415-
let sig = match fn_type.sty {
415+
let (sig, abi) = match fn_type.sty {
416416
ty::TyBareFn(_, ref barefnty) => {
417-
cx.tcx().erase_late_bound_regions(&barefnty.sig)
417+
(cx.tcx().erase_late_bound_regions(&barefnty.sig), barefnty.abi)
418418
}
419419
ty::TyClosure(def_id, substs) => {
420-
cx.tcx().erase_late_bound_regions(&cx.tcx().closure_type(def_id, substs).sig)
420+
let closure_type = cx.tcx().closure_type(def_id, substs);
421+
(cx.tcx().erase_late_bound_regions(&closure_type.sig), closure_type.abi)
421422
}
422423

423424
_ => cx.sess().bug("get_function_metdata: Expected a function type!")
@@ -435,8 +436,14 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
435436
ty::FnDiverging => diverging_type_metadata(cx)
436437
});
437438

439+
let inputs = &if abi == abi::RustCall {
440+
type_of::untuple_arguments(cx, &sig.inputs)
441+
} else {
442+
sig.inputs
443+
};
444+
438445
// Arguments types
439-
for &argument_type in &sig.inputs {
446+
for &argument_type in inputs {
440447
signature.push(type_metadata(cx, argument_type, codemap::DUMMY_SP));
441448
}
442449

0 commit comments

Comments
 (0)