Skip to content

Commit 55c21e9

Browse files
tgross35mattstam
authored andcommitted
Add v0 symbol mangling for f16 and f128
As discussed at <rust-lang/rust#122106>, use the crate encoding to represent new primitives. (cherry picked from commit 809b84e)
1 parent a500e59 commit 55c21e9

File tree

2 files changed

+4
-3
lines changed
  • compiler/rustc_symbol_mangling/src
  • src/doc/rustc/src/symbol-mangling

2 files changed

+4
-3
lines changed

compiler/rustc_symbol_mangling/src/v0.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,10 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
318318
ty::Uint(UintTy::U64) => "y",
319319
ty::Uint(UintTy::U128) => "o",
320320
ty::Uint(UintTy::Usize) => "j",
321-
// FIXME(f16_f128): update these once `rustc-demangle` supports the new types
322-
ty::Float(FloatTy::F16) => unimplemented!("f16_f128"),
321+
ty::Float(FloatTy::F16) => "C3f16",
323322
ty::Float(FloatTy::F32) => "f",
324323
ty::Float(FloatTy::F64) => "d",
325-
ty::Float(FloatTy::F128) => unimplemented!("f16_f128"),
324+
ty::Float(FloatTy::F128) => "C4f128",
326325
ty::Never => "z",
327326

328327
// Placeholders (should be demangled as `_`).

src/doc/rustc/src/symbol-mangling/v0.md

+2
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ The type encodings based on the initial tag character are:
739739
* `z` — `!`
740740
* `p` — [placeholder] `_`
741741
742+
Remaining primitives are encoded as a crate production, e.g. `C4f128`.
743+
742744
* `A` — An [array][reference-array] `[T; N]`.
743745
744746
> <span id="array-type">array-type</span> → `A` *[type]* *[const]*

0 commit comments

Comments
 (0)