rustc_lint

Trait EarlyCheckNode

Source
pub trait EarlyCheckNode<'a>: Copy {
    // Required methods
    fn id(self) -> NodeId;
    fn attrs<'b>(self) -> &'b [Attribute]
       where 'a: 'b;
    fn check<'b, T: EarlyLintPass>(self, cx: &mut EarlyContextAndPass<'b, T>)
       where 'a: 'b;
}
Expand description

Early lints work on different nodes - either on the crate root, or on freshly loaded modules. This trait generalizes over those nodes.

Required Methods§

Source

fn id(self) -> NodeId

Source

fn attrs<'b>(self) -> &'b [Attribute]
where 'a: 'b,

Source

fn check<'b, T: EarlyLintPass>(self, cx: &mut EarlyContextAndPass<'b, T>)
where 'a: 'b,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> EarlyCheckNode<'a> for (&'a Crate, &'a [Attribute])

Source§

fn id(self) -> NodeId

Source§

fn attrs<'b>(self) -> &'b [Attribute]
where 'a: 'b,

Source§

fn check<'b, T: EarlyLintPass>(self, cx: &mut EarlyContextAndPass<'b, T>)
where 'a: 'b,

Source§

impl<'a> EarlyCheckNode<'a> for (NodeId, &'a [Attribute], &'a [P<Item>])

Source§

fn id(self) -> NodeId

Source§

fn attrs<'b>(self) -> &'b [Attribute]
where 'a: 'b,

Source§

fn check<'b, T: EarlyLintPass>(self, cx: &mut EarlyContextAndPass<'b, T>)
where 'a: 'b,

Implementors§