about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/debuginfo
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2020-02-11 23:03:00 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2020-03-23 02:36:35 +0200
commitc923f045ce84ac846a732e0428e8458d6a61725d (patch)
treef1ecd2dff4e354c4d3acf08895b26c5958b3d1ef /src/librustc_codegen_llvm/debuginfo
parent70239484001f91fcf847a0df6aff79d94991952a (diff)
downloadrust-c923f045ce84ac846a732e0428e8458d6a61725d.tar.gz
rust-c923f045ce84ac846a732e0428e8458d6a61725d.zip
rustc_codegen_llvm: don't generate Self type debuginfo for methods for -Cdebuginfo=1.
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
-rw-r--r--src/librustc_codegen_llvm/debuginfo/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs
index 41829d4ee42..4b8140263f1 100644
--- a/src/librustc_codegen_llvm/debuginfo/mod.rs
+++ b/src/librustc_codegen_llvm/debuginfo/mod.rs
@@ -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,
                     }