about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2022-06-09 19:09:47 -0700
committerEric Huss <eric@huss.org>2023-06-05 11:51:37 -0700
commitd782e8748b441335c4bed80ae791a60b770658f2 (patch)
tree72be2d28f7eb3ff764f217bbe2e9eedcc5ba4099
parentddd26b46cdd7d37e88b7908d956a85bd97f1a744 (diff)
downloadrust-d782e8748b441335c4bed80ae791a60b770658f2.tar.gz
rust-d782e8748b441335c4bed80ae791a60b770658f2.zip
Update from review from michaelwoerister.
-rw-r--r--src/doc/rustc/src/symbol-mangling/v0.md21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/doc/rustc/src/symbol-mangling/v0.md b/src/doc/rustc/src/symbol-mangling/v0.md
index 1d7992e077d..797491a4ab3 100644
--- a/src/doc/rustc/src/symbol-mangling/v0.md
+++ b/src/doc/rustc/src/symbol-mangling/v0.md
@@ -149,7 +149,8 @@ the *[disambiguator]* is used to make the name unique across the crate graph.
 > inherent-impl → `M` *[impl-path]* *[type]*
 
 An *inherent-impl* indicates a path to an [inherent implementation][reference-inherent-impl].
-It consists of the character `M` followed by an *[impl-path]* to the impl's parent followed by the *[type]* representing the `Self` type of the impl.
+It consists of the character `M` followed by an *[impl-path]*, which uniquely identifies the impl block the item is defined in.
+Following that is a *[type]* representing the `Self` type of the impl.
 
 > **Recommended Demangling**
 >
@@ -167,12 +168,13 @@ It consists of the character `M` followed by an *[impl-path]* to the impl's pare
 > The symbol for `foo` in the impl for `Example` is:
 >
 > ```text
-> _RNvMCs15kBYyAo9fc_7mycrateNtB2_7Example3foo
->     │└─────────┬──────────┘└────┬──────┘
->     │          │                │
->     │          │                └── Self type "Example"
->     │          └─────────────────── path to the impl's parent "mycrate"
->     └────────────────────────────── inherent-impl
+> _RNvMs_Cs4Cv8Wi1oAIB_7mycrateNtB4_7Example3foo
+>     │├┘└─────────┬──────────┘└────┬──────┘
+>     ││           │                │
+>     ││           │                └── Self type "Example"
+>     ││           └─────────────────── path to the impl's parent "mycrate"
+>     │└─────────────────────────────── disambiguator 1
+>     └──────────────────────────────── inherent-impl
 > ```
 >
 > Recommended demangling: `<mycrate::Example>::foo`
@@ -307,8 +309,9 @@ It consists of the character `N` followed by a *[namespace]* indicating the name
 followed by a *[path]* which is a path representing the parent of the entity,
 followed by an *[identifier]* of the entity.
 
-The identifier of the entity may be empty when the entity is not named.
+The identifier of the entity may have a length of 0 when the entity is not named.
 For example, entities like closures, tuple-like struct constructors, and anonymous constants may not have a name.
+The identifier may still have a disambiguator unless the disambiguator is 0.
 
 > **Recommended Demangling**
 >
@@ -912,7 +915,7 @@ It consists of a single *[path]*.
 This helps differentiate symbols that would otherwise be identical,
 for example the monomorphization of a function from an external crate may result in a duplicate if another crate is also instantiating the same generic function with the same types.
 
-In practice, the instantiating crate is also the crate where the symbol is defined,
+In practice, the instantiating crate is also often the crate where the symbol is defined,
 so it is usually encoded as a *[backref]* to the *[crate-root]* encoded elsewhere in the symbol.
 
 > **Recommended Demangling**