@@ -625,12 +625,12 @@ Mangled names conform to the following grammar:
625
625
// The <decimal-number> specifies the encoding version.
626
626
<symbol-name> = "_R" [<decimal-number>] <path> [<instantiating-crate>]
627
627
628
- <path> = "C" <identifier> // crate root
629
- | "M" <impl-path> <type> // <T> (inherent impl)
630
- | "X" <impl-path> <type> <path> // <T as Trait> (trait impl)
631
- | "Y" <type> <path> // <T as Trait> (trait definition)
632
- | "N" <ns > <path> <identifier> // ...::ident (nested path)
633
- | "I" <path> {<generic-arg>} "E" // ...<T, U> (generic args)
628
+ <path> = "C" <identifier> // crate root
629
+ | "M" <impl-path> <type> // <T> (inherent impl)
630
+ | "X" <impl-path> <type> <path> // <T as Trait> (trait impl)
631
+ | "Y" <type> <path> // <T as Trait> (trait definition)
632
+ | "N" <namespace > <path> <identifier> // ...::ident (nested path)
633
+ | "I" <path> {<generic-arg>} "E" // ...<T, U> (generic args)
634
634
| <backref>
635
635
636
636
// Path to an impl (without the Self type or the trait).
@@ -655,10 +655,10 @@ Mangled names conform to the following grammar:
655
655
// A-Z are used for special namespaces (e.g. closures), which the demangler
656
656
// can show in a special way (e.g. `NC...` as `...::{closure}`), or just
657
657
// default to showing the uppercase character.
658
- <ns > = "C" // closure
659
- | "S" // shim
660
- | <A-Z> // other special namespaces
661
- | <a-z> // internal namespaces
658
+ <namespace > = "C" // closure
659
+ | "S" // shim
660
+ | <A-Z> // other special namespaces
661
+ | <a-z> // internal namespaces
662
662
663
663
<generic-arg> = <lifetime>
664
664
| <type>
@@ -675,6 +675,7 @@ Mangled names conform to the following grammar:
675
675
// innermost lifetimes, e.g. in `for<'a, 'b> fn(for<'c> fn(...))`,
676
676
// any <lifetime>s in ... (but not inside more binders) will observe
677
677
// the indices 1, 2, and 3 refer to 'c, 'b, and 'a, respectively.
678
+ // The number of bound lifetimes is value of <base-62-number> + 1.
678
679
<binder> = "G" <base-62-number>
679
680
680
681
<type> = <basic-type>
@@ -715,22 +716,24 @@ Mangled names conform to the following grammar:
715
716
// If the "U" is present then the function is `unsafe`.
716
717
// The return type is always present, but demanglers can
717
718
// choose to omit the ` -> ()` by special-casing "u".
718
- <fn-sig> := <binder> ["U"] ["K" <abi>] {<type>} "E" <type>
719
+ <fn-sig> = [ <binder>] ["U"] ["K" <abi>] {<type>} "E" <type>
719
720
720
721
<abi> = "C"
721
722
| <undisambiguated-identifier>
722
723
723
- <dyn-bounds> = <binder> {<dyn-trait>} "E"
724
+ <dyn-bounds> = [ <binder>] {<dyn-trait>} "E"
724
725
<dyn-trait> = <path> {<dyn-trait-assoc-binding>}
725
726
<dyn-trait-assoc-binding> = "p" <undisambiguated-identifier> <type>
726
727
<const> = <type> <const-data>
727
- | <type> "p" // placeholder (e.g. for polymorphic constants) , shown as _: T
728
+ | "p" // placeholder, shown as _
728
729
| <backref>
729
730
730
- // The encoding of a constant depends on its type, currently only
731
- // unsigned integers (mainly usize, for arrays) are supported, and they
732
- // use their value, in base 16 (0-9a-f), not their memory representation.
733
- <const-data> = {<hex-digit>} "_"
731
+ // The encoding of a constant depends on its type. Integers use their value,
732
+ // in base 16 (0-9a-f), not their memory representation. Negative integer
733
+ // values are preceded with "n". The bool value false is encoded as `0_`, true
734
+ // value as `1_`. The char constants are encoded using their Unicode scalar
735
+ // value.
736
+ <const-data> = ["n"] {<hex-digit>} "_"
734
737
735
738
// <base-62-number> uses 0-9-a-z-A-Z as digits, i.e. 'a' is decimal 10 and
736
739
// 'Z' is decimal 61.
@@ -748,7 +751,7 @@ Mangled names conform to the following grammar:
748
751
### Namespace Tags
749
752
750
753
Namespaces are identified by an implementation defined single character tag
751
- (the ` <ns > ` production). Only closures (` C ` ) and shims (` S ` ) have a
754
+ (the ` <namespace > ` production). Only closures (` C ` ) and shims (` S ` ) have a
752
755
specific character assigned to them so that demanglers can reliable
753
756
adjust their output accordingly. Other namespace tags have to be omitted
754
757
or shown verbatim during demangling.
@@ -1150,3 +1153,6 @@ pub static QUUX: u32 = {
1150
1153
- Add a recommended resolution for open question around Punycode identifiers.
1151
1154
- Add a recommended resolution for open question around encoding function parameter types.
1152
1155
- Allow identifiers to start with a digit.
1156
+ - Make ` <binder> ` optional in ` <fn-sig> ` and ` <dyn-bounds> ` productions.
1157
+ - Extend ` <const-data> ` to include ` bool ` values, ` char ` values, and negative integer values.
1158
+ - Remove type from constant placeholders.
0 commit comments