Skip to content

Commit 8d76731

Browse files
Update some wording as suggested by eddyb.
1 parent 29d5c93 commit 8d76731

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

text/0000-symbol-name-mangling-v2.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ the `impl` to the symbol name.
447447

448448
```
449449
<path> = C <identifier> // crate-id root
450-
| M <impl-path> <type> // inherent impl root
451-
| X <impl-path> <type> <path> // trait impl root
450+
| M <impl-path> <type> // inherent impl root
451+
| X <impl-path> <type> <path> // trait impl root
452452
| N <namespace> <path> <identifier> // nested path
453453
| I <path> {<generic-arg>} E // generic arguments
454454
@@ -560,7 +560,8 @@ occurrence of which could be replaced by a back reference.
560560

561561
The things that are eligible for substitution are (1) all prefixes of
562562
paths (including the entire path itself), (2) all types except for
563-
basic types, and (3) instances of const data.
563+
basic types, and (3) type-level constants (array lengths and values
564+
passed to const generic params).
564565

565566
Here's an example in order to illustrate the concept. The name
566567

@@ -574,20 +575,20 @@ by a back reference. The number of at the beginning of each span given
574575
the 0-based byte position of where it occurred the first time.
575576

576577
```
577-
0 10 20 30 40 50 60 70 80 90
578+
0 10 20 30 40 50 60 70 80 90
578579
_RINtNtC3std4iter5ChainINtNtC3std4iter3ZipINtNtC3std3vec8IntoItermEINtNtC3std3vec8IntoItermEEE
579-
7---- 7---- 7----
580-
5----------- 45---------
581-
43--------------------
582-
42-----------------------
580+
5---- 5---- 5----
581+
3----------- 43---------
582+
41--------------------
583+
40-----------------------
583584
```
584585

585586
The compiler is always supposed to use the longest replacement possible
586587
in order to achieve the best compression. The compressed symbol looks
587588
as follows:
588589

589590
```
590-
_RINtNtC3std4iter5ChainINtB4_3ZipINtNtB6_3vec8IntoItermEBv_EE
591+
_RINtNtC3std4iter5ChainINtB2_3ZipINtNtB4_3vec8IntoItermEBt_EE
591592
^^^ ^^^ ^^^ back references
592593
```
593594

0 commit comments

Comments
 (0)