Skip to main content

HasAttrs

Trait HasAttrs 

Source
pub trait HasAttrs<'tcx, Tcx> {
    // Required method
    fn get_attrs(self, tcx: &Tcx) -> &'tcx [Attribute];
}
Expand description

A trait for types that can provide a list of attributes given a TyCtxt.

It allows find_attr! to accept either a DefId, LocalDefId, OwnerId, or HirId. It is defined here with a generic Tcx because rustc_hir can’t depend on rustc_middle. The concrete implementations are in rustc_middle.

Required Methods§

Source

fn get_attrs(self, tcx: &Tcx) -> &'tcx [Attribute]

Implementors§