Skip to content

Commit a56b883

Browse files
authored
Fix heading levels in the query chapter (rust-lang#1305)
This should fix the incorrect TOC rendering in rust-lang#1303.
1 parent e9c2e69 commit a56b883

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/doc/rustc-dev-guide/src/query.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ compiler (for example, generating [MIR](./mir/)) currently work exactly like thi
4343
in-depth description of what queries are and how they work.
4444
If you intend to write a query of your own, this is a good read.
4545

46-
### Invoking queries
46+
## Invoking queries
4747

4848
Invoking a query is simple. The [`TyCtxt`] ("type context") struct offers a method
4949
for each defined query. For example, to invoke the `type_of`
@@ -55,7 +55,7 @@ let ty = tcx.type_of(some_def_id);
5555

5656
[`TyCtxt`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html
5757

58-
### How the compiler executes a query
58+
## How the compiler executes a query
5959

6060
So you may be wondering what happens when you invoke a query
6161
method. The answer is that, for each query, the compiler maintains a
@@ -64,7 +64,7 @@ simple: we clone the return value out of the cache and return it
6464
(therefore, you should try to ensure that the return types of queries
6565
are cheaply cloneable; insert an `Rc` if necessary).
6666

67-
#### Providers
67+
### Providers
6868

6969
If, however, the query is *not* in the cache, then the compiler will
7070
try to find a suitable **provider**. A provider is a function that has
@@ -97,7 +97,7 @@ fn provider<'tcx>(
9797
Providers take two arguments: the `tcx` and the query key.
9898
They return the result of the query.
9999

100-
#### How providers are setup
100+
### How providers are setup
101101

102102
When the tcx is created, it is given the providers by its creator using
103103
the [`Providers`][providers_struct] struct. This struct is generated by
@@ -164,7 +164,7 @@ they define both a `provide` and a `provide_extern` function, through
164164
[rustc_metadata]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/index.html
165165
[wasm_import_module_map]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/back/symbol_export/fn.wasm_import_module_map.html
166166

167-
### Adding a new query
167+
## Adding a new query
168168

169169
How do you add a new query?
170170
Defining a query takes place in two steps:
@@ -238,7 +238,7 @@ which is used to cheaply modify MIR in place. See the definition
238238
of `Steal` for more details. New uses of `Steal` should **not** be
239239
added without alerting `@rust-lang/compiler`.
240240

241-
#### Query structs and descriptions
241+
### Query structs and descriptions
242242

243243
For each query, the `rustc_queries` macro will generate a "query struct"
244244
named after the query. This struct is a kind of placeholder
@@ -294,7 +294,7 @@ rustc_queries! {
294294

295295
`rustc_queries` macro will generate an appropriate `impl` automatically.
296296

297-
## External Links
297+
## External links
298298

299299
Related design ideas, and tracking issues:
300300

0 commit comments

Comments
 (0)