Struct rustc_symbol_mangling::v0::SymbolMangler[−][src]

struct SymbolMangler<'tcx> {
    tcx: TyCtxt<'tcx>,
    compress: Option<Box<CompressionCaches<'tcx>>>,
    binders: Vec<BinderLevel>,
    out: String,
}

Fields

tcx: TyCtxt<'tcx>compress: Option<Box<CompressionCaches<'tcx>>>binders: Vec<BinderLevel>out: String

Implementations

impl<'tcx> SymbolMangler<'tcx>[src]

fn push(&mut self, s: &str)[src]

fn push_integer_62(&mut self, x: u64)[src]

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.

fn push_opt_integer_62(&mut self, tag: &str, x: u64)[src]

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.

fn push_disambiguator(&mut self, dis: u64)[src]

fn push_ident(&mut self, ident: &str)[src]

fn path_append_ns(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self, !>,
    ns: char,
    disambiguator: u64,
    name: &str
) -> Result<Self, !>
[src]

fn print_backref(self, i: usize) -> Result<Self, !>[src]

fn in_binder<T>(
    self,
    value: &Binder<'tcx, T>,
    print_value: impl FnOnce(Self, &T) -> Result<Self, !>
) -> Result<Self, !> where
    T: TypeFoldable<'tcx>, 
[src]

Trait Implementations

impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx>[src]

type Error = !

type Path = Self

type Region = Self

type Type = Self

type DynExistential = Self

type Const = Self

fn tcx(&self) -> TyCtxt<'tcx>[src]

fn print_def_path(
    self,
    def_id: DefId,
    substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
[src]

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>
[src]

fn print_region(self, region: Region<'_>) -> Result<Self::Region, Self::Error>[src]

fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>[src]

fn print_dyn_existential(
    self,
    predicates: &'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>
) -> Result<Self::DynExistential, Self::Error>
[src]

fn print_const(self, ct: &'tcx Const<'tcx>) -> Result<Self::Const, Self::Error>[src]

fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error>[src]

fn path_qualified(
    self,
    self_ty: Ty<'tcx>,
    trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
[src]

fn path_append_impl(
    self,
    _: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    _: &DisambiguatedDefPathData,
    _: Ty<'tcx>,
    _: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
[src]

fn path_append(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>
[src]

fn path_generic_args(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
[src]

fn default_print_def_path(
    self,
    def_id: DefId,
    substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>
[src]

fn generic_args_to_print(
    &self,
    generics: &'tcx Generics,
    substs: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]
[src]

fn default_print_impl_path(
    self,
    impl_def_id: DefId,
    _substs: &'tcx [GenericArg<'tcx>],
    self_ty: &'tcx TyS<'tcx>,
    impl_trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.