Skip to content

Commit fa362ad

Browse files
committed
List several TEST rustc_* attrs
1 parent 6cc6ef0 commit fa362ad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/compiler-debugging.md

+24
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,34 @@ for debugging by dumping extra compiler-internal information. These are prefixed
267267
are gated behind the internal feature `rustc_attrs` (enabled via e.g. `#![feature(rustc_attrs)]`).
268268

269269
For a complete and up to date list, see [`builtin_attrs`]. More specifically, the ones marked `TEST`.
270+
Here are some notable ones:
271+
272+
| Attribute | Description |
273+
|----------------|-------------|
274+
| `rustc_def_path` | Dumps the [`def_path_str`] of an item. |
275+
| `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. |
276+
| `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. |
277+
| `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. |
278+
| `rustc_dump_vtable` | |
279+
| `rustc_hidden_type_of_opaques` | Dumps the [hidden type of all opaque types][opaq] in the crate. |
280+
| `rustc_layout` | [See this section](#debugging-type-layouts). |
281+
| `rustc_object_lifetime_default` | Dumps the [object lifetime defaults] of an item. |
282+
| `rustc_outlives` | Dumps implied bounds of an item. More precisely, the [`inferred_outlives_of`] an item. |
283+
| `rustc_regions` | Dumps NLL closure region requirements. |
284+
| `rustc_symbol_name` | Dumps the mangled & demangled [`symbol_name`] of an item. |
285+
| `rustc_variances` | Dumps the [variances] of an item. |
270286

271287
Right below you can find elaborate explainers on a selected few.
272288

273289
[`builtin_attrs`]: https://github.com/rust-lang/rust/blob/master/compiler/rustc_feature/src/builtin_attrs.rs
290+
[`def_path_str`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.def_path_str
291+
[`inferred_outlives_of`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.inferred_outlives_of
292+
[`item_bounds`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.item_bounds
293+
[`predicates_of`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.predicates_of
294+
[`symbol_name`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.symbol_name
295+
[object lifetime defaults]: https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes
296+
[opaq]: ./opaque-types-impl-trait-inference.md
297+
[variances]: ./variance.md
274298

275299
### Formatting Graphviz output (.dot files)
276300
[formatting-graphviz-output]: #formatting-graphviz-output

0 commit comments

Comments
 (0)