Skip to content

Commit e9383e9

Browse files
committed
Remove type_name::AbsolutePathPrinter::comma_sep.
It's equivalent to the default `PrettyPrinter::comma_sep`.
1 parent a21d4c5 commit e9383e9

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

compiler/rustc_const_eval/src/util/type_name.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_data_structures::intern::Interned;
44
use rustc_hir::def_id::CrateNum;
55
use rustc_hir::definitions::DisambiguatedDefPathData;
66
use rustc_middle::bug;
7-
use rustc_middle::ty::print::{PrettyPrinter, Print, PrintError, Printer};
7+
use rustc_middle::ty::print::{PrettyPrinter, PrintError, Printer};
88
use rustc_middle::ty::{self, GenericArg, GenericArgKind, Ty, TyCtxt};
99

1010
struct AbsolutePathPrinter<'tcx> {
@@ -138,19 +138,6 @@ impl<'tcx> PrettyPrinter<'tcx> for AbsolutePathPrinter<'tcx> {
138138
fn should_print_region(&self, _region: ty::Region<'_>) -> bool {
139139
false
140140
}
141-
fn comma_sep<T>(&mut self, mut elems: impl Iterator<Item = T>) -> Result<(), PrintError>
142-
where
143-
T: Print<'tcx, Self>,
144-
{
145-
if let Some(first) = elems.next() {
146-
first.print(self)?;
147-
for elem in elems {
148-
self.path.push_str(", ");
149-
elem.print(self)?;
150-
}
151-
}
152-
Ok(())
153-
}
154141

155142
fn generic_delimiters(
156143
&mut self,

compiler/rustc_symbol_mangling/src/legacy.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,8 @@ impl<'tcx> PrettyPrinter<'tcx> for SymbolPrinter<'tcx> {
460460
fn should_print_region(&self, _region: ty::Region<'_>) -> bool {
461461
false
462462
}
463+
464+
// Identical to `PrettyPrinter::comma_sep` except there is no space after each comma.
463465
fn comma_sep<T>(&mut self, mut elems: impl Iterator<Item = T>) -> Result<(), PrintError>
464466
where
465467
T: Print<'tcx, Self>,

0 commit comments

Comments
 (0)