Struct rustc_symbol_mangling::v0::SymbolMangler
source · [−]struct SymbolMangler<'tcx> {
tcx: TyCtxt<'tcx>,
binders: Vec<BinderLevel>,
out: String,
start_offset: usize,
paths: FxHashMap<(DefId, &'tcx [GenericArg<'tcx>]), usize>,
types: FxHashMap<Ty<'tcx>, usize>,
consts: FxHashMap<&'tcx Const<'tcx>, usize>,
}Fields
tcx: TyCtxt<'tcx>binders: Vec<BinderLevel>out: Stringstart_offset: usizeThe length of the prefix in out (e.g. 2 for _R).
paths: FxHashMap<(DefId, &'tcx [GenericArg<'tcx>]), usize>The values are start positions in out, in bytes.
types: FxHashMap<Ty<'tcx>, usize>consts: FxHashMap<&'tcx Const<'tcx>, usize>Implementations
Push a _-terminated base 62 integer, using the format
specified in the RFC as <base-62-number>, that is:
x = 0is encoded as just the"_"terminatorx > 0is encoded asx - 1in base 62, followed by"_", e.g.1becomes"0_",62becomes"Z_", etc.
Push a tag-prefixed base 62 integer, when larger than 0, that is:
x = 0is encoded as""(nothing)x > 0is encoded as thetagfollowed bypush_integer_62(x - 1)e.g.1becomestag + "_",2becomestag + "0_", etc.
Trait Implementations
type Path = Self
type Region = Self
type Type = Self
type DynExistential = Self
type Const = Self
fn print_def_path(
self,
def_id: DefId,
substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
fn 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>
fn print_dyn_existential(
self,
predicates: &'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>
) -> Result<Self::DynExistential, Self::Error>
fn path_qualified(
self,
self_ty: Ty<'tcx>,
trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
fn path_append_impl(
self,
_: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
_: &DisambiguatedDefPathData,
_: Ty<'tcx>,
_: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
fn path_append(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>
fn path_generic_args(
self,
print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
fn default_print_def_path(
self,
def_id: DefId,
substs: &[GenericArg]
) -> Result<Self::Path, Self::Error>
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for SymbolMangler
impl<'tcx> !Send for SymbolMangler
impl<'tcx> !Sync for SymbolMangler
impl<'tcx> Unpin for SymbolMangler
impl<'tcx> !UnwindSafe for SymbolMangler
Blanket Implementations
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: 160 bytes