Struct rustc_lint::EarlyContext[−][src]

pub struct EarlyContext<'a> {
    pub sess: &'a Session,
    pub krate: &'a Crate,
    pub builder: LintLevelsBuilder<'a>,
    pub lint_store: &'a LintStore,
    pub buffered: LintBuffer,
}
Expand description

Context for lint checking of the AST, after expansion, before lowering to HIR.

Fields

sess: &'a Session
Expand description

Type context we’re checking in.

krate: &'a Crate
Expand description

The crate being checked.

builder: LintLevelsBuilder<'a>lint_store: &'a LintStore
Expand description

The store of registered lints and the lint levels.

buffered: LintBuffer

Implementations

impl<'a> EarlyContext<'a>[src]

pub fn new(
    sess: &'a Session,
    lint_store: &'a LintStore,
    krate: &'a Crate,
    buffered: LintBuffer,
    warn_about_weird_lints: bool
) -> EarlyContext<'a>
[src]

Trait Implementations

impl LintContext for EarlyContext<'_>[src]

fn sess(&self) -> &Session[src]

Gets the overall compiler Session object.

type PassObject = Box<dyn EarlyLintPass + Send + Sync + 'static>

fn lints(&self) -> &LintStore[src]

fn lookup<S: Into<MultiSpan>>(
    &self,
    lint: &'static Lint,
    span: Option<S>,
    decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>)
)
[src]

fn lookup_with_diagnostics(
    &self,
    lint: &'static Lint,
    span: Option<impl Into<MultiSpan>>,
    decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>),
    diagnostic: BuiltinLintDiagnostics
)
[src]

fn struct_span_lint<S: Into<MultiSpan>>(
    &self,
    lint: &'static Lint,
    span: S,
    decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>)
)
[src]

fn lint(
    &self,
    lint: &'static Lint,
    decorate: impl for<'a> FnOnce(LintDiagnosticBuilder<'a>)
)
[src]

Emit a lint at the appropriate level, with no associated span.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for EarlyContext<'a>

impl<'a> !Send for EarlyContext<'a>

impl<'a> !Sync for EarlyContext<'a>

impl<'a> Unpin for EarlyContext<'a>

impl<'a> !UnwindSafe for EarlyContext<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.