Skip to content

Commit

Permalink
rustc_codegen_llvm: don't generate Self type debuginfo for methods fo…
Browse files Browse the repository at this point in the history
…r -Cdebuginfo=1.
  • Loading branch information
eddyb committed Mar 23, 2020
1 parent 7023948 commit c923f04
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_codegen_llvm/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,12 @@ impl DebugInfoMethods<'tcx> for CodegenCx<'ll, 'tcx> {
// so avoid methods on other types (e.g., `<*mut T>::null`).
match impl_self_ty.kind {
ty::Adt(def, ..) if !def.is_box() => {
Some(type_metadata(cx, impl_self_ty, rustc_span::DUMMY_SP))
// Again, only create type information if full debuginfo is enabled
if cx.sess().opts.debuginfo == DebugInfo::Full {
Some(type_metadata(cx, impl_self_ty, rustc_span::DUMMY_SP))
} else {
Some(namespace::item_namespace(cx, def.did))
}
}
_ => None,
}
Expand Down

0 comments on commit c923f04

Please sign in to comment.