Struct rustc_lint::lint::LateContext
[−]
[src]
pub struct LateContext<'a, 'tcx> where 'tcx: 'a {
pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
pub tables: &'a TypeckTables<'tcx>,
pub krate: &'a Crate,
pub access_levels: &'a AccessLevels<NodeId>,
// some fields omitted
}
rustc_private
)Context for lint checking after type checking.
Fields
tcx: TyCtxt<'a, 'tcx, 'tcx>
rustc_private
)Type context we're checking in.
tables: &'a TypeckTables<'tcx>
rustc_private
)Side-tables for the body we are in.
krate: &'a Crate
rustc_private
)The crate being checked.
access_levels: &'a AccessLevels<NodeId>
rustc_private
)Items accessible from the crate being checked.
Trait Implementations
impl<'a, 'tcx> LintContext<'tcx> for LateContext<'a, 'tcx>
[src]
fn sess(&self) -> &Session
rustc_private
)Get the overall compiler Session
object.
fn lints(&self) -> &LintStore
rustc_private
)fn mut_lints(&mut self) -> &mut LintStore
rustc_private
)fn level_stack(&mut self) -> &mut Vec<(LintId, (Level, LintSource))>
rustc_private
)fn enter_attrs(&mut self, attrs: &'tcx [Attribute])
rustc_private
)fn exit_attrs(&mut self, attrs: &'tcx [Attribute])
rustc_private
)fn current_level(&self, lint: &'static Lint) -> Level
rustc_private
)Get the level of lint
at the current position of the lint traversal. Read more
fn level_src(&self, lint: &'static Lint) -> Option<(Level, LintSource)>
rustc_private
)fn lookup_and_emit<S>(&self, lint: &'static Lint, span: Option<S>, msg: &str) where S: Into<MultiSpan>
rustc_private
)fn lookup<S>(&self,
lint: &'static Lint,
span: Option<S>,
msg: &str)
-> DiagnosticBuilder where S: Into<MultiSpan>
lint: &'static Lint,
span: Option<S>,
msg: &str)
-> DiagnosticBuilder where S: Into<MultiSpan>
rustc_private
)fn span_lint<S>(&self, lint: &'static Lint, span: S, msg: &str) where S: Into<MultiSpan>
rustc_private
)Emit a lint at the appropriate level, for a particular span.
fn early_lint(&self, early_lint: &EarlyLint)
rustc_private
)fn struct_span_lint<S>(&self,
lint: &'static Lint,
span: S,
msg: &str)
-> DiagnosticBuilder where S: Into<MultiSpan>
lint: &'static Lint,
span: S,
msg: &str)
-> DiagnosticBuilder where S: Into<MultiSpan>
rustc_private
)fn span_lint_note(&self,
lint: &'static Lint,
span: Span,
msg: &str,
note_span: Span,
note: &str)
lint: &'static Lint,
span: Span,
msg: &str,
note_span: Span,
note: &str)
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)
rustc_private
)Emit a lint and help at the appropriate level, for a particular span.
fn lint(&self, lint: &'static Lint, msg: &str)
rustc_private
)Emit a lint at the appropriate level, with no associated span.
fn with_lint_attrs<F>(&mut self, attrs: &'tcx [Attribute], f: F) where F: FnOnce(&mut Self) -> ()
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. Read more
impl<'a, 'tcx> Visitor<'tcx> for LateContext<'a, 'tcx>
[src]
fn nested_visit_map(&'this mut self) -> NestedVisitorMap<'this, 'tcx>
rustc_private
)Because lints are scoped lexically, we want to walk nested items in the context of the outer item, so enable deep-walking.
fn visit_id(&mut self, id: NodeId)
rustc_private
)fn visit_nested_body(&mut self, body: BodyId)
rustc_private
)fn visit_body(&mut self, body: &'tcx Body)
rustc_private
)fn visit_item(&mut self, it: &'tcx Item)
rustc_private
)fn visit_foreign_item(&mut self, it: &'tcx ForeignItem)
rustc_private
)fn visit_pat(&mut self, p: &'tcx Pat)
rustc_private
)fn visit_expr(&mut self, e: &'tcx Expr)
rustc_private
)fn visit_stmt(&mut self, s: &'tcx Spanned<Stmt_>)
rustc_private
)fn visit_fn(&mut self,
fk: FnKind<'tcx>,
decl: &'tcx FnDecl,
body_id: BodyId,
span: Span,
id: NodeId)
fk: FnKind<'tcx>,
decl: &'tcx FnDecl,
body_id: BodyId,
span: Span,
id: NodeId)
rustc_private
)fn visit_variant_data(&mut self,
s: &'tcx VariantData,
name: Symbol,
g: &'tcx Generics,
item_id: NodeId,
Span)
s: &'tcx VariantData,
name: Symbol,
g: &'tcx Generics,
item_id: NodeId,
Span)
rustc_private
)fn visit_struct_field(&mut self, s: &'tcx StructField)
rustc_private
)fn visit_variant(&mut self,
v: &'tcx Spanned<Variant_>,
g: &'tcx Generics,
item_id: NodeId)
v: &'tcx Spanned<Variant_>,
g: &'tcx Generics,
item_id: NodeId)
rustc_private
)fn visit_ty(&mut self, t: &'tcx Ty)
rustc_private
)fn visit_name(&mut self, sp: Span, name: Symbol)
rustc_private
)fn visit_mod(&mut self, m: &'tcx Mod, s: Span, n: NodeId)
rustc_private
)fn visit_local(&mut self, l: &'tcx Local)
rustc_private
)fn visit_block(&mut self, b: &'tcx Block)
rustc_private
)fn visit_arm(&mut self, a: &'tcx Arm)
rustc_private
)fn visit_decl(&mut self, d: &'tcx Spanned<Decl_>)
rustc_private
)fn visit_generics(&mut self, g: &'tcx Generics)
rustc_private
)fn visit_trait_item(&mut self, trait_item: &'tcx TraitItem)
rustc_private
)fn visit_impl_item(&mut self, impl_item: &'tcx ImplItem)
rustc_private
)fn visit_lifetime(&mut self, lt: &'tcx Lifetime)
rustc_private
)fn visit_lifetime_def(&mut self, lt: &'tcx LifetimeDef)
rustc_private
)fn visit_path(&mut self, p: &'tcx Path, id: NodeId)
rustc_private
)fn visit_attribute(&mut self, attr: &'tcx Attribute)
rustc_private
)