@@ -727,16 +727,7 @@ Mangled names conform to the following grammar:
727
727
728
728
// The encoding of a constant depends on its type, currently only
729
729
// unsigned integers (mainly usize, for arrays) are supported, and they
730
- // use their value, in base 16 (0-9a-f), not their memory representation..
731
- //
732
- // Note that while exposing target-specific data layout information, such
733
- // as pointer size, endianness, etc. should be avoided as much as possible,
734
- // it might become necessary to include raw bytes, even whole allocation
735
- // subgraphs (that miri created), for const generics with non-trivial types.
736
- //
737
- // However, demanglers could just show the raw encoding without trying to
738
- // turn it into expressions, unless they're part of e.g. a debugger, with
739
- // more information about the target data layout and/or from debuginfo.
730
+ // use their value, in base 16 (0-9a-f), not their memory representation.
740
731
<const-data> = {<hex-digit>} "_"
741
732
742
733
// <base-62-number> uses 0-9-a-z-A-Z as digits, i.e. 'a' is decimal 10 and
@@ -768,6 +759,18 @@ order not to force the compiler to waste processing time on re-constructing
768
759
different disambiguation indices, the internal unspecified "namespaces" are
769
760
used. This may change in the future.
770
761
762
+ ### Type-Level Constants
763
+
764
+ As described above, the grammar encodes constant values via the
765
+ ` <const-data> = {<hex-digit>} "_" ` production, where ` {<hex-digit>} ` is
766
+ the numeric value of the constant, not its representation as bytes. Using
767
+ the numeric value is platform independent but does not easily scale to
768
+ non-integer data types.
769
+
770
+ In the future it is likely that Rust will support complex type-level
771
+ constants (i.e. not just integers). This RFC suggests to develop a
772
+ proper mangling for these as part of the future const-generics work,
773
+ and, for now, only define a mangling for integer values.
771
774
772
775
### Punycode Identifiers
773
776
@@ -976,17 +979,6 @@ is taken from the [Swift][swift-gh] programming language's
976
979
# Unresolved questions
977
980
[ unresolved-questions ] : #unresolved-questions
978
981
979
- ### Complex Constant Data
980
-
981
- The RFC encodes constant values via the ` <const-data> = {<hex-digit>} "_" `
982
- production, where ` {<hex-digit>} ` is the numeric value of the constant, not
983
- its representation as bytes. Using the numeric value is platform independent
984
- but does not easily scale to non-integer data types.
985
-
986
- It is unclear if this is something that needs to be resolved now or can
987
- be left for a future version of the mangling scheme.
988
-
989
-
990
982
### Punycode vs UTF-8
991
983
During the pre-RFC phase, it has been suggested that Unicode identifiers
992
984
should be encoded as UTF-8 instead of Punycode on platforms that allow it.
@@ -1148,3 +1140,4 @@ pub static QUUX: u32 = {
1148
1140
- Removed unresolved question "Re-use ` <disambiguator> ` for crate disambiguator".
1149
1141
- Added note about default generic arguments to reference-level-explanation.
1150
1142
- Added note about Punycode making decoding more complicated.
1143
+ - Resolve question of complex constant data.
0 commit comments