Skip to content

Commit 85d3036

Browse files
eddybmark-i-m
authored andcommitted
rustc: rename ty::maps to ty::query.
1 parent addc949 commit 85d3036

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/high-level-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ input, running the type-checker, and so forth. This on-demand model
8585
permits us to do exciting things like only do the minimal amount of
8686
work needed to type-check a single function. It also helps with
8787
incremental compilation. (For details on defining queries, check out
88-
`src/librustc/ty/maps/README.md`.)
88+
`src/librustc/ty/query/README.md`.)
8989

9090
Regardless of the general setup, the basic operations that the
9191
compiler must perform are the same. The only thing that changes is

src/query.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ get to use the nice method-call-style syntax. Instead, you invoke
6363
using the `try_get` method, which looks roughly like this:
6464

6565
```rust,ignore
66-
use ty::maps::queries;
66+
use ty::queries;
6767
...
6868
match queries::type_of::try_get(tcx, DUMMY_SP, self.did) {
6969
Ok(result) => {
@@ -215,14 +215,14 @@ Well, defining a query takes place in two steps:
215215

216216
To specify the query name and arguments, you simply add an entry to
217217
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
219219
changed by the time you read this README, but at present it looks
220220
something like:
221221

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
223223

224224
```rust,ignore
225-
define_maps! { <'tcx>
225+
define_queries! { <'tcx>
226226
/// Records the type of every item.
227227
[] fn type_of: TypeOfItem(DefId) -> Ty<'tcx>,
228228
@@ -250,7 +250,7 @@ Let's go over them one by one:
250250
processed.
251251
- **Name of query:** the name of the query method
252252
(`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
254254
this query.
255255
- **Dep-node constructor:** indicates the constructor function that
256256
connects this query to incremental compilation. Typically, this is a
@@ -262,7 +262,7 @@ Let's go over them one by one:
262262
bottom of the file. This is typically used when the query key is
263263
not a def-id, or just not the type that the dep-node expects.
264264
- **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
266266
defines (for example) how to map it to a crate, and so forth.
267267
- **Result type of query:** the type produced by this query. This type
268268
should (a) not use `RefCell` or other interior mutability and (b) be
@@ -277,14 +277,14 @@ Let's go over them one by one:
277277

278278
So, to add a query:
279279

280-
- Add an entry to `define_maps!` using the format above.
280+
- Add an entry to `define_queries!` using the format above.
281281
- Possibly add a corresponding entry to the dep-node macro.
282282
- Link the provider by modifying the appropriate `provide` method;
283283
or add a new one if needed and ensure that `rustc_driver` is invoking it.
284284

285285
#### Query structs and descriptions
286286

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"
288288
named after the query. This struct is a kind of a place-holder
289289
describing the query. Each such struct implements the
290290
`self::config::QueryConfig` trait, which has associated types for the

0 commit comments

Comments
 (0)