Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1987131

Browse files
authoredAug 26, 2016
Auto merge of #36008 - eddyb:compound-fail, r=michaelwoerister
Do not emit "class method" debuginfo for types that are not DICompositeType. Fixes #35991 by restricting the "class method" debuginfo sugar from #33358 to structs and enums only. r? @michaelwoerister
2 parents d00c245 + 8407952 commit 1987131

File tree

1 file changed

+9
-1
lines changed
  • src/librustc_trans/debuginfo

1 file changed

+9
-1
lines changed
 

‎src/librustc_trans/debuginfo/mod.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,15 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
419419
let impl_self_ty = monomorphize::apply_param_substs(cx.tcx(),
420420
instance.substs,
421421
&impl_self_ty);
422-
Some(type_metadata(cx, impl_self_ty, syntax_pos::DUMMY_SP))
422+
423+
// Only "class" methods are generally understood by LLVM,
424+
// so avoid methods on other types (e.g. `<*mut T>::null`).
425+
match impl_self_ty.sty {
426+
ty::TyStruct(..) | ty::TyEnum(..) => {
427+
Some(type_metadata(cx, impl_self_ty, syntax_pos::DUMMY_SP))
428+
}
429+
_ => None
430+
}
423431
} else {
424432
// For trait method impls we still use the "parallel namespace"
425433
// strategy

0 commit comments

Comments
 (0)
Failed to load comments.