diff options
Diffstat (limited to 'compiler/rustc_symbol_mangling/src/v0.rs')
| -rw-r--r-- | compiler/rustc_symbol_mangling/src/v0.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/rustc_symbol_mangling/src/v0.rs b/compiler/rustc_symbol_mangling/src/v0.rs index 58b67c77a61..57b1542ff5a 100644 --- a/compiler/rustc_symbol_mangling/src/v0.rs +++ b/compiler/rustc_symbol_mangling/src/v0.rs @@ -1,10 +1,11 @@ -use rustc_data_structures::base_n; +use rustc_data_structures::base_n::ToBaseN; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::intern::Interned; use rustc_hir as hir; use rustc_hir::def::CtorKind; use rustc_hir::def_id::{CrateNum, DefId}; use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; +use rustc_middle::bug; use rustc_middle::ty::layout::IntegerExt; use rustc_middle::ty::print::{Print, PrintError, Printer}; use rustc_middle::ty::{ @@ -318,11 +319,10 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { ty::Uint(UintTy::U64) => "y", ty::Uint(UintTy::U128) => "o", ty::Uint(UintTy::Usize) => "j", - // FIXME(f16_f128): update these once `rustc-demangle` supports the new types - ty::Float(FloatTy::F16) => unimplemented!("f16_f128"), + ty::Float(FloatTy::F16) => "C3f16", ty::Float(FloatTy::F32) => "f", ty::Float(FloatTy::F64) => "d", - ty::Float(FloatTy::F128) => unimplemented!("f16_f128"), + ty::Float(FloatTy::F128) => "C4f128", ty::Never => "z", // Placeholders (should be demangled as `_`). @@ -424,7 +424,7 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { ty::FnPtr(sig) => { self.push("F"); self.in_binder(&sig, |cx, sig| { - if sig.unsafety == hir::Unsafety::Unsafe { + if sig.safety == hir::Safety::Unsafe { cx.push("U"); } match sig.abi { @@ -629,8 +629,7 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { let pointee_ty = ct .ty() .builtin_deref(true) - .expect("tried to dereference on non-ptr type") - .ty; + .expect("tried to dereference on non-ptr type"); // FIXME(const_generics): add an assert that we only do this for valtrees. let dereferenced_const = self.tcx.mk_ct_from_kind(ct.kind(), pointee_ty); dereferenced_const.print(self)?; @@ -831,7 +830,7 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> { /// e.g. `1` becomes `"0_"`, `62` becomes `"Z_"`, etc. pub(crate) fn push_integer_62(x: u64, output: &mut String) { if let Some(x) = x.checked_sub(1) { - base_n::push_str(x as u128, base_n::ALPHANUMERIC_ONLY, output); + output.push_str(&x.to_base(62)); } output.push('_'); } |
