|
1 | 1 | //! This module defines the `DepNode` type which the compiler uses to represent
|
2 |
| -//! nodes in the dependency graph. A `DepNode` consists of a `DepKind` (which |
| 2 | +//! nodes in the dependency graph. |
| 3 | +//! |
| 4 | +//! A `DepNode` consists of a `DepKind` (which |
3 | 5 | //! specifies the kind of thing it represents, like a piece of HIR, MIR, etc)
|
4 |
| -//! and a `Fingerprint`, a 128 bit hash value the exact meaning of which |
| 6 | +//! and a `Fingerprint`, a 128-bit hash value the exact meaning of which |
5 | 7 | //! depends on the node's `DepKind`. Together, the kind and the fingerprint
|
6 | 8 | //! fully identify a dependency node, even across multiple compilation sessions.
|
7 | 9 | //! In other words, the value of the fingerprint does not depend on anything
|
|
11 | 13 | //! uniquely identify a given commit and has a few advantages:
|
12 | 14 | //!
|
13 | 15 | //! * A `DepNode` can simply be serialized to disk and loaded in another session
|
14 |
| -//! without the need to do any "rebasing (like we have to do for Spans and |
15 |
| -//! NodeIds) or "retracing" like we had to do for `DefId` in earlier |
16 |
| -//! implementations of the dependency graph. |
| 16 | +//! without the need to do any "rebasing" (like we have to do for Spans and |
| 17 | +//! NodeIds) or "retracing" (like we had to do for `DefId` in earlier |
| 18 | +//! implementations of the dependency graph). |
17 | 19 | //! * A `Fingerprint` is just a bunch of bits, which allows `DepNode` to
|
18 | 20 | //! implement `Copy`, `Sync`, `Send`, `Freeze`, etc.
|
19 | 21 | //! * Since we just have a bit pattern, `DepNode` can be mapped from disk into
|
|
42 | 44 | //! `DefId` it was computed from. In other cases, too much information gets
|
43 | 45 | //! lost during fingerprint computation.
|
44 | 46 | //!
|
45 |
| -//! The `DepConstructor` enum, together with `DepNode::new()` ensures that only |
| 47 | +//! The `DepConstructor` enum, together with `DepNode::new()`, ensures that only |
46 | 48 | //! valid `DepNode` instances can be constructed. For example, the API does not
|
47 | 49 | //! allow for constructing parameterless `DepNode`s with anything other
|
48 | 50 | //! than a zeroed out fingerprint. More generally speaking, it relieves the
|
|
0 commit comments