about summary refs log tree commit diff
path: root/src/librustc_codegen_utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_codegen_utils')
-rw-r--r--src/librustc_codegen_utils/lib.rs1
-rw-r--r--src/librustc_codegen_utils/symbol_names.rs19
2 files changed, 12 insertions, 8 deletions
diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs
index 2b70141894b..466cf40a157 100644
--- a/src/librustc_codegen_utils/lib.rs
+++ b/src/librustc_codegen_utils/lib.rs
@@ -4,6 +4,7 @@
 
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 
+#![feature(arbitrary_self_types)]
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(custom_attribute)]
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs
index 56ef15b12a0..6bd9b159775 100644
--- a/src/librustc_codegen_utils/symbol_names.rs
+++ b/src/librustc_codegen_utils/symbol_names.rs
@@ -225,8 +225,7 @@ fn get_symbol_hash<'a, 'tcx>(
 
 fn def_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> ty::SymbolName {
     item_path::with_forced_absolute_paths(|| {
-        let mut cx = PrintCx::new(tcx);
-        SymbolPathPrinter::print_item_path(&mut cx, def_id).into_interned()
+        PrintCx::new(tcx, SymbolPathPrinter).print_item_path(def_id).into_interned()
     })
 }
 
@@ -401,17 +400,21 @@ struct SymbolPathPrinter;
 impl ItemPathPrinter for SymbolPathPrinter {
     type Path = SymbolPath;
 
-    fn path_crate(cx: &mut PrintCx<'_, '_, '_>, cnum: CrateNum) -> Self::Path {
-        let mut path = SymbolPath::new(cx.tcx);
-        path.push(&cx.tcx.original_crate_name(cnum).as_str());
+    fn path_crate(self: &mut PrintCx<'_, '_, '_, Self>, cnum: CrateNum) -> Self::Path {
+        let mut path = SymbolPath::new(self.tcx);
+        path.push(&self.tcx.original_crate_name(cnum).as_str());
         path
     }
-    fn path_impl(cx: &mut PrintCx<'_, '_, '_>, text: &str) -> Self::Path {
-        let mut path = SymbolPath::new(cx.tcx);
+    fn path_impl(self: &mut PrintCx<'_, '_, '_, Self>, text: &str) -> Self::Path {
+        let mut path = SymbolPath::new(self.tcx);
         path.push(text);
         path
     }
-    fn path_append(mut path: Self::Path, text: &str) -> Self::Path {
+    fn path_append(
+        self: &mut PrintCx<'_, '_, '_, Self>,
+        mut path: Self::Path,
+        text: &str,
+    ) -> Self::Path {
         path.push(text);
         path
     }