Struct rustc::lint::context::EarlyContext [−][src]
pub struct EarlyContext<'a> {
pub sess: &'a Session,
pub krate: &'a Crate,
builder: LintLevelsBuilder<'a>,
lint_sess: LintSession<'a, EarlyLintPassObject>,
buffered: LintBuffer,
}🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Context for lint checking of the AST, after expansion, before lowering to HIR.
Fields
sess: &'a Session
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Type context we're checking in.
krate: &'a Crate
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The crate being checked.
builder: LintLevelsBuilder<'a>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
lint_sess: LintSession<'a, EarlyLintPassObject>
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
The store of registered lints and the lint levels.
buffered: LintBuffer
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Methods
impl<'a> EarlyContext<'a>[src]
impl<'a> EarlyContext<'a>fn new(sess: &'a Session, krate: &'a Crate) -> EarlyContext<'a>[src]
fn new(sess: &'a Session, krate: &'a Crate) -> EarlyContext<'a>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn check_id(&mut self, id: NodeId)[src]
fn check_id(&mut self, id: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Trait Implementations
impl<'a> LintContext<'a> for EarlyContext<'a>[src]
impl<'a> LintContext<'a> for EarlyContext<'a>type PassObject = EarlyLintPassObject
🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn sess(&self) -> &Session[src]
fn sess(&self) -> &Session🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Get the overall compiler Session object.
fn lints(&self) -> &LintStore[src]
fn lints(&self) -> &LintStore🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lint_sess(&self) -> &LintSession<'a, Self::PassObject>[src]
fn lint_sess(&self) -> &LintSession<'a, Self::PassObject>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lint_sess_mut(&mut self) -> &mut LintSession<'a, Self::PassObject>[src]
fn lint_sess_mut(&mut self) -> &mut LintSession<'a, Self::PassObject>🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn enter_attrs(&mut self, attrs: &'a [Attribute])[src]
fn enter_attrs(&mut self, attrs: &'a [Attribute])🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn exit_attrs(&mut self, attrs: &'a [Attribute])[src]
fn exit_attrs(&mut self, attrs: &'a [Attribute])🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lookup<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str
) -> DiagnosticBuilder[src]
fn lookup<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str
) -> DiagnosticBuilder🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn with_lint_attrs<F>(&mut self, id: NodeId, attrs: &'a [Attribute], f: F) where
F: FnOnce(&mut Self), [src]
fn with_lint_attrs<F>(&mut self, id: NodeId, attrs: &'a [Attribute], f: F) where
F: FnOnce(&mut Self), 🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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
fn lookup_and_emit<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str
)[src]
fn lookup_and_emit<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn lookup_and_emit_with_diagnostics<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str,
diagnostic: BuiltinLintDiagnostics
)[src]
fn lookup_and_emit_with_diagnostics<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: Option<S>,
msg: &str,
diagnostic: BuiltinLintDiagnostics
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn span_lint<S: Into<MultiSpan>>(&self, lint: &'static Lint, span: S, msg: &str)[src]
fn span_lint<S: Into<MultiSpan>>(&self, lint: &'static Lint, span: S, msg: &str)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Emit a lint at the appropriate level, for a particular span.
fn struct_span_lint<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: S,
msg: &str
) -> DiagnosticBuilder[src]
fn struct_span_lint<S: Into<MultiSpan>>(
&self,
lint: &'static Lint,
span: S,
msg: &str
) -> DiagnosticBuilder🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn span_lint_note(
&self,
lint: &'static Lint,
span: Span,
msg: &str,
note_span: Span,
note: &str
)[src]
fn span_lint_note(
&self,
lint: &'static Lint,
span: Span,
msg: &str,
note_span: Span,
note: &str
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
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)[src]
fn span_lint_help(&self, lint: &'static Lint, span: Span, msg: &str, help: &str)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Emit a lint and help at the appropriate level, for a particular span.
fn lint(&self, lint: &'static Lint, msg: &str)[src]
fn lint(&self, lint: &'static Lint, msg: &str)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Emit a lint at the appropriate level, with no associated span.
impl<'a> Visitor<'a> for EarlyContext<'a>[src]
impl<'a> Visitor<'a> for EarlyContext<'a>fn visit_item(&mut self, it: &'a Item)[src]
fn visit_item(&mut self, it: &'a Item)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_foreign_item(&mut self, it: &'a ForeignItem)[src]
fn visit_foreign_item(&mut self, it: &'a ForeignItem)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_pat(&mut self, p: &'a Pat)[src]
fn visit_pat(&mut self, p: &'a Pat)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_expr(&mut self, e: &'a Expr)[src]
fn visit_expr(&mut self, e: &'a Expr)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_stmt(&mut self, s: &'a Stmt)[src]
fn visit_stmt(&mut self, s: &'a Stmt)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_fn(&mut self, fk: FnKind<'a>, decl: &'a FnDecl, span: Span, id: NodeId)[src]
fn visit_fn(&mut self, fk: FnKind<'a>, decl: &'a FnDecl, span: Span, id: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_variant_data(
&mut self,
s: &'a VariantData,
ident: Ident,
g: &'a Generics,
item_id: NodeId,
_: Span
)[src]
fn visit_variant_data(
&mut self,
s: &'a VariantData,
ident: Ident,
g: &'a Generics,
item_id: NodeId,
_: Span
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_struct_field(&mut self, s: &'a StructField)[src]
fn visit_struct_field(&mut self, s: &'a StructField)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_variant(&mut self, v: &'a Variant, g: &'a Generics, item_id: NodeId)[src]
fn visit_variant(&mut self, v: &'a Variant, g: &'a Generics, item_id: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_ty(&mut self, t: &'a Ty)[src]
fn visit_ty(&mut self, t: &'a Ty)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_ident(&mut self, ident: Ident)[src]
fn visit_ident(&mut self, ident: Ident)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_mod(&mut self, m: &'a Mod, s: Span, _a: &[Attribute], n: NodeId)[src]
fn visit_mod(&mut self, m: &'a Mod, s: Span, _a: &[Attribute], n: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_local(&mut self, l: &'a Local)[src]
fn visit_local(&mut self, l: &'a Local)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_block(&mut self, b: &'a Block)[src]
fn visit_block(&mut self, b: &'a Block)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_arm(&mut self, a: &'a Arm)[src]
fn visit_arm(&mut self, a: &'a Arm)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_expr_post(&mut self, e: &'a Expr)[src]
fn visit_expr_post(&mut self, e: &'a Expr)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_generic_param(&mut self, param: &'a GenericParam)[src]
fn visit_generic_param(&mut self, param: &'a GenericParam)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_generics(&mut self, g: &'a Generics)[src]
fn visit_generics(&mut self, g: &'a Generics)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_where_predicate(&mut self, p: &'a WherePredicate)[src]
fn visit_where_predicate(&mut self, p: &'a WherePredicate)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_poly_trait_ref(
&mut self,
t: &'a PolyTraitRef,
m: &'a TraitBoundModifier
)[src]
fn visit_poly_trait_ref(
&mut self,
t: &'a PolyTraitRef,
m: &'a TraitBoundModifier
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_trait_item(&mut self, trait_item: &'a TraitItem)[src]
fn visit_trait_item(&mut self, trait_item: &'a TraitItem)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_impl_item(&mut self, impl_item: &'a ImplItem)[src]
fn visit_impl_item(&mut self, impl_item: &'a ImplItem)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_lifetime(&mut self, lt: &'a Lifetime)[src]
fn visit_lifetime(&mut self, lt: &'a Lifetime)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_path(&mut self, p: &'a Path, id: NodeId)[src]
fn visit_path(&mut self, p: &'a Path, id: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_attribute(&mut self, attr: &'a Attribute)[src]
fn visit_attribute(&mut self, attr: &'a Attribute)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_mac_def(&mut self, _mac: &'a MacroDef, id: NodeId)[src]
fn visit_mac_def(&mut self, _mac: &'a MacroDef, id: NodeId)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_name(&mut self, _span: Span, _name: Symbol)[src]
fn visit_name(&mut self, _span: Span, _name: Symbol)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_global_asm(&mut self, ga: &'ast GlobalAsm)[src]
fn visit_global_asm(&mut self, ga: &'ast GlobalAsm)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_anon_const(&mut self, c: &'ast AnonConst)[src]
fn visit_anon_const(&mut self, c: &'ast AnonConst)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_trait_ref(&mut self, t: &'ast TraitRef)[src]
fn visit_trait_ref(&mut self, t: &'ast TraitRef)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_ty_param_bound(&mut self, bounds: &'ast TyParamBound)[src]
fn visit_ty_param_bound(&mut self, bounds: &'ast TyParamBound)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_enum_def(
&mut self,
enum_definition: &'ast EnumDef,
generics: &'ast Generics,
item_id: NodeId,
Span
)[src]
fn visit_enum_def(
&mut self,
enum_definition: &'ast EnumDef,
generics: &'ast Generics,
item_id: NodeId,
Span
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_label(&mut self, label: &'ast Label)[src]
fn visit_label(&mut self, label: &'ast Label)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_mac(&mut self, _mac: &'ast Spanned<Mac_>)[src]
fn visit_mac(&mut self, _mac: &'ast Spanned<Mac_>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_use_tree(&mut self, use_tree: &'ast UseTree, id: NodeId, _nested: bool)[src]
fn visit_use_tree(&mut self, use_tree: &'ast UseTree, id: NodeId, _nested: bool)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_path_segment(
&mut self,
path_span: Span,
path_segment: &'ast PathSegment
)[src]
fn visit_path_segment(
&mut self,
path_span: Span,
path_segment: &'ast PathSegment
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_path_parameters(
&mut self,
path_span: Span,
path_parameters: &'ast PathParameters
)[src]
fn visit_path_parameters(
&mut self,
path_span: Span,
path_parameters: &'ast PathParameters
)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_assoc_type_binding(&mut self, type_binding: &'ast TypeBinding)[src]
fn visit_assoc_type_binding(&mut self, type_binding: &'ast TypeBinding)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_tt(&mut self, tt: TokenTree)[src]
fn visit_tt(&mut self, tt: TokenTree)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_tts(&mut self, tts: TokenStream)[src]
fn visit_tts(&mut self, tts: TokenStream)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_token(&mut self, _t: Token)[src]
fn visit_token(&mut self, _t: Token)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_vis(&mut self, vis: &'ast Spanned<VisibilityKind>)[src]
fn visit_vis(&mut self, vis: &'ast Spanned<VisibilityKind>)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
fn visit_fn_ret_ty(&mut self, ret_ty: &'ast FunctionRetTy)[src]
fn visit_fn_ret_ty(&mut self, ret_ty: &'ast FunctionRetTy)🔬 This is a nightly-only experimental API. (rustc_private)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
Auto Trait Implementations
impl<'a> !Send for EarlyContext<'a>
impl<'a> !Send for EarlyContext<'a>impl<'a> !Sync for EarlyContext<'a>
impl<'a> !Sync for EarlyContext<'a>