Skip to content
Permalink
Browse files

Fix rebase fallout and address some review comments.

  • Loading branch information...
eddyb committed Mar 14, 2019
1 parent 4653ae1 commit 0ee059d5a08662b22250e28dbd5d5a9502303afb
Showing with 9 additions and 1 deletion.
  1. +8 −0 src/librustc/ty/print/mod.rs
  2. +1 −1 src/librustc/ty/structural_impls.rs
@@ -16,6 +16,14 @@ pub trait Print<'gcx, 'tcx, P> {
fn print(&self, cx: P) -> Result<Self::Output, Self::Error>;
}

/// Interface for outputting user-facing "type-system entities"
/// (paths, types, lifetimes, constants, etc.) as a side-effect
/// (e.g. formatting, like `PrettyPrinter` implementors do) or by
/// constructing some alternative representation (e.g. an AST),
/// which the associated types allow passing through the methods.
///
/// For pretty-printing/formatting in particular, see `PrettyPrinter`.
// FIXME(eddyb) find a better name, this is more general than "printing".
pub trait Printer<'gcx: 'tcx, 'tcx>: Sized {
type Error;

@@ -225,7 +225,7 @@ impl fmt::Debug for ty::FloatVarValue {

impl fmt::Debug for ty::TraitRef<'tcx> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// HACK(eddyb) this is used across the compiler to print
// FIXME(#59188) this is used across the compiler to print
// a `TraitRef` qualified (with the Self type explicit),
// instead of having a different way to make that choice.
write!(f, "<{} as {}>", self.self_ty(), self)

0 comments on commit 0ee059d

Please sign in to comment.
You can’t perform that action at this time.