Skip to content

Commit 63b45c3

Browse files
Noratriebjyn514
authored andcommitted
Remove implementation details
1 parent 090bd54 commit 63b45c3

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

src/query.md

+2-31
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ Defining a query takes place in two steps:
175175
To declare the query name and arguments, you simply add an entry to
176176
the big macro invocation in [`compiler/rustc_middle/src/query/mod.rs`][query-mod].
177177
Then you need to add a documentation comment to it with some _internal_ description.
178-
Then, provide the `desc` attribute which contains a short description of the query.
179-
This description is shown to the user in query cycles.
178+
Then, provide the `desc` attribute which contains a _user-facing_ description of the query.
179+
The `desc` attribute is shown to the user in query cycles.
180180

181181
This looks something like:
182182

@@ -237,35 +237,6 @@ which is used to cheaply modify MIR in place. See the definition
237237
of `Steal` for more details. New uses of `Steal` should **not** be
238238
added without alerting `@rust-lang/compiler`.
239239

240-
### Query structs and descriptions
241-
242-
For each query, the `rustc_queries` macro will generate a "query struct"
243-
named after the query. This struct is a kind of placeholder
244-
describing the query. Each query struct implements the
245-
[`self::config::QueryConfig`][QueryConfig] trait, which has associated types for the
246-
key/value of that particular query. Basically the code generated looks something
247-
like this:
248-
249-
```rust,ignore
250-
// Dummy struct representing a particular kind of query:
251-
pub struct type_of<'tcx> { data: PhantomData<&'tcx ()> }
252-
253-
impl<'tcx> QueryConfig for type_of<'tcx> {
254-
type Key = DefId;
255-
type Value = Ty<'tcx>;
256-
257-
const NAME: QueryName = QueryName::type_of;
258-
const CATEGORY: ProfileCategory = ProfileCategory::Other;
259-
}
260-
```
261-
262-
There is an additional trait with more methods called
263-
[`self::config::QueryDescription`][QueryDescription]. This trait contains a few
264-
extra methods which are used by the query system.
265-
266-
[QueryConfig]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_query_system/query/config/trait.QueryConfig.html
267-
[QueryDescription]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_query_system/query/config/trait.QueryDescription.html
268-
269240
## External links
270241

271242
Related design ideas, and tracking issues:

0 commit comments

Comments
 (0)