Struct rustc::lint::ContextUnstable [-] [+] [src]

pub struct Context<'a, 'tcx> {
    pub tcx: &'a ctxt<'tcx>,
    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, 'tcx> Context<'a, 'tcx>

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

Get the overall compiler Session object.

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

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

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, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx>

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

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

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<'v>, decl: &'v FnDecl, body: &'v 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_item(&mut self, m: &TraitItem)

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

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

fn visit_lifetime_def(&mut self, lt: &LifetimeDef)

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)

fn visit_name(&mut self, _span: Span, _name: Name)

fn visit_trait_ref(&mut self, t: &'v TraitRef)

fn visit_ty_param_bound(&mut self, bounds: &'v TyParamBound)

fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef, m: &'v TraitBoundModifier)

fn visit_lifetime_bound(&mut self, lifetime: &'v Lifetime)

fn visit_qpath(&mut self, qpath_span: Span, qpath: &'v QPath)

fn visit_path_segment(&mut self, path_span: Span, path_segment: &'v PathSegment)

fn visit_path_parameters(&mut self, path_span: Span, path_parameters: &'v PathParameters)

fn visit_assoc_type_binding(&mut self, type_binding: &'v TypeBinding)

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

fn visit_id(&mut self, id: NodeId)