Struct rustc_symbol_mangling::v0::SymbolMangler [−][src]
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: String
start_offset: usize
The 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 = 0
is encoded as just the"_"
terminatorx > 0
is encoded asx - 1
in base 62, followed by"_"
, e.g.1
becomes"0_"
,62
becomes"Z_"
, etc.
Push a tag
-prefixed base 62 integer, when larger than 0
, that is:
x = 0
is encoded as""
(nothing)x > 0
is encoded as thetag
followed bypush_integer_62(x - 1)
e.g.1
becomestag + "_"
,2
becomestag + "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: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
fn generic_args_to_print(
&self,
generics: &'tcx Generics,
substs: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for SymbolMangler<'tcx>
impl<'tcx> !Send for SymbolMangler<'tcx>
impl<'tcx> !Sync for SymbolMangler<'tcx>
impl<'tcx> Unpin for SymbolMangler<'tcx>
impl<'tcx> !UnwindSafe for SymbolMangler<'tcx>
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