Skip to content

Commit c0b491e

Browse files
JohnTitorjyn514
authored andcommitted
Fix the link to Lazy<T>
Signed-off-by: Yuki Okushi <[email protected]>
1 parent 30a4d2b commit c0b491e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/serialization.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,22 @@ is in the cache, then instead of serializing the type as usual, the byte offset
123123
within the file being written is encoded instead. A similar scheme is used for
124124
`ty::Predicate`.
125125

126-
## `Lazy<T>`
126+
## `LazyValue<T>`
127127

128128
Crate metadata is initially loaded before the `TyCtxt<'tcx>` is created, so
129129
some deserialization needs to be deferred from the initial loading of metadata.
130-
The [`Lazy<T>`] type wraps the (relative) offset in the crate metadata where a
131-
`T` has been serialized.
130+
The [`LazyValue<T>`] type wraps the (relative) offset in the crate metadata where a
131+
`T` has been serialized. There are also some variants, [`LazyArray<T>`] and [`LazyTable<I, T>`].
132132

133-
The `Lazy<[T]>` and `Lazy<Table<I, T>>` type provide some functionality over
133+
The `Lazy<[T]>` and `LazyTable<I, T>` type provide some functionality over
134134
`Lazy<Vec<T>>` and `Lazy<HashMap<I, T>>`:
135135

136-
- It's possible to encode a `Lazy<[T]>` directly from an iterator, without
136+
- It's possible to encode a `LazyArray<T>` directly from an iterator, without
137137
first collecting into a `Vec<T>`.
138-
- Indexing into a `Lazy<Table<I, T>>` does not require decoding entries other
138+
- Indexing into a `LazyTable<I, T>` does not require decoding entries other
139139
than the one being read.
140140

141-
**note**: `Lazy<T>` does not cache its value after being deserialized the first
141+
**note**: `LazyValue<T>` does not cache its value after being deserialized the first
142142
time. Instead the query system is the main way of caching these results.
143143

144144
## Specialization
@@ -155,7 +155,9 @@ for `Encodable<CacheEncoder>`.
155155
[serialize]: https://en.wikipedia.org/wiki/Serialization
156156

157157
[`CrateInfo`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/struct.CrateInfo.html
158-
[`Lazy<T>`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/struct.Lazy.html
158+
[`LazyArray<T>`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/struct.LazyValue.html
159+
[`LazyTable<I, T>`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/struct.LazyValue.html
160+
[`LazyValue<T>`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/struct.LazyValue.html
159161
[`RefDecodable`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/codec/trait.RefDecodable.html
160162
[`rustc_metadata::rmeta::decoder::DecodeContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/struct.DecodeContext.html
161163
[`rustc_metadata::rmeta::encoder::EncodeContext`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/encoder/struct.EncodeContext.html

0 commit comments

Comments
 (0)