diff options
| author | David Wood <david@davidtw.co> | 2020-08-28 14:31:03 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-08-30 18:59:07 +0100 |
| commit | 6ff471b1cf85dea0e8f83b5212042905aac35143 (patch) | |
| tree | 61e0a1c61aecc0fa4033cca2b4ea923a54745e6a /compiler/rustc_codegen_llvm/src | |
| parent | 85fbf49ce0e2274d0acf798f6e703747674feec3 (diff) | |
| download | rust-6ff471b1cf85dea0e8f83b5212042905aac35143.tar.gz rust-6ff471b1cf85dea0e8f83b5212042905aac35143.zip | |
ty: remove obsolete printer
This commit 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. - `DefPathBasedNames` was used in `librustc_codegen_llvm/type_of.rs` with `LLVMStructCreateNamed` and that'll now get different values, but this should result in no functional change. Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/type_of.rs | 5 |
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) { |
