pub struct EarlyContextAndPass<'ecx, 'tcx, T: EarlyLintPass> {
context: EarlyContext<'ecx>,
tcx: Option<TyCtxt<'tcx>>,
pass: T,
}Expand description
Implements the AST traversal for early lint passes. T provides the
check_* methods.
Fields§
§context: EarlyContext<'ecx>§tcx: Option<TyCtxt<'tcx>>§pass: TImplementations§
Source§impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T>
impl<'ecx, 'tcx, T: EarlyLintPass> EarlyContextAndPass<'ecx, 'tcx, T>
Trait Implementations§
Source§impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> Visitor<'ast> for EarlyContextAndPass<'ecx, 'tcx, T>
impl<'ast, 'ecx, 'tcx, T: EarlyLintPass> Visitor<'ast> for EarlyContextAndPass<'ecx, 'tcx, T>
fn visit_id(&mut self, id: NodeId)
fn visit_param(&mut self, param: &'ast Param)
fn visit_item(&mut self, it: &'ast Item)
fn visit_foreign_item(&mut self, it: &'ast ForeignItem)
fn visit_pat(&mut self, p: &'ast Pat)
fn visit_pat_field(&mut self, field: &'ast PatField)
fn visit_expr(&mut self, e: &'ast Expr)
fn visit_expr_field(&mut self, f: &'ast ExprField)
fn visit_stmt(&mut self, s: &'ast Stmt)
fn visit_fn(&mut self, fk: FnKind<'ast>, _: &AttrVec, span: Span, id: NodeId)
fn visit_field_def(&mut self, s: &'ast FieldDef)
fn visit_variant(&mut self, v: &'ast Variant)
fn visit_ty(&mut self, t: &'ast Ty)
fn visit_ident(&mut self, ident: &Ident)
fn visit_local(&mut self, l: &'ast Local)
fn visit_block(&mut self, b: &'ast Block)
fn visit_arm(&mut self, a: &'ast Arm)
fn visit_generic_arg(&mut self, arg: &'ast GenericArg)
fn visit_generic_param(&mut self, param: &'ast GenericParam)
fn visit_generics(&mut self, g: &'ast Generics)
fn visit_where_predicate(&mut self, p: &'ast WherePredicate)
fn visit_poly_trait_ref(&mut self, t: &'ast PolyTraitRef)
fn visit_assoc_item(&mut self, item: &'ast AssocItem, ctxt: AssocCtxt)
fn visit_attribute(&mut self, attr: &'ast Attribute)
fn visit_macro_def(&mut self, mac: &'ast MacroDef)
fn visit_mac_call(&mut self, mac: &'ast MacCall)
fn visit_anon_const(&mut self, node: &'a AnonConst) -> Self::Result
fn visit_assoc_item_constraint( &mut self, node: &'a AssocItemConstraint, ) -> Self::Result
fn visit_capture_by(&mut self, node: &'a CaptureBy) -> Self::Result
fn visit_closure_binder(&mut self, node: &'a ClosureBinder) -> Self::Result
fn visit_contract(&mut self, node: &'a FnContract) -> Self::Result
fn visit_coroutine_kind(&mut self, node: &'a CoroutineKind) -> Self::Result
fn visit_crate(&mut self, node: &'a Crate) -> Self::Result
fn visit_fn_decl(&mut self, node: &'a FnDecl) -> Self::Result
fn visit_fn_header(&mut self, node: &'a FnHeader) -> Self::Result
fn visit_fn_ret_ty(&mut self, node: &'a FnRetTy) -> Self::Result
fn visit_foreign_mod(&mut self, node: &'a ForeignMod) -> Self::Result
fn visit_format_args(&mut self, node: &'a FormatArgs) -> Self::Result
fn visit_generic_args(&mut self, node: &'a GenericArgs) -> Self::Result
fn visit_inline_asm(&mut self, node: &'a InlineAsm) -> Self::Result
fn visit_inline_asm_sym(&mut self, node: &'a InlineAsmSym) -> Self::Result
fn visit_label(&mut self, node: &'a Label) -> Self::Result
fn visit_lifetime( &mut self, node: &'a Lifetime, _ctxt: LifetimeCtxt, ) -> Self::Result
fn visit_param_bound( &mut self, node: &'a GenericBound, _ctxt: BoundKind, ) -> Self::Result
fn visit_path(&mut self, node: &'a Path) -> Self::Result
fn visit_path_segment(&mut self, node: &'a PathSegment) -> Self::Result
fn visit_precise_capturing_arg( &mut self, node: &'a PreciseCapturingArg, ) -> Self::Result
fn visit_qself(&mut self, node: &'a QSelf) -> Self::Result
fn visit_impl_restriction(&mut self, node: &'a ImplRestriction) -> Self::Result
fn visit_trait_ref(&mut self, node: &'a TraitRef) -> Self::Result
fn visit_ty_pat(&mut self, node: &'a TyPat) -> Self::Result
fn visit_use_tree(&mut self, node: &'a UseTree) -> Self::Result
fn visit_variant_data(&mut self, node: &'a VariantData) -> Self::Result
fn visit_vis(&mut self, node: &'a Visibility) -> Self::Result
fn visit_where_predicate_kind( &mut self, node: &'a WherePredicateKind, ) -> Self::Result
Source§fn visit_method_receiver_expr(&mut self, ex: &'a Expr) -> Self::Result
fn visit_method_receiver_expr(&mut self, ex: &'a Expr) -> Self::Result
This method is a hack to workaround unstable of
stmt_expr_attributes.
It can be removed once that feature is stabilized.fn visit_nested_use_tree( &mut self, use_tree: &'a UseTree, id: NodeId, ) -> Self::Result
Auto Trait Implementations§
impl<'ecx, 'tcx, T> DynSend for EarlyContextAndPass<'ecx, 'tcx, T>where
T: DynSend,
impl<'ecx, 'tcx, T> DynSync for EarlyContextAndPass<'ecx, 'tcx, T>where
T: DynSync,
impl<'ecx, 'tcx, T> Freeze for EarlyContextAndPass<'ecx, 'tcx, T>where
T: Freeze,
impl<'ecx, 'tcx, T> !RefUnwindSafe for EarlyContextAndPass<'ecx, 'tcx, T>
impl<'ecx, 'tcx, T> !Send for EarlyContextAndPass<'ecx, 'tcx, T>
impl<'ecx, 'tcx, T> !Sync for EarlyContextAndPass<'ecx, 'tcx, T>
impl<'ecx, 'tcx, T> Unpin for EarlyContextAndPass<'ecx, 'tcx, T>where
T: Unpin,
impl<'ecx, 'tcx, T> UnsafeUnpin for EarlyContextAndPass<'ecx, 'tcx, T>where
T: UnsafeUnpin,
impl<'ecx, 'tcx, T> !UnwindSafe for EarlyContextAndPass<'ecx, 'tcx, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<K> IntoQueryKey<K> for K
impl<K> IntoQueryKey<K> for K
Source§fn into_query_key(self) -> K
fn into_query_key(self) -> K
Argument conversion from
Self to K.
This should always be a very cheap conversion, e.g. LocalDefId::to_def_id.Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.