@@ -273,18 +273,18 @@ Here are some notable ones:
273273
274274| Attribute | Description |
275275| ----------------| -------------|
276- | ` rustc_def_path ` | Dumps the [ ` def_path_str ` ] of an item. |
277276| ` rustc_dump_def_parents ` | Dumps the chain of ` DefId ` parents of certain definitions. |
277+ | ` rustc_dump_def_path ` | Dumps the [ ` def_path_str ` ] of an item. |
278+ | ` rustc_dump_hidden_type_of_opaques ` | Dumps the [ hidden type of each opaque types] [ opaq ] in the crate. |
278279| ` rustc_dump_inferred_outlives ` | Dumps implied bounds of an item. More precisely, the [ ` inferred_outlives_of ` ] an item. |
279280| ` rustc_dump_item_bounds ` | Dumps the [ ` item_bounds ` ] of an item. |
281+ | ` rustc_dump_layout ` | [ See this section] ( #debugging-type-layouts ) . |
280282| ` rustc_dump_object_lifetime_defaults ` | Dumps the [ object lifetime defaults] of an item. |
281283| ` rustc_dump_predicates ` | Dumps the [ ` predicates_of ` ] an item. |
284+ | ` rustc_dump_symbol_name ` | Dumps the mangled & demangled [ ` symbol_name ` ] of an item. |
282285| ` rustc_dump_variances ` | Dumps the [ variances] of an item. |
283286| ` rustc_dump_vtable ` | Dumps the vtable layout of an impl, or a type alias of a dyn type. |
284- | ` rustc_hidden_type_of_opaques ` | Dumps the [ hidden type of each opaque types] [ opaq ] in the crate. |
285- | ` rustc_layout ` | [ See this section] ( #debugging-type-layouts ) . |
286287| ` rustc_regions ` | Dumps NLL closure region requirements. |
287- | ` rustc_symbol_name ` | Dumps the mangled & demangled [ ` symbol_name ` ] of an item. |
288288
289289Right below you can find elaborate explainers on a selected few.
290290
@@ -316,54 +316,55 @@ $ firefox maybe_init_suffix.pdf # Or your favorite pdf viewer
316316
317317### Debugging type layouts
318318
319- The internal attribute ` #[rustc_layout ] ` can be used to dump the [ ` Layout ` ] of
320- the type it is attached to.
319+ The internal attribute ` #[rustc_dump_layout(...) ] ` can be used to dump the
320+ [ ` Layout ` ] of the type it is attached to.
321321For example:
322322
323323``` rust
324324#![feature(rustc_attrs)]
325325
326- #[rustc_layout (debug)]
326+ #[rustc_dump_layout (debug)]
327327type T <'a > = & 'a u32 ;
328328```
329329
330330Will emit the following:
331331
332332``` text
333- error: layout_of(&'a u32) = Layout {
334- fields: Primitive,
335- variants: Single {
336- index: 0,
337- },
338- abi: Scalar(
339- Scalar {
340- value: Pointer,
341- valid_range: 1..=18446744073709551615,
342- },
343- ),
344- largest_niche: Some(
345- Niche {
346- offset: Size {
347- raw: 0,
348- },
349- scalar: Scalar {
350- value: Pointer,
351- valid_range: 1..=18446744073709551615,
352- },
353- },
354- ),
355- align: AbiAndPrefAlign {
356- abi: Align {
357- pow2: 3,
358- },
359- pref: Align {
360- pow2: 3,
361- },
362- },
363- size: Size {
364- raw: 8,
365- },
366- }
333+ error: layout_of(&u32) = Layout {
334+ size: Size(8 bytes),
335+ align: AbiAlign {
336+ abi: Align(8 bytes),
337+ },
338+ backend_repr: Scalar(
339+ Initialized {
340+ value: Pointer(
341+ AddressSpace(
342+ 0,
343+ ),
344+ ),
345+ valid_range: 1..=18446744073709551615,
346+ },
347+ ),
348+ fields: Primitive,
349+ largest_niche: Some(
350+ Niche {
351+ offset: Size(0 bytes),
352+ value: Pointer(
353+ AddressSpace(
354+ 0,
355+ ),
356+ ),
357+ valid_range: 1..=18446744073709551615,
358+ },
359+ ),
360+ uninhabited: false,
361+ variants: Single {
362+ index: 0,
363+ },
364+ max_repr_align: None,
365+ unadjusted_abi_align: Align(8 bytes),
366+ randomization_seed: 281492156579847,
367+ }
367368 --> src/lib.rs:4:1
368369 |
3693704 | type T<'a> = &'a u32;
0 commit comments