about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-31 05:32:54 +0000
committerbors <bors@rust-lang.org>2020-08-31 05:32:54 +0000
commit8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0 (patch)
tree2e09cb1b383f3c8fef2cc70f55b9939d7be29310 /compiler/rustc_codegen_llvm/src
parente98f0632bbec24b196dbd6fc820537f6f3724807 (diff)
parent6ff471b1cf85dea0e8f83b5212042905aac35143 (diff)
downloadrust-8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0.tar.gz
rust-8ed5cb56b5e5cc216eb6820a44dd4f7ef65107b0.zip
Auto merge of #76027 - davidtwco:issue-61139-remove-obsolete-pretty-printer, r=eddyb
ty: remove obsolete pretty printer

Fixes #61139.

This PR removes the obsolete printer and replaces all uses of it with `FmtPrinter`. Of the replaced uses, all but one use was in `debug!` logging, two cases were notable:

- `MonoItem::to_string` is used in `-Z print-mono-items` and therefore affects the output of all codegen-units tests (which have been updated).
- `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs` with `LLVMStructCreateNamed` and that'll now get different values, but nothing will break as a result of this.

cc @eddyb (whom I've discussed this with)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/type_of.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_llvm/src/type_of.rs b/compiler/rustc_codegen_llvm/src/type_of.rs
index 40870c66475..60a4e362600 100644
--- a/compiler/rustc_codegen_llvm/src/type_of.rs
+++ b/compiler/rustc_codegen_llvm/src/type_of.rs
@@ -4,7 +4,6 @@ use crate::type_::Type;
 use rustc_codegen_ssa::traits::*;
 use rustc_middle::bug;
 use rustc_middle::ty::layout::{FnAbiExt, TyAndLayout};
-use rustc_middle::ty::print::obsolete::DefPathBasedNames;
 use rustc_middle::ty::{self, Ty, TypeFoldable};
 use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape};
 use rustc_target::abi::{Int, Pointer, F32, F64};
@@ -60,9 +59,7 @@ fn uncached_llvm_type<'a, 'tcx>(
         // ty::Dynamic(..) |
         ty::Foreign(..) |
         ty::Str => {
-            let mut name = String::with_capacity(32);
-            let printer = DefPathBasedNames::new(cx.tcx, true, true);
-            printer.push_type_name(layout.ty, &mut name, false);
+            let mut name = layout.ty.to_string();
             if let (&ty::Adt(def, _), &Variants::Single { index })
                  = (&layout.ty.kind, &layout.variants)
             {