@@ -63,7 +63,7 @@ get to use the nice method-call-style syntax. Instead, you invoke
63
63
using the ` try_get ` method, which looks roughly like this:
64
64
65
65
``` rust,ignore
66
- use ty::maps:: queries;
66
+ use ty::queries;
67
67
...
68
68
match queries::type_of::try_get(tcx, DUMMY_SP, self.did) {
69
69
Ok(result) => {
@@ -215,14 +215,14 @@ Well, defining a query takes place in two steps:
215
215
216
216
To specify the query name and arguments, you simply add an entry to
217
217
the big macro invocation in
218
- [ ` src/librustc/ty/maps /mod.rs ` ] [ maps -mod] . This will probably have
218
+ [ ` src/librustc/ty/query /mod.rs ` ] [ query -mod] . This will probably have
219
219
changed by the time you read this README, but at present it looks
220
220
something like:
221
221
222
- [ maps -mod] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/maps /index.html
222
+ [ query -mod] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/query /index.html
223
223
224
224
``` rust,ignore
225
- define_maps ! { <'tcx>
225
+ define_queries ! { <'tcx>
226
226
/// Records the type of every item.
227
227
[] fn type_of: TypeOfItem(DefId) -> Ty<'tcx>,
228
228
@@ -250,7 +250,7 @@ Let's go over them one by one:
250
250
processed.
251
251
- ** Name of query:** the name of the query method
252
252
(` tcx.type_of(..) ` ). Also used as the name of a struct
253
- (` ty::maps:: queries::type_of ` ) that will be generated to represent
253
+ (` ty::queries::type_of ` ) that will be generated to represent
254
254
this query.
255
255
- ** Dep-node constructor:** indicates the constructor function that
256
256
connects this query to incremental compilation. Typically, this is a
@@ -262,7 +262,7 @@ Let's go over them one by one:
262
262
bottom of the file. This is typically used when the query key is
263
263
not a def-id, or just not the type that the dep-node expects.
264
264
- ** Query key type:** the type of the argument to this query.
265
- This type must implement the ` ty::maps ::keys::Key ` trait, which
265
+ This type must implement the ` ty::query ::keys::Key ` trait, which
266
266
defines (for example) how to map it to a crate, and so forth.
267
267
- ** Result type of query:** the type produced by this query. This type
268
268
should (a) not use ` RefCell ` or other interior mutability and (b) be
@@ -277,14 +277,14 @@ Let's go over them one by one:
277
277
278
278
So, to add a query:
279
279
280
- - Add an entry to ` define_maps !` using the format above.
280
+ - Add an entry to ` define_queries !` using the format above.
281
281
- Possibly add a corresponding entry to the dep-node macro.
282
282
- Link the provider by modifying the appropriate ` provide ` method;
283
283
or add a new one if needed and ensure that ` rustc_driver ` is invoking it.
284
284
285
285
#### Query structs and descriptions
286
286
287
- For each kind, the ` define_maps ` macro will generate a "query struct"
287
+ For each kind, the ` define_queries ` macro will generate a "query struct"
288
288
named after the query. This struct is a kind of a place-holder
289
289
describing the query. Each such struct implements the
290
290
` self::config::QueryConfig ` trait, which has associated types for the
0 commit comments