about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/debuginfo
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-07 08:51:54 +0100
committerGitHub <noreply@github.com>2019-11-07 08:51:54 +0100
commita3c8572b545124b62dcd16fb4b354f2efe842f35 (patch)
treec21598f8cc63ad1dd05bb08a79fab08e8ff97ffc /src/librustc_codegen_ssa/debuginfo
parentd7f1406378a31b9f5e9012d882ae237131e3c252 (diff)
parenta12a32ab652d63e342f482566c767042609ab1a6 (diff)
Rollup merge of #65752 - estebank:sugg, r=Centril
Use structured suggestions for missing associated items

When encountering an `impl` that is missing associated items required by its `trait`, use structured suggestions at an appropriate place in the `impl`.
Diffstat (limited to 'src/librustc_codegen_ssa/debuginfo')
-rw-r--r--src/librustc_codegen_ssa/debuginfo/type_names.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_codegen_ssa/debuginfo/type_names.rs b/src/librustc_codegen_ssa/debuginfo/type_names.rs
index 166a74fe487..b9fa53d638f 100644
--- a/src/librustc_codegen_ssa/debuginfo/type_names.rs
+++ b/src/librustc_codegen_ssa/debuginfo/type_names.rs
@@ -76,9 +76,7 @@ pub fn push_debuginfo_type_name<'tcx>(
             if !cpp_like_names {
                 output.push('&');
             }
-            if mutbl == hir::MutMutable {
-                output.push_str("mut ");
-            }
+            output.push_str(mutbl.prefix_str());
 
             push_debuginfo_type_name(tcx, inner_type, true, output, visited);
 
@@ -140,9 +138,7 @@ pub fn push_debuginfo_type_name<'tcx>(
 
 
             let sig = t.fn_sig(tcx);
-            if sig.unsafety() == hir::Unsafety::Unsafe {
-                output.push_str("unsafe ");
-            }
+            output.push_str(sig.unsafety().prefix_str());
 
             let abi = sig.abi();
             if abi != rustc_target::spec::abi::Abi::Rust {