about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-05-30 21:02:22 +0200
committerJoshua Nelson <github@jyn.dev>2021-07-13 12:45:58 -0400
commitf4e53bb520ee47e496e3f75b184feca735c96164 (patch)
tree495ea8395167e85bcd64a99e9f12ddc884f4d5b4 /src/doc/rustc-dev-guide
parentbec4406ccf24dc786c12fb2682cb772c171505ee (diff)
downloadrust-f4e53bb520ee47e496e3f75b184feca735c96164.tar.gz
rust-f4e53bb520ee47e496e3f75b184feca735c96164.zip
Update for merge of CrateDisambiguator into StableCrateId
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md b/src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md
index 91d8cb3aab2..d2cf8b6929c 100644
--- a/src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md
+++ b/src/doc/rustc-dev-guide/src/backend/libs-and-metadata.md
@@ -72,8 +72,8 @@ Here are a few highlights of things it contains:
   from any other version.
 * The [Strict Version Hash](#strict-version-hash) (SVH). This helps ensure the
   correct dependency is loaded.
-* The [Crate Disambiguator](#crate-disambiguator). This is a hash used
-  to disambiguate between different crates of the same name.
+* The [Stable Crate Id](#stable-crate-id). This is a hash used
+  to identify crates.
 * Information about all the source files in the library. This can be used for
   a variety of things, such as diagnostics pointing to sources in a
   dependency.
@@ -114,21 +114,22 @@ computed.
 [incremental compilation]: ../queries/incremental-compilation.md
 [`finalize_and_compute_crate_hash`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/collector/struct.NodeCollector.html#method.finalize_and_compute_crate_hash
 
-### Crate Disambiguator
+### Stable Crate Id
 
-The [`CrateDisambiguator`] is a 128-bit hash used to distinguish between
-different crates of the same name. It is a hash of all the [`-C metadata`] CLI
-options computed in [`compute_crate_disambiguator`]. It is used in a variety
-of places, such as symbol name mangling, crate loading, and much more.
+The [`StableCrateId`] is a 64-bit hash used to identify different crates with
+potentially the same name. It is a hash of the crate name and all the
+[`-C metadata`] CLI options computed in [`StableCrateId::new`]. It is
+used in a variety of places, such as symbol name mangling, crate loading, and
+much more.
 
-By default, all Rust symbols are mangled and incorporate the disambiguator
-hash. This allows multiple versions of the same crate to be included together.
-Cargo automatically generates `-C metadata` hashes based on a variety of
-factors, like the package version, source, and the target kind (a lib and bin
-can have the same crate name, so they need to be disambiguated).
+By default, all Rust symbols are mangled and incorporate the stable crate id.
+This allows multiple versions of the same crate to be included together. Cargo
+automatically generates `-C metadata` hashes based on a variety of factors,
+like the package version, source, and the target kind (a lib and test can have
+the same crate name, so they need to be disambiguated).
 
-[`CrateDisambiguator`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/crate_disambiguator/struct.CrateDisambiguator.html
-[`compute_crate_disambiguator`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/util/fn.compute_crate_disambiguator.html
+[`StableCrateId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/def_id/struct.StableCrateId.html
+[`StableCrateId::new`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/def_id/struct.StableCrateId.html#method.new
 [`-C metadata`]: https://doc.rust-lang.org/rustc/codegen-options/index.html#metadata
 
 ## Crate loading