Do not emit "class method" debuginfo for types that are not DICompositeType.

This commit is contained in:
Eduard Burtescu 2016-08-26 07:39:17 +03:00
parent e07dd59eae
commit 8407952346

View File

@ -419,7 +419,15 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
let impl_self_ty = monomorphize::apply_param_substs(cx.tcx(),
instance.substs,
&impl_self_ty);
// Only "class" methods are generally understood by LLVM,
// so avoid methods on other types (e.g. `<*mut T>::null`).
match impl_self_ty.sty {
ty::TyStruct(..) | ty::TyEnum(..) => {
Some(type_metadata(cx, impl_self_ty, syntax_pos::DUMMY_SP))
}
_ => None
}
} else {
// For trait method impls we still use the "parallel namespace"
// strategy