@@ -175,8 +175,8 @@ Defining a query takes place in two steps:
175175To declare the query name and arguments, you simply add an entry to
176176the big macro invocation in [ ` compiler/rustc_middle/src/query/mod.rs ` ] [ query-mod ] .
177177Then 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
181181This looks something like:
182182
@@ -237,35 +237,6 @@ which is used to cheaply modify MIR in place. See the definition
237237of ` Steal ` for more details. New uses of ` Steal ` should ** not** be
238238added 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
271242Related design ideas, and tracking issues:
0 commit comments