diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-06-03 15:41:48 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-06-03 15:59:52 +0200 |
| commit | 32ee368c867d2aa977ebaca79b4b5ed8ed689fa3 (patch) | |
| tree | 264b8cd9cb10bee579008655aa525e7cfc0c247a | |
| parent | 716394d6581b60c75cfdd88b8e5b876f2db88b62 (diff) | |
| download | rust-32ee368c867d2aa977ebaca79b4b5ed8ed689fa3.tar.gz rust-32ee368c867d2aa977ebaca79b4b5ed8ed689fa3.zip | |
Show `::{{constructor}}` in std::any::type_name().
| -rw-r--r-- | compiler/rustc_mir/src/interpret/intrinsics/type_name.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_mir/src/interpret/intrinsics/type_name.rs b/compiler/rustc_mir/src/interpret/intrinsics/type_name.rs index ae5e78ee33f..2707d138e6a 100644 --- a/compiler/rustc_mir/src/interpret/intrinsics/type_name.rs +++ b/compiler/rustc_mir/src/interpret/intrinsics/type_name.rs @@ -1,5 +1,5 @@ use rustc_hir::def_id::CrateNum; -use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; +use rustc_hir::definitions::DisambiguatedDefPathData; use rustc_middle::mir::interpret::Allocation; use rustc_middle::ty::{ self, @@ -127,11 +127,6 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> { ) -> Result<Self::Path, Self::Error> { self = print_prefix(self)?; - // Skip `::{{constructor}}` on tuple/unit structs. - if disambiguated_data.data == DefPathData::Ctor { - return Ok(self); - } - write!(self.path, "::{}", disambiguated_data.data).unwrap(); Ok(self) |
