struct LegacySymbolMangler<'tcx> {
tcx: TyCtxt<'tcx>,
path: SymbolPath,
keep_within_component: bool,
}
Fields§
§tcx: TyCtxt<'tcx>
§path: SymbolPath
§keep_within_component: bool
Trait Implementations§
Source§impl<'tcx> PrettyPrinter<'tcx> for LegacySymbolMangler<'tcx>
impl<'tcx> PrettyPrinter<'tcx> for LegacySymbolMangler<'tcx>
Source§fn should_print_optional_region(&self, _region: Region<'_>) -> bool
fn should_print_optional_region(&self, _region: Region<'_>) -> bool
Returns
true
if the region should be printed in optional positions,
e.g., &'a T
or dyn Tr + 'b
. (Regions like the one in Cow<'static, T>
will always be printed.)Source§fn comma_sep<T>(
&mut self,
elems: impl Iterator<Item = T>,
) -> Result<(), PrintError>where
T: Print<'tcx, Self>,
fn comma_sep<T>(
&mut self,
elems: impl Iterator<Item = T>,
) -> Result<(), PrintError>where
T: Print<'tcx, Self>,
Prints comma-separated elements.
Source§fn generic_delimiters(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), PrintError>,
) -> Result<(), PrintError>
fn generic_delimiters( &mut self, f: impl FnOnce(&mut Self) -> Result<(), PrintError>, ) -> Result<(), PrintError>
Prints
<...>
around what f
prints.Source§fn pretty_print_value_path(
&mut self,
def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
) -> Result<(), Error>
fn pretty_print_value_path( &mut self, def_id: DefId, args: &'tcx [GenericArg<'tcx>], ) -> Result<(), Error>
Like
print_def_path
but for value paths.fn pretty_print_in_binder<T>( &mut self, value: &Binder<TyCtxt<'tcx>, T>, ) -> Result<(), Error>
fn wrap_binder<T, F>( &mut self, value: &Binder<TyCtxt<'tcx>, T>, _mode: WrapBinderMode, f: F, ) -> Result<(), Error>
Source§fn typed_value(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>,
t: impl FnOnce(&mut Self) -> Result<(), Error>,
conversion: &str,
) -> Result<(), Error>
fn typed_value( &mut self, f: impl FnOnce(&mut Self) -> Result<(), Error>, t: impl FnOnce(&mut Self) -> Result<(), Error>, conversion: &str, ) -> Result<(), Error>
Prints
{f: t}
or {f as t}
depending on the cast
argumentSource§fn parenthesized(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>,
) -> Result<(), Error>
fn parenthesized( &mut self, f: impl FnOnce(&mut Self) -> Result<(), Error>, ) -> Result<(), Error>
Prints
(...)
around what f
prints.Source§fn maybe_parenthesized(
&mut self,
f: impl FnOnce(&mut Self) -> Result<(), Error>,
parenthesized: bool,
) -> Result<(), Error>
fn maybe_parenthesized( &mut self, f: impl FnOnce(&mut Self) -> Result<(), Error>, parenthesized: bool, ) -> Result<(), Error>
Prints
(...)
around what f
prints if parenthesized
is true, otherwise just prints f
.fn should_truncate(&mut self) -> bool
fn reset_type_limit(&mut self)
Source§fn try_print_visible_def_path(&mut self, def_id: DefId) -> Result<bool, Error>
fn try_print_visible_def_path(&mut self, def_id: DefId) -> Result<bool, Error>
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 force_print_trimmed_def_path(&mut self, def_id: DefId) -> Result<bool, Error>
Source§fn try_print_trimmed_def_path(&mut self, def_id: DefId) -> Result<bool, Error>
fn try_print_trimmed_def_path(&mut self, def_id: DefId) -> Result<bool, Error>
Try to see if this path can be trimmed to a unique symbol name.
Source§fn try_print_visible_def_path_recur(
&mut self,
def_id: DefId,
callers: &mut Vec<DefId>,
) -> Result<bool, Error>
fn try_print_visible_def_path_recur( &mut self, def_id: DefId, callers: &mut Vec<DefId>, ) -> Result<bool, Error>
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. Read morefn pretty_print_path_with_qualified( &mut self, self_ty: Ty<'tcx>, trait_ref: Option<TraitRef<TyCtxt<'tcx>>>, ) -> Result<(), Error>
fn pretty_print_path_with_impl( &mut self, print_prefix: impl FnOnce(&mut Self) -> Result<(), Error>, self_ty: Ty<'tcx>, trait_ref: Option<TraitRef<TyCtxt<'tcx>>>, ) -> Result<(), Error>
fn pretty_print_type(&mut self, ty: Ty<'tcx>) -> Result<(), Error>
fn pretty_print_opaque_impl_type( &mut self, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Result<(), Error>
Source§fn insert_trait_and_projection(
&mut self,
trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>,
proj_ty: Option<(DefId, Binder<TyCtxt<'tcx>, Term<'tcx>>)>,
traits: &mut IndexMap<Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, IndexMap<DefId, Binder<TyCtxt<'tcx>, Term<'tcx>>, BuildHasherDefault<FxHasher>>, BuildHasherDefault<FxHasher>>,
fn_traits: &mut IndexMap<(Binder<TyCtxt<'tcx>, (&'tcx RawList<(), Ty<'tcx>>, Ty<'tcx>)>, bool), OpaqueFnEntry<'tcx>, BuildHasherDefault<FxHasher>>,
)
fn insert_trait_and_projection( &mut self, trait_pred: Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, proj_ty: Option<(DefId, Binder<TyCtxt<'tcx>, Term<'tcx>>)>, traits: &mut IndexMap<Binder<TyCtxt<'tcx>, TraitPredicate<TyCtxt<'tcx>>>, IndexMap<DefId, Binder<TyCtxt<'tcx>, Term<'tcx>>, BuildHasherDefault<FxHasher>>, BuildHasherDefault<FxHasher>>, fn_traits: &mut IndexMap<(Binder<TyCtxt<'tcx>, (&'tcx RawList<(), Ty<'tcx>>, Ty<'tcx>)>, bool), OpaqueFnEntry<'tcx>, BuildHasherDefault<FxHasher>>, )
Insert the trait ref and optionally a projection type associated with it into either the
traits map or fn_traits map, depending on if the trait is in the Fn* family of traits.
fn pretty_print_inherent_projection( &mut self, alias_ty: AliasTerm<TyCtxt<'tcx>>, ) -> Result<(), Error>
fn pretty_print_rpitit( &mut self, def_id: DefId, args: &'tcx RawList<(), GenericArg<'tcx>>, ) -> Result<(), Error>
fn ty_infer_name(&self, _: TyVid) -> Option<Symbol>
fn const_infer_name(&self, _: ConstVid) -> Option<Symbol>
fn pretty_print_dyn_existential( &mut self, predicates: &'tcx RawList<(), Binder<TyCtxt<'tcx>, ExistentialPredicate<TyCtxt<'tcx>>>>, ) -> Result<(), Error>
fn pretty_print_fn_sig( &mut self, inputs: &[Ty<'tcx>], c_variadic: bool, output: Ty<'tcx>, ) -> Result<(), Error>
fn pretty_print_const( &mut self, ct: Const<'tcx>, print_ty: bool, ) -> Result<(), Error>
fn pretty_print_const_expr( &mut self, expr: Expr<'tcx>, print_ty: bool, ) -> Result<(), Error>
fn pretty_print_const_scalar( &mut self, scalar: Scalar, ty: Ty<'tcx>, ) -> Result<(), Error>
fn pretty_print_const_scalar_ptr( &mut self, ptr: Pointer, ty: Ty<'tcx>, ) -> Result<(), Error>
fn pretty_print_const_scalar_int( &mut self, int: ScalarInt, ty: Ty<'tcx>, print_ty: bool, ) -> Result<(), Error>
Source§fn pretty_print_const_pointer<Prov>(
&mut self,
_: Pointer<Prov>,
ty: Ty<'tcx>,
) -> Result<(), Error>where
Prov: Provenance,
fn pretty_print_const_pointer<Prov>(
&mut self,
_: Pointer<Prov>,
ty: Ty<'tcx>,
) -> Result<(), Error>where
Prov: Provenance,
This is overridden for MIR printing because we only want to hide alloc ids from users, not
from MIR where it is actually useful.
fn pretty_print_byte_str(&mut self, byte_str: &'tcx [u8]) -> Result<(), Error>
fn pretty_print_const_valtree( &mut self, cv: Value<'tcx>, print_ty: bool, ) -> Result<(), Error>
fn pretty_print_closure_as_impl( &mut self, closure: ClosureArgs<TyCtxt<'tcx>>, ) -> Result<(), Error>
fn pretty_print_bound_constness( &mut self, constness: BoundConstness, ) -> Result<(), Error>
fn should_print_verbose(&self) -> bool
Source§impl<'tcx> Printer<'tcx> for LegacySymbolMangler<'tcx>
impl<'tcx> Printer<'tcx> for LegacySymbolMangler<'tcx>
fn tcx(&self) -> TyCtxt<'tcx>
Source§fn print_region(&mut self, _region: Region<'_>) -> Result<(), PrintError>
fn print_region(&mut self, _region: Region<'_>) -> Result<(), PrintError>
Appends a representation of a region.
Source§fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError>
fn print_type(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError>
Appends a representation of a type.
Source§fn print_dyn_existential(
&mut self,
predicates: &'tcx List<PolyExistentialPredicate<'tcx>>,
) -> Result<(), PrintError>
fn print_dyn_existential( &mut self, predicates: &'tcx List<PolyExistentialPredicate<'tcx>>, ) -> Result<(), PrintError>
Appends a representation of a list of
PolyExistentialPredicate
s.Source§fn print_const(&mut self, ct: Const<'tcx>) -> Result<(), PrintError>
fn print_const(&mut self, ct: Const<'tcx>) -> Result<(), PrintError>
Appends a representation of a const.
Source§fn print_crate_name(&mut self, cnum: CrateNum) -> Result<(), PrintError>
fn print_crate_name(&mut self, cnum: CrateNum) -> Result<(), PrintError>
Appends a representation of a crate name, e.g.
std
, or even ``.Source§fn print_path_with_qualified(
&mut self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>,
) -> Result<(), PrintError>
fn print_path_with_qualified( &mut self, self_ty: Ty<'tcx>, trait_ref: Option<TraitRef<'tcx>>, ) -> Result<(), PrintError>
Appends a representation of a qualified path segment, e.g.
<OsString as From<&T>>
.
If trait_ref
is None
, it may fall back to simpler forms, e.g. <Vec<T>>
or just Foo
.Source§fn print_path_with_impl(
&mut self,
print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>,
) -> Result<(), PrintError>
fn print_path_with_impl( &mut self, print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>, self_ty: Ty<'tcx>, trait_ref: Option<TraitRef<'tcx>>, ) -> Result<(), PrintError>
Source§fn print_path_with_simple(
&mut self,
print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>,
disambiguated_data: &DisambiguatedDefPathData,
) -> Result<(), PrintError>
fn print_path_with_simple( &mut self, print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>, disambiguated_data: &DisambiguatedDefPathData, ) -> Result<(), PrintError>
Appends a representation of a (full or partial) simple path, in two parts.
print_prefix
,
when called, appends the representation of the leading segments. The rest of the method
appends the representation of the final segment, the details of which are in
disambiguated_data
. Read moreSource§fn print_path_with_generic_args(
&mut self,
print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>,
args: &[GenericArg<'tcx>],
) -> Result<(), PrintError>
fn print_path_with_generic_args( &mut self, print_prefix: impl FnOnce(&mut Self) -> Result<(), PrintError>, args: &[GenericArg<'tcx>], ) -> Result<(), PrintError>
Appends a representation of a path ending in generic args, in two parts.
print_prefix
,
when called, appends the leading segments. The rest of the method appends the
representation of the generic args. (Some printers choose to skip appending the generic
args.) Read moreSource§fn print_impl_path(
&mut self,
impl_def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
) -> Result<(), PrintError>
fn print_impl_path( &mut self, impl_def_id: DefId, args: &'tcx [GenericArg<'tcx>], ) -> Result<(), PrintError>
Like
print_def_path
, but for DefPathData::Impl
.Source§fn print_def_path(
&mut self,
def_id: DefId,
args: &'tcx [GenericArg<'tcx>],
) -> Result<(), Error>
fn print_def_path( &mut self, def_id: DefId, args: &'tcx [GenericArg<'tcx>], ) -> Result<(), Error>
Appends a representation of an entity with a normal path, e.g. “std::io::Read”.
fn print_coroutine_with_kind( &mut self, def_id: DefId, parent_args: &'tcx [GenericArg<'tcx>], kind: Ty<'tcx>, ) -> Result<(), Error>
fn default_print_def_path( &mut self, def_id: DefId, args: &'tcx [GenericArg<'tcx>], ) -> Result<(), Error>
fn default_print_impl_path( &mut self, impl_def_id: DefId, self_ty: Ty<'tcx>, impl_trait_ref: Option<TraitRef<TyCtxt<'tcx>>>, ) -> Result<(), Error>
Auto Trait Implementations§
impl<'tcx> DynSend for LegacySymbolMangler<'tcx>
impl<'tcx> DynSync for LegacySymbolMangler<'tcx>
impl<'tcx> Freeze for LegacySymbolMangler<'tcx>
impl<'tcx> !RefUnwindSafe for LegacySymbolMangler<'tcx>
impl<'tcx> !Send for LegacySymbolMangler<'tcx>
impl<'tcx> !Sync for LegacySymbolMangler<'tcx>
impl<'tcx> Unpin for LegacySymbolMangler<'tcx>
impl<'tcx> !UnwindSafe for LegacySymbolMangler<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes