Trait rustc::lint::LintContext [] [src]

pub trait LintContext: Sized {
    fn sess(&self) -> &Session;
    fn lints(&self) -> &LintStore;
    fn mut_lints(&mut self) -> &mut LintStore;
    fn level_stack(&mut self) -> &mut Vec<(LintId, LevelSource)>;
    fn enter_attrs(&mut self, attrs: &[Attribute]);
    fn exit_attrs(&mut self, attrs: &[Attribute]);

    fn current_level(&self, lint: &'static Lint) -> Level { ... }
    fn level_src(&self, lint: &'static Lint) -> Option<LevelSource> { ... }
    fn lookup_and_emit(&self, lint: &'static Lint, span: Option<Span>, msg: &str) { ... }
    fn lookup(&self, lint: &'static Lint, span: Option<Span>, msg: &str) -> DiagnosticBuilder { ... }
    fn span_lint(&self, lint: &'static Lint, span: Span, msg: &str) { ... }
    fn struct_span_lint(&self, lint: &'static Lint, span: Span, msg: &str) -> DiagnosticBuilder { ... }
    fn span_lint_note(&self, lint: &'static Lint, span: Span, msg: &str, note_span: Span, note: &str) { ... }
    fn span_lint_help(&self, lint: &'static Lint, span: Span, msg: &str, help: &str) { ... }
    fn lint(&self, lint: &'static Lint, msg: &str) { ... }
    fn with_lint_attrs<F>(&mut self, attrs: &[Attribute], f: F) where F: FnOnce(&mut Self) { ... }
}
Unstable (rustc_private)

Required Methods

fn sess(&self) -> &Session

Unstable (rustc_private)

fn lints(&self) -> &LintStore

Unstable (rustc_private)

fn mut_lints(&mut self) -> &mut LintStore

Unstable (rustc_private)

fn level_stack(&mut self) -> &mut Vec<(LintId, LevelSource)>

Unstable (rustc_private)

fn enter_attrs(&mut self, attrs: &[Attribute])

Unstable (rustc_private)

fn exit_attrs(&mut self, attrs: &[Attribute])

Unstable (rustc_private)

Provided Methods

fn current_level(&self, lint: &'static Lint) -> Level

Unstable (rustc_private)

Get the level of lint at the current position of the lint traversal.

fn level_src(&self, lint: &'static Lint) -> Option<LevelSource>

Unstable (rustc_private)

fn lookup_and_emit(&self, lint: &'static Lint, span: Option<Span>, msg: &str)

Unstable (rustc_private)

fn lookup(&self, lint: &'static Lint, span: Option<Span>, msg: &str) -> DiagnosticBuilder

Unstable (rustc_private)

fn span_lint(&self, lint: &'static Lint, span: Span, msg: &str)

Unstable (rustc_private)

Emit a lint at the appropriate level, for a particular span.

fn struct_span_lint(&self, lint: &'static Lint, span: Span, msg: &str) -> DiagnosticBuilder

Unstable (rustc_private)

fn span_lint_note(&self, lint: &'static Lint, span: Span, msg: &str, note_span: Span, note: &str)

Unstable (rustc_private)

Emit a lint and note at the appropriate level, for a particular span.

fn span_lint_help(&self, lint: &'static Lint, span: Span, msg: &str, help: &str)

Unstable (rustc_private)

Emit a lint and help at the appropriate level, for a particular span.

fn lint(&self, lint: &'static Lint, msg: &str)

Unstable (rustc_private)

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

fn with_lint_attrs<F>(&mut self, attrs: &[Attribute], f: F) where F: FnOnce(&mut Self)

Unstable (rustc_private)

Merge the lints specified by any lint attributes into the current lint context, call the provided function, then reset the lints in effect to their previous state.

Implementors