diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index e1c7ef4d50f0a..8291a387071e6 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -511,6 +511,9 @@ impl TypeMap { unique_type_id.push_char('+'); } }, + ty::ty_unboxed_closure(..) => { + unique_type_id.push_str("closure"); + } _ => { cx.sess().bug(format!("get_unique_type_id_of_type() - unexpected type: {}, {:?}", ppaux::ty_to_string(cx.tcx(), type_).as_slice(), @@ -2980,6 +2983,13 @@ fn type_metadata(cx: &CrateContext, unique_type_id, usage_site_span).finalize(cx) } + ty::ty_unboxed_closure(def_id, _) => { + let unboxed_closures = cx.tcx().unboxed_closures.borrow(); + let ref function_type = unboxed_closures.get(&def_id) + .closure_type; + + subroutine_type_metadata(cx, unique_type_id, &function_type.sig, usage_site_span) + } _ => { cx.sess().bug(format!("debuginfo: unexpected type in type_metadata: {:?}", sty).as_slice()) diff --git a/src/test/run-pass/unboxed-closures-unique-type-id.rs b/src/test/run-pass/unboxed-closures-unique-type-id.rs index 55d89d4e4f689..fb3c41001e58b 100644 --- a/src/test/run-pass/unboxed-closures-unique-type-id.rs +++ b/src/test/run-pass/unboxed-closures-unique-type-id.rs @@ -7,6 +7,9 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. + +// compile-flags:-g + // // This code used to produce the following ICE: //