Struct rustc::lint::Context[src]

pub struct Context<'a> {
    pub tcx: &'a ctxt,
    pub krate: &'a Crate,
    pub exported_items: &'a ExportedItems,
    // some fields omitted
}

Context for lint checking.

Fields

tcx

Type context we're checking in.

krate

The crate being checked.

exported_items

Items exported from the crate being checked.

Methods

impl<'a> Context<'a>

fn sess(&'a self) -> &'a Session

Get the overall compiler Session object.

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

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

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

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

Trait Implementations

impl<'a> AstConv for Context<'a>

fn tcx<'a>(&'a self) -> &'a ctxt

fn get_item_ty(&self, id: DefId) -> Polytype

fn get_trait_def(&self, id: DefId) -> Rc<TraitDef>

fn ty_infer(&self, _span: Span) -> t

impl<'a> Visitor<()> for Context<'a>

fn visit_item(&mut self, it: &Item, _: ())

fn visit_foreign_item(&mut self, it: &ForeignItem, _: ())

fn visit_view_item(&mut self, i: &ViewItem, _: ())

fn visit_pat(&mut self, p: &Pat, _: ())

fn visit_expr(&mut self, e: &Expr, _: ())

fn visit_stmt(&mut self, s: &Stmt, _: ())

fn visit_fn(&mut self, fk: &FnKind, decl: &FnDecl, body: &Block, span: Span, id: NodeId, _: ())

fn visit_ty_method(&mut self, t: &TypeMethod, _: ())

fn visit_struct_def(&mut self, s: &StructDef, ident: Ident, g: &Generics, id: NodeId, _: ())

fn visit_struct_field(&mut self, s: &StructField, _: ())

fn visit_variant(&mut self, v: &Variant, g: &Generics, _: ())

fn visit_ty(&mut self, t: &Ty, _: ())

fn visit_ident(&mut self, sp: Span, id: Ident, _: ())

fn visit_mod(&mut self, m: &Mod, s: Span, n: NodeId, _: ())

fn visit_local(&mut self, l: &Local, _: ())

fn visit_block(&mut self, b: &Block, _: ())

fn visit_arm(&mut self, a: &Arm, _: ())

fn visit_decl(&mut self, d: &Decl, _: ())

fn visit_expr_post(&mut self, e: &Expr, _: ())

fn visit_generics(&mut self, g: &Generics, _: ())

fn visit_trait_method(&mut self, m: &TraitMethod, _: ())

fn visit_opt_lifetime_ref(&mut self, sp: Span, lt: &Option<Lifetime>, _: ())

fn visit_lifetime_ref(&mut self, lt: &Lifetime, _: ())

fn visit_lifetime_decl(&mut self, lt: &Lifetime, _: ())

fn visit_explicit_self(&mut self, es: &ExplicitSelf, _: ())

fn visit_mac(&mut self, mac: &Mac, _: ())

fn visit_path(&mut self, p: &Path, id: NodeId, _: ())

fn visit_attribute(&mut self, attr: &Attribute, _: ())

impl<'a> IdVisitingOperation for Context<'a>

fn visit_id(&self, id: NodeId)