[−][src]Trait rustc_middle::ty::print::Printer
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.
Associated Types
Loading content...Required methods
pub fn tcx<'a>(&'a self) -> TyCtxt<'tcx>[src]
pub fn print_region(
self,
region: Region<'_>
) -> Result<Self::Region, Self::Error>[src]
self,
region: Region<'_>
) -> Result<Self::Region, Self::Error>
pub fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>[src]
pub fn print_dyn_existential(
self,
predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>[src]
self,
predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>
pub fn print_const(
self,
ct: &'tcx Const<'tcx>
) -> Result<Self::Const, Self::Error>[src]
self,
ct: &'tcx Const<'tcx>
) -> Result<Self::Const, Self::Error>
pub fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error>[src]
pub fn path_qualified(
self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
pub fn path_append_impl(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
pub fn path_append(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>
pub fn path_generic_args(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
Provided methods
pub fn print_def_path(
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>[src]
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
pub fn print_impl_path(
self,
impl_def_id: DefId,
substs: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
impl_def_id: DefId,
substs: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
pub fn default_print_def_path(
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>[src]
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
pub fn generic_args_to_print(
&self,
generics: &'tcx Generics,
substs: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>][src]
&self,
generics: &'tcx Generics,
substs: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]
pub fn default_print_impl_path(
self,
impl_def_id: DefId,
_substs: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
impl_trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
impl_def_id: DefId,
_substs: &'tcx [GenericArg<'tcx>],
self_ty: Ty<'tcx>,
impl_trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
Implementors
impl<F: Write, 'tcx, '_> Printer<'tcx> for FmtPrinter<'_, 'tcx, F>[src]
type Error = Error
type Path = Self
type Region = Self
type Type = Self
type DynExistential = Self
type Const = Self
pub fn tcx<'a>(&'a self) -> TyCtxt<'tcx>[src]
pub fn print_def_path(
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>[src]
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
pub fn print_region(
self,
region: Region<'_>
) -> Result<Self::Region, Self::Error>[src]
self,
region: Region<'_>
) -> Result<Self::Region, Self::Error>
pub fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>[src]
pub fn print_dyn_existential(
self,
predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>[src]
self,
predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>
pub fn print_const(
self,
ct: &'tcx Const<'tcx>
) -> Result<Self::Const, Self::Error>[src]
self,
ct: &'tcx Const<'tcx>
) -> Result<Self::Const, Self::Error>
pub fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error>[src]
pub fn path_qualified(
self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
pub fn path_append_impl(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
_disambiguated_data: &DisambiguatedDefPathData,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
_disambiguated_data: &DisambiguatedDefPathData,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
pub fn path_append(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>
pub fn path_generic_args(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>[src]
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>