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<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<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 "_" terminator
  • x > 0 is encoded as x - 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 the tag followed by push_integer_62(x - 1) e.g. 1 becomes tag + "_", 2 becomes tag + "0_", etc.

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

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