[][src]Trait rustc::ty::print::pretty::PrettyPrinter

pub trait PrettyPrinter<'tcx>: Printer<'tcx, Error = Error, Path = Self, Region = Self, Type = Self, DynExistential = Self, Const = Self> + Write {
    fn generic_delimiters(
        self,
        f: impl FnOnce(Self) -> Result<Self, Self::Error>
    ) -> Result<Self, Self::Error>;
fn region_should_not_be_omitted(&self, region: Region) -> bool; fn print_value_path(
        self,
        def_id: DefId,
        substs: &'tcx [GenericArg<'tcx>]
    ) -> Result<Self::Path, Self::Error> { ... }
fn in_binder<T>(self, value: &Binder<T>) -> Result<Self, Self::Error>
    where
        T: Print<'tcx, Self, Output = Self, Error = Self::Error> + TypeFoldable<'tcx>
, { ... }
fn comma_sep<T>(
        self,
        elems: impl Iterator<Item = T>
    ) -> Result<Self, Self::Error>
    where
        T: Print<'tcx, Self, Output = Self, Error = Self::Error>
, { ... }
fn try_print_visible_def_path(
        self,
        def_id: DefId
    ) -> Result<(Self, bool), Self::Error> { ... }
fn try_print_visible_def_path_recur(
        self,
        def_id: DefId,
        callers: &mut Vec<DefId>
    ) -> Result<(Self, bool), Self::Error> { ... }
fn pretty_path_qualified(
        self,
        self_ty: Ty<'tcx>,
        trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error> { ... }
fn pretty_path_append_impl(
        self,
        print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
        self_ty: Ty<'tcx>,
        trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error> { ... }
fn pretty_print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error> { ... }
fn infer_ty_name(&self, _: TyVid) -> Option<String> { ... }
fn pretty_print_dyn_existential(
        self,
        predicates: &'tcx List<ExistentialPredicate<'tcx>>
    ) -> Result<Self::DynExistential, Self::Error> { ... }
fn pretty_fn_sig(
        self,
        inputs: &[Ty<'tcx>],
        c_variadic: bool,
        output: Ty<'tcx>
    ) -> Result<Self, Self::Error> { ... }
fn pretty_print_const(
        self,
        ct: &'tcx Const<'tcx>,
        print_ty: bool
    ) -> Result<Self::Const, Self::Error> { ... }
fn pretty_print_const_value(
        self,
        ct: ConstValue<'tcx>,
        ty: Ty<'tcx>,
        print_ty: bool
    ) -> Result<Self::Const, Self::Error> { ... } }
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Trait for printers that pretty-print using fmt::Write to the printer.

Required methods

fn generic_delimiters(
    self,
    f: impl FnOnce(Self) -> Result<Self, Self::Error>
) -> Result<Self, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Prints <...> around what f prints.

fn region_should_not_be_omitted(&self, region: Region) -> bool

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns true if the region should be printed in optional positions, e.g., &'a T or dyn Tr + 'b. This is typically the case for all non-'_ regions.

Loading content...

Provided methods

fn print_value_path(
    self,
    def_id: DefId,
    substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Like print_def_path but for value paths.

fn in_binder<T>(self, value: &Binder<T>) -> Result<Self, Self::Error> where
    T: Print<'tcx, Self, Output = Self, Error = Self::Error> + TypeFoldable<'tcx>, 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn comma_sep<T>(
    self,
    elems: impl Iterator<Item = T>
) -> Result<Self, Self::Error> where
    T: Print<'tcx, Self, Output = Self, Error = Self::Error>, 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Prints comma-separated elements.

fn try_print_visible_def_path(
    self,
    def_id: DefId
) -> Result<(Self, bool), Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If possible, this returns a global path resolving to def_id that is visible from at least one local module, and returns true. If the crate defining def_id is declared with an extern crate, the path is guaranteed to use the extern crate.

fn try_print_visible_def_path_recur(
    self,
    def_id: DefId,
    callers: &mut Vec<DefId>
) -> Result<(Self, bool), Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Does the work of try_print_visible_def_path, building the full definition path recursively before attempting to post-process it into the valid and visible version that accounts for re-exports.

This method should only be callled by itself or try_print_visible_def_path.

callers is a chain of visible_parent's leading to def_id, to support cycle detection during recursion.

fn pretty_path_qualified(
    self,
    self_ty: Ty<'tcx>,
    trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_path_append_impl(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    self_ty: Ty<'tcx>,
    trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn infer_ty_name(&self, _: TyVid) -> Option<String>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_print_dyn_existential(
    self,
    predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_fn_sig(
    self,
    inputs: &[Ty<'tcx>],
    c_variadic: bool,
    output: Ty<'tcx>
) -> Result<Self, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_print_const(
    self,
    ct: &'tcx Const<'tcx>,
    print_ty: bool
) -> Result<Self::Const, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn pretty_print_const_value(
    self,
    ct: ConstValue<'tcx>,
    ty: Ty<'tcx>,
    print_ty: bool
) -> Result<Self::Const, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Implementors

impl<'tcx, '_, F: Write> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx, F>[src]

Loading content...