about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2019-01-24 19:52:43 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2019-03-15 13:25:10 +0200
commitffa00d4628aac6503d7ef04b9f37a52ed6104dfc (patch)
treec2d226c2048a1b840fbb8e09fd31613653b3012b /src/librustc_codegen_utils
parent4deaa69b429442c0e25a7828cfd63d7be78772d8 (diff)
downloadrust-ffa00d4628aac6503d7ef04b9f37a52ed6104dfc.tar.gz
rust-ffa00d4628aac6503d7ef04b9f37a52ed6104dfc.zip
rustc: make `pretty_path_generic_args`' task as simple as possible.
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/symbol_names.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs
index 1edb5dfe2b8..93e7e495d4e 100644
--- a/src/librustc_codegen_utils/symbol_names.rs
+++ b/src/librustc_codegen_utils/symbol_names.rs
@@ -94,7 +94,7 @@ use rustc::hir::map::definitions::DefPathData;
 use rustc::ich::NodeIdHashingMode;
 use rustc::ty::print::{PrettyPrinter, PrintCx, Printer};
 use rustc::ty::query::Providers;
-use rustc::ty::subst::SubstsRef;
+use rustc::ty::subst::{Kind, SubstsRef, UnpackedKind};
 use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
 use rustc::util::common::record_time;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@@ -503,11 +503,16 @@ impl Printer for SymbolPath {
         print_prefix: impl FnOnce(
             PrintCx<'_, 'gcx, 'tcx, Self>,
         ) -> Result<Self::Path, Self::Error>,
-        params: &[ty::GenericParamDef],
-        substs: SubstsRef<'tcx>,
+        args: impl Iterator<Item = Kind<'tcx>> + Clone,
         projections: impl Iterator<Item = ty::ExistentialProjection<'tcx>>,
     )  -> Result<Self::Path, Self::Error> {
-        self.pretty_path_generic_args(print_prefix, params, substs, projections)
+        let args = args.filter(|arg| {
+            match arg.unpack() {
+                UnpackedKind::Lifetime(_) => false,
+                _ => true,
+            }
+        });
+        self.pretty_path_generic_args(print_prefix, args, projections)
     }
 }