Skip to main content

rustc_dump_object_lifetime_defaults

Attribute rustc_dump_object_lifetime_defaults 

Source
Expand description

Dumps the trait object lifetime defaults induced by the type parameters of the annotated item.

It will dump this information separately for each type parameter of the annotated item.

See also the object_lifetime_default query.

See AttributeKind::RustcDumpObjectLifetimeDefaults for the internal representation of this attribute.

§Example

//@ dont-require-annotations: ERROR
//@ compile-flags: --crate-type lib -Z ui-testing=no

#![feature(rustc_attrs)]

#[rustc_dump_object_lifetime_defaults]
struct Ref<'a, T: 'a>(&'a T);

produces:

error: 'a
--> $DIR/rustc_dump_object_lifetime_defaults.rs:7:16
 |
7 | struct Ref<'a, T: 'a>(&'a T);
 |                ^

error: aborting due to 1 previous error