Struct rustc_resolve::late::LateResolutionVisitor

source ·
struct LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
    r: &'b mut Resolver<'a, 'tcx>,
    parent_scope: ParentScope<'a>,
    ribs: PerNS<Vec<Rib<'a>>>,
    last_block_rib: Option<Rib<'a>>,
    label_ribs: Vec<Rib<'a, NodeId>>,
    lifetime_ribs: Vec<LifetimeRib>,
    lifetime_elision_candidates: Option<Vec<(LifetimeRes, LifetimeElisionCandidate)>>,
    current_trait_ref: Option<(Module<'a>, TraitRef)>,
    diag_metadata: Box<DiagMetadata<'ast>>,
    in_func_body: bool,
    lifetime_uses: FxHashMap<LocalDefId, LifetimeUseSet>,
}

Fields§

§r: &'b mut Resolver<'a, 'tcx>§parent_scope: ParentScope<'a>

The module that represents the current item scope.

§ribs: PerNS<Vec<Rib<'a>>>

The current set of local scopes for types and values.

§last_block_rib: Option<Rib<'a>>

Previous popped rib, only used for diagnostic.

§label_ribs: Vec<Rib<'a, NodeId>>

The current set of local scopes, for labels.

§lifetime_ribs: Vec<LifetimeRib>

The current set of local scopes for lifetimes.

§lifetime_elision_candidates: Option<Vec<(LifetimeRes, LifetimeElisionCandidate)>>

We are looking for lifetimes in an elision context. The set contains all the resolutions that we encountered so far. They will be used to determine the correct lifetime for the fn return type. The LifetimeElisionCandidate is used for diagnostics, to suggest introducing named lifetimes.

§current_trait_ref: Option<(Module<'a>, TraitRef)>

The trait that the current context can refer to.

§diag_metadata: Box<DiagMetadata<'ast>>

Fields used to add information to diagnostic errors.

§in_func_body: bool

State used to know whether to ignore resolution errors for function bodies.

In particular, rustdoc uses this to avoid giving errors for cfg() items. In most cases this will be None, in which case errors will always be reported. If it is true, then it will be updated when entering a nested function or trait body.

§lifetime_uses: FxHashMap<LocalDefId, LifetimeUseSet>

Count the number of places a lifetime is used.

Implementations§

source§

impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx>

source

fn make_base_error( &mut self, path: &[Segment], span: Span, source: PathSource<'_>, res: Option<Res<NodeId>>, ) -> BaseError

source

pub(crate) fn smart_resolve_partial_mod_path_errors( &mut self, prefix_path: &[Segment], following_seg: Option<&Segment>, ) -> Vec<ImportSuggestion>

Try to suggest for a module path that cannot be resolved. Such as fmt::Debug where fmt is not resolved without importing, here we search with lookup_import_candidates for a module named fmt with TypeNS as namespace.

We need a separate function here because we won’t suggest for a path with single segment and we won’t change SourcePath api is_expected to match Type with DefKind::Mod

source

pub(crate) fn smart_resolve_report_errors( &mut self, path: &[Segment], following_seg: Option<&Segment>, span: Span, source: PathSource<'_>, res: Option<Res<NodeId>>, ) -> (Diag<'tcx>, Vec<ImportSuggestion>)

Handles error reporting for smart_resolve_path_fragment function. Creates base error and amends it with one short label and possibly some longer helps/notes.

source

fn detect_assoc_type_constraint_meant_as_path( &self, err: &mut Diag<'_>, base_error: &BaseError, )

source

fn suggest_self_or_self_ref( &mut self, err: &mut Diag<'_>, path: &[Segment], span: Span, )

source

fn try_lookup_name_relaxed( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], following_seg: Option<&Segment>, span: Span, res: Option<Res<NodeId>>, base_error: &BaseError, ) -> (bool, Vec<ImportSuggestion>)

source

fn suggest_trait_and_bounds( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, res: Option<Res<NodeId>>, span: Span, base_error: &BaseError, ) -> bool

source

fn suggest_typo( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], following_seg: Option<&Segment>, span: Span, base_error: &BaseError, ) -> bool

source

fn suggest_shadowed( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], following_seg: Option<&Segment>, span: Span, ) -> bool

source

fn err_code_special_cases( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], span: Span, )

source

fn suggest_self_ty( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], span: Span, ) -> bool

Emit special messages for unresolved Self and self.

source

fn suggest_self_value( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, path: &[Segment], span: Span, ) -> bool

source

fn suggest_at_operator_in_slice_pat_with_range( &mut self, err: &mut Diag<'_>, path: &[Segment], )

source

fn suggest_swapping_misplaced_self_ty_and_trait( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, res: Option<Res<NodeId>>, span: Span, )

source

fn suggest_bare_struct_literal(&mut self, err: &mut Diag<'_>)

source

fn suggest_changing_type_to_const_param( &mut self, err: &mut Diag<'_>, res: Option<Res<NodeId>>, source: PathSource<'_>, span: Span, )

source

fn suggest_pattern_match_with_let( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, span: Span, ) -> bool

source

fn get_single_associated_item( &mut self, path: &[Segment], source: &PathSource<'_>, filter_fn: &impl Fn(Res<NodeId>) -> bool, ) -> Option<TypoSuggestion>

source

fn restrict_assoc_type_in_where_clause( &mut self, span: Span, err: &mut Diag<'_>, ) -> bool

Given where <T as Bar>::Baz: String, suggest where T: Bar<Baz = String>.

source

fn call_has_self_arg( &self, source: PathSource<'_>, ) -> Option<(Span, Option<Span>)>

Check if the source is call expression and the first argument is self. If true, return the span of whole call and the span for all arguments expect the first one (self).

source

fn followed_by_brace(&self, span: Span) -> (bool, Option<Span>)

source

fn smart_resolve_context_dependent_help( &mut self, err: &mut Diag<'_>, span: Span, source: PathSource<'_>, path: &[Segment], res: Res<NodeId>, path_str: &str, fallback_label: &str, ) -> bool

Provides context-dependent help for errors reported by the smart_resolve_path_fragment function. Returns true if able to provide context-dependent help.

source

fn suggest_alternative_construction_methods( &mut self, def_id: DefId, err: &mut Diag<'_>, path_span: Span, call_span: Span, args: &[P<Expr>], )

source

fn has_private_fields(&self, def_id: DefId) -> bool

source

pub(crate) fn find_similarly_named_assoc_item( &mut self, ident: Symbol, kind: &AssocItemKind, ) -> Option<Symbol>

Given the target ident and kind, search for the similarly named associated item in self.current_trait_ref.

source

fn lookup_assoc_candidate<FilterFn>( &mut self, ident: Ident, ns: Namespace, filter_fn: FilterFn, called: bool, ) -> Option<AssocSuggestion>
where FilterFn: Fn(Res<NodeId>) -> bool,

source

fn lookup_typo_candidate( &mut self, path: &[Segment], following_seg: Option<&Segment>, ns: Namespace, filter_fn: &impl Fn(Res<NodeId>) -> bool, ) -> TypoCandidate

source

fn likely_rust_type(path: &[Segment]) -> Option<Symbol>

source

fn let_binding_suggestion( &mut self, err: &mut Diag<'_>, ident_span: Span, ) -> bool

source

fn find_module( &mut self, def_id: DefId, ) -> Option<(Module<'a>, ImportSuggestion)>

source

fn collect_enum_ctors( &mut self, def_id: DefId, ) -> Option<Vec<(Path, DefId, CtorKind)>>

source

fn suggest_using_enum_variant( &mut self, err: &mut Diag<'_>, source: PathSource<'_>, def_id: DefId, span: Span, )

Adds a suggestion for using an enum’s variant when an enum is used instead.

source

pub(crate) fn suggest_adding_generic_parameter( &self, path: &[Segment], source: PathSource<'_>, ) -> Option<(Span, &'static str, String, Applicability)>

source

pub(crate) fn suggestion_for_label_in_rib( &self, rib_index: usize, label: Ident, ) -> Option<(Ident, bool)>

Given the target label, search the rib_indexth label rib for similarly named labels, optionally returning the closest match and whether it is reachable.

source

pub(crate) fn maybe_report_lifetime_uses( &mut self, generics_span: Span, params: &[GenericParam], )

source

pub(crate) fn emit_undeclared_lifetime_error( &self, lifetime_ref: &Lifetime, outer_lifetime_ref: Option<Ident>, )

source

fn suggest_introducing_lifetime( &self, err: &mut Diag<'_>, name: Option<&str>, suggest: impl Fn(&mut Diag<'_>, bool, Span, Cow<'static, str>, String, Vec<(Span, String)>) -> bool, )

source

pub(crate) fn emit_non_static_lt_in_const_param_ty_error( &self, lifetime_ref: &Lifetime, )

source

pub(crate) fn emit_forbidden_non_static_lifetime_error( &self, cause: NoConstantGenericsReason, lifetime_ref: &Lifetime, )

Non-static lifetimes are prohibited in anonymous constants under min_const_generics. This function will emit an error if generic_const_exprs is not enabled, the body identified by body_id is an anonymous constant and lifetime_ref is non-static.

source

pub(crate) fn report_missing_lifetime_specifiers( &mut self, lifetime_refs: Vec<MissingLifetime>, function_param_lifetimes: Option<(Vec<MissingLifetime>, Vec<ElisionFnParameter>)>, ) -> ErrorGuaranteed

source

fn add_missing_lifetime_specifiers_label( &mut self, err: &mut Diag<'_>, lifetime_refs: Vec<MissingLifetime>, function_param_lifetimes: Option<(Vec<MissingLifetime>, Vec<ElisionFnParameter>)>, )

source§

impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

source

fn new( resolver: &'b mut Resolver<'a, 'tcx>, ) -> LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

source

fn maybe_resolve_ident_in_lexical_scope( &mut self, ident: Ident, ns: Namespace, ) -> Option<LexicalScopeBinding<'a>>

source

fn resolve_ident_in_lexical_scope( &mut self, ident: Ident, ns: Namespace, finalize: Option<Finalize>, ignore_binding: Option<Interned<'a, NameBindingData<'a>>>, ) -> Option<LexicalScopeBinding<'a>>

source

fn resolve_path( &mut self, path: &[Segment], opt_ns: Option<Namespace>, finalize: Option<Finalize>, ) -> PathResult<'a>

source

fn with_rib<T>( &mut self, ns: Namespace, kind: RibKind<'a>, work: impl FnOnce(&mut Self) -> T, ) -> T

Do some work within a new innermost rib of the given kind in the given namespace (ns).

source

fn with_scope<T>(&mut self, id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T

source

fn visit_generic_params( &mut self, params: &'ast [GenericParam], add_self_upper: bool, )

source

fn with_lifetime_rib<T>( &mut self, kind: LifetimeRibKind, work: impl FnOnce(&mut Self) -> T, ) -> T

source

fn resolve_lifetime(&mut self, lifetime: &'ast Lifetime, use_ctxt: LifetimeCtxt)

source

fn resolve_anonymous_lifetime(&mut self, lifetime: &Lifetime, elided: bool)

source

fn resolve_elided_lifetime(&mut self, anchor_id: NodeId, span: Span)

source

fn create_fresh_lifetime( &mut self, ident: Ident, binder: NodeId, kind: MissingLifetimeKind, ) -> LifetimeRes

source

fn resolve_elided_lifetimes_in_path( &mut self, partial_res: PartialRes, path: &[Segment], source: PathSource<'_>, path_span: Span, )

source

fn record_lifetime_res( &mut self, id: NodeId, res: LifetimeRes, candidate: LifetimeElisionCandidate, )

source

fn record_lifetime_param(&mut self, id: NodeId, res: LifetimeRes)

source

fn resolve_fn_signature( &mut self, fn_id: NodeId, has_self: bool, inputs: impl Iterator<Item = (Option<&'ast Pat>, &'ast Ty)> + Clone, output_ty: &'ast FnRetTy, )

Perform resolution of a function signature, accounting for lifetime elision.

source

fn resolve_fn_params( &mut self, has_self: bool, inputs: impl Iterator<Item = (Option<&'ast Pat>, &'ast Ty)>, ) -> Result<LifetimeRes, (Vec<MissingLifetime>, Vec<ElisionFnParameter>)>

Resolve inside function parameters and parameter types. Returns the lifetime for elision in fn return type, or diagnostic information in case of elision failure.

source

fn find_lifetime_for_self(&self, ty: &'ast Ty) -> Set1<LifetimeRes>

List all the lifetimes that appear in the provided type.

source

fn resolve_label( &mut self, label: Ident, ) -> Result<(NodeId, Span), ResolutionError<'a>>

Searches the current set of local scopes for labels. Returns the NodeId of the resolved label and reports an error if the label is not found or is unreachable.

source

fn is_label_valid_from_rib(&self, rib_index: usize) -> bool

Determine whether or not a label from the rib_indexth label rib is reachable.

source

fn resolve_adt(&mut self, item: &'ast Item, generics: &'ast Generics)

source

fn future_proof_import(&mut self, use_tree: &UseTree)

source

fn resolve_item(&mut self, item: &'ast Item)

source

fn with_generic_param_rib<'c, F>( &'c mut self, params: &'c [GenericParam], kind: RibKind<'a>, lifetime_kind: LifetimeRibKind, f: F, )
where F: FnOnce(&mut Self),

source

fn with_label_rib(&mut self, kind: RibKind<'a>, f: impl FnOnce(&mut Self))

source

fn with_static_rib(&mut self, def_kind: DefKind, f: impl FnOnce(&mut Self))

source

fn with_constant_rib( &mut self, is_repeat: IsRepeatExpr, may_use_generics: ConstantHasGenerics, item: Option<(Ident, ConstantItemKind)>, f: impl FnOnce(&mut Self), )

source

fn with_current_self_type<T>( &mut self, self_type: &Ty, f: impl FnOnce(&mut Self) -> T, ) -> T

source

fn with_current_self_item<T>( &mut self, self_item: &Item, f: impl FnOnce(&mut Self) -> T, ) -> T

source

fn resolve_trait_items(&mut self, trait_items: &'ast [P<AssocItem>])

When evaluating a trait use its associated types’ idents for suggestions in E0412.

source

fn with_optional_trait_ref<T>( &mut self, opt_trait_ref: Option<&TraitRef>, self_type: &'ast Ty, f: impl FnOnce(&mut Self, Option<DefId>) -> T, ) -> T

This is called to resolve a trait reference from an impl (i.e., impl Trait for Foo).

source

fn with_self_rib_ns( &mut self, ns: Namespace, self_res: Res<NodeId>, f: impl FnOnce(&mut Self), )

source

fn with_self_rib(&mut self, self_res: Res<NodeId>, f: impl FnOnce(&mut Self))

source

fn resolve_implementation( &mut self, attrs: &[Attribute], generics: &'ast Generics, opt_trait_reference: &'ast Option<TraitRef>, self_type: &'ast Ty, item_id: NodeId, impl_items: &'ast [P<AssocItem>], )

source

fn resolve_impl_item( &mut self, item: &'ast AssocItem, seen_trait_items: &mut FxHashMap<DefId, Span>, trait_id: Option<DefId>, )

source

fn check_trait_item<F>( &mut self, id: NodeId, ident: Ident, kind: &AssocItemKind, ns: Namespace, span: Span, seen_trait_items: &mut FxHashMap<DefId, Span>, err: F, )

source

fn resolve_const_body( &mut self, expr: &'ast Expr, item: Option<(Ident, ConstantItemKind)>, )

source

fn resolve_delegation(&mut self, delegation: &'ast Delegation)

source

fn resolve_params(&mut self, params: &'ast [Param])

source

fn resolve_local(&mut self, local: &'ast Local)

source

fn compute_and_check_binding_map( &mut self, pat: &Pat, ) -> Result<FxIndexMap<Ident, BindingInfo>, IsNeverPattern>

Build a map from pattern identifiers to binding-info’s, and check the bindings are consistent when encountering or-patterns and never patterns. This is done hygienically: this could arise for a macro that expands into an or-pattern where one ‘x’ was from the user and one ‘x’ came from the macro.

A never pattern by definition indicates an unreachable case. For example, matching on Result<T, &!> could look like:

let foo: Result<u32, &!> = Ok(0);
match foo {
    Ok(x) => bar(x),
    Err(&!),
}

This extends to product types: (x, !) is likewise unreachable. So it doesn’t make sense to have a binding here, and we tell the user to use _ instead.

source

fn is_base_res_local(&self, nid: NodeId) -> bool

source

fn compute_and_check_or_pat_binding_map( &mut self, pats: &[P<Pat>], ) -> Result<FxIndexMap<Ident, BindingInfo>, IsNeverPattern>

Compute the binding map for an or-pattern. Checks that all of the arms in the or-pattern have exactly the same set of bindings, with the same binding modes for each. Returns the computed binding map and a boolean indicating whether the pattern is a never pattern.

A never pattern by definition indicates an unreachable case. For example, destructuring a Result<T, &!> could look like:

let (Ok(x) | Err(&!)) = foo();

Because the Err(&!) branch is never reached, it does not need to have the same bindings as the other branches of the or-pattern. So we must ignore never pattern when checking the bindings of an or-pattern. Moreover, if all the subpatterns are never patterns (e.g. Ok(!) | Err(!)), then the pattern as a whole counts as a never pattern (since it’s definitionallly unreachable).

source

fn check_consistent_bindings(&mut self, pat: &'ast Pat)

Check the consistency of bindings wrt or-patterns and never patterns.

source

fn resolve_arm(&mut self, arm: &'ast Arm)

source

fn resolve_pattern_top(&mut self, pat: &'ast Pat, pat_src: PatternSource)

Arising from source, resolve a top level pattern.

source

fn resolve_pattern( &mut self, pat: &'ast Pat, pat_src: PatternSource, bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet<Ident>); 1]>, )

source

fn resolve_pattern_inner( &mut self, pat: &Pat, pat_src: PatternSource, bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet<Ident>); 1]>, )

Resolve bindings in a pattern. This is a helper to resolve_pattern.

§bindings

A stack of sets of bindings accumulated.

In each set, PatBoundCtx::Product denotes that a found binding in it should be interpreted as re-binding an already bound binding. This results in an error. Meanwhile, PatBound::Or denotes that a found binding in the set should result in reusing this binding rather than creating a fresh one.

When called at the top level, the stack must have a single element with PatBound::Product. Otherwise, pushing to the stack happens as or-patterns (p_0 | ... | p_n) are encountered and the context needs to be switched to PatBoundCtx::Or and then PatBoundCtx::Product for each p_i. When each p_i has been dealt with, the top set is merged with its parent. When a whole or-pattern has been dealt with, the thing happens.

See the implementation and fresh_binding for more details.

source

fn fresh_binding( &mut self, ident: Ident, pat_id: NodeId, pat_src: PatternSource, bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet<Ident>); 1]>, ) -> Res<NodeId>

source

fn innermost_rib_bindings( &mut self, ns: Namespace, ) -> &mut FxHashMap<Ident, Res<NodeId>>

source

fn try_resolve_as_non_binding( &mut self, pat_src: PatternSource, ann: BindingMode, ident: Ident, has_sub: bool, ) -> Option<Res<NodeId>>

source

fn smart_resolve_path( &mut self, id: NodeId, qself: &Option<P<QSelf>>, path: &Path, source: PathSource<'ast>, )

source

fn smart_resolve_path_fragment( &mut self, qself: &Option<P<QSelf>>, path: &[Segment], source: PathSource<'ast>, finalize: Finalize, record_partial_res: RecordPartialRes, ) -> PartialRes

source

fn self_type_is_available(&mut self) -> bool

source

fn self_value_is_available(&mut self, self_span: Span) -> bool

source

fn report_error(&mut self, span: Span, resolution_error: ResolutionError<'a>)

A wrapper around Resolver::report_error.

This doesn’t emit errors for function bodies if this is rustdoc.

source

fn should_report_errs(&self) -> bool

If we’re actually rustdoc then avoid giving a name resolution error for cfg() items or

source

fn resolve_qpath_anywhere( &mut self, qself: &Option<P<QSelf>>, path: &[Segment], primary_ns: Namespace, span: Span, defer_to_typeck: bool, finalize: Finalize, ) -> Result<Option<PartialRes>, Spanned<ResolutionError<'a>>>

source

fn resolve_qpath( &mut self, qself: &Option<P<QSelf>>, path: &[Segment], ns: Namespace, finalize: Finalize, ) -> Result<Option<PartialRes>, Spanned<ResolutionError<'a>>>

Handles paths that may refer to associated items.

source

fn with_resolved_label( &mut self, label: Option<Label>, id: NodeId, f: impl FnOnce(&mut Self), )

source

fn resolve_labeled_block( &mut self, label: Option<Label>, id: NodeId, block: &'ast Block, )

source

fn resolve_block(&mut self, block: &'ast Block)

source

fn resolve_anon_const( &mut self, constant: &'ast AnonConst, anon_const_kind: AnonConstKind, )

source

fn resolve_anon_const_manual( &mut self, is_trivial_const_arg: bool, anon_const_kind: AnonConstKind, resolve_expr: impl FnOnce(&mut Self), )

There are a few places that we need to resolve an anon const but we did not parse an anon const so cannot provide an &'ast AnonConst. Right now this is just unbraced const arguments that were parsed as type arguments, and legact_const_generics which parse as normal function argument expressions. To avoid duplicating the code for resolving an anon const we have this function which lets the caller manually call resolve_expr or smart_resolve_path.

source

fn resolve_expr_field(&mut self, f: &'ast ExprField, e: &'ast Expr)

source

fn resolve_expr(&mut self, expr: &'ast Expr, parent: Option<&'ast Expr>)

source

fn record_candidate_traits_for_expr_if_necessary(&mut self, expr: &'ast Expr)

source

fn traits_in_scope( &mut self, ident: Ident, ns: Namespace, ) -> Vec<TraitCandidate>

source

fn record_lifetime_params_for_impl_trait(&mut self, impl_trait_node_id: NodeId)

Construct the list of in-scope lifetime parameters for impl trait lowering. We include all lifetime parameters, either named or “Fresh”. The order of those parameters does not matter, as long as it is deterministic.

source

fn resolve_and_cache_rustdoc_path( &mut self, path_str: &str, ns: Namespace, ) -> Option<Res<NodeId>>

source

fn lint_unused_qualifications( &mut self, path: &[Segment], ns: Namespace, finalize: Finalize, )

Trait Implementations§

source§

impl<'a: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast, 'tcx>

Walks the whole crate in DFS order, visiting each item, resolving names as it goes.

source§

fn visit_attribute(&mut self, _: &'ast Attribute)

source§

fn visit_item(&mut self, item: &'ast Item)

source§

fn visit_arm(&mut self, arm: &'ast Arm)

source§

fn visit_block(&mut self, block: &'ast Block)

source§

fn visit_anon_const(&mut self, _constant: &'ast AnonConst)

source§

fn visit_expr(&mut self, expr: &'ast Expr)

source§

fn visit_pat(&mut self, p: &'ast Pat)

source§

fn visit_local(&mut self, local: &'ast Local)

source§

fn visit_ty(&mut self, ty: &'ast Ty)

source§

fn visit_poly_trait_ref(&mut self, tref: &'ast PolyTraitRef)

source§

fn visit_foreign_item(&mut self, foreign_item: &'ast ForeignItem)

source§

fn visit_fn(&mut self, fn_kind: FnKind<'ast>, sp: Span, fn_id: NodeId)

source§

fn visit_lifetime(&mut self, lifetime: &'ast Lifetime, use_ctxt: LifetimeCtxt)

source§

fn visit_precise_capturing_arg(&mut self, arg: &'ast PreciseCapturingArg)

source§

fn visit_generics(&mut self, generics: &'ast Generics)

source§

fn visit_closure_binder(&mut self, b: &'ast ClosureBinder)

source§

fn visit_generic_arg(&mut self, arg: &'ast GenericArg)

source§

fn visit_assoc_item_constraint(&mut self, constraint: &'ast AssocItemConstraint)

source§

fn visit_path_segment(&mut self, path_segment: &'ast PathSegment)

source§

fn visit_where_predicate(&mut self, p: &'ast WherePredicate)

source§

fn visit_inline_asm(&mut self, asm: &'ast InlineAsm)

source§

fn visit_inline_asm_sym(&mut self, sym: &'ast InlineAsmSym)

source§

fn visit_variant(&mut self, v: &'ast Variant)

source§

fn visit_variant_discr(&mut self, discr: &'ast AnonConst)

source§

fn visit_field_def(&mut self, f: &'ast FieldDef)

source§

type Result = ()

The result type of the visit_* methods. Can be either (), or ControlFlow<T>.
source§

fn visit_ident(&mut self, _ident: Ident) -> Self::Result

source§

fn visit_stmt(&mut self, s: &'ast Stmt) -> Self::Result

source§

fn visit_param(&mut self, param: &'ast Param) -> Self::Result

source§

fn visit_method_receiver_expr(&mut self, ex: &'ast Expr) -> Self::Result

This method is a hack to workaround unstable of stmt_expr_attributes. It can be removed once that feature is stabilized.
source§

fn visit_expr_post(&mut self, _ex: &'ast Expr) -> Self::Result

source§

fn visit_generic_param(&mut self, param: &'ast GenericParam) -> Self::Result

source§

fn visit_assoc_item( &mut self, i: &'ast Item<AssocItemKind>, ctxt: AssocCtxt, ) -> Self::Result

source§

fn visit_trait_ref(&mut self, t: &'ast TraitRef) -> Self::Result

source§

fn visit_param_bound( &mut self, bounds: &'ast GenericBound, _ctxt: BoundKind, ) -> Self::Result

source§

fn visit_variant_data(&mut self, s: &'ast VariantData) -> Self::Result

source§

fn visit_enum_def(&mut self, enum_definition: &'ast EnumDef) -> Self::Result

source§

fn visit_label(&mut self, label: &'ast Label) -> Self::Result

source§

fn visit_mac_call(&mut self, mac: &'ast MacCall) -> Self::Result

source§

fn visit_mac_def(&mut self, _mac: &'ast MacroDef, _id: NodeId) -> Self::Result

source§

fn visit_path(&mut self, path: &'ast Path, _id: NodeId) -> Self::Result

source§

fn visit_use_tree( &mut self, use_tree: &'ast UseTree, id: NodeId, _nested: bool, ) -> Self::Result

source§

fn visit_generic_args( &mut self, generic_args: &'ast GenericArgs, ) -> Self::Result

source§

fn visit_vis(&mut self, vis: &'ast Visibility) -> Self::Result

source§

fn visit_fn_ret_ty(&mut self, ret_ty: &'ast FnRetTy) -> Self::Result

source§

fn visit_fn_header(&mut self, _header: &'ast FnHeader) -> Self::Result

source§

fn visit_expr_field(&mut self, f: &'ast ExprField) -> Self::Result

source§

fn visit_pat_field(&mut self, fp: &'ast PatField) -> Self::Result

source§

fn visit_crate(&mut self, krate: &'ast Crate) -> Self::Result

source§

fn visit_format_args(&mut self, fmt: &'ast FormatArgs) -> Self::Result

source§

fn visit_capture_by(&mut self, _capture_by: &'ast CaptureBy) -> Self::Result

Auto Trait Implementations§

§

impl<'a, 'b, 'ast, 'tcx> Freeze for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

§

impl<'a, 'b, 'ast, 'tcx> !RefUnwindSafe for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

§

impl<'a, 'b, 'ast, 'tcx> !Send for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

§

impl<'a, 'b, 'ast, 'tcx> !Sync for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

§

impl<'a, 'b, 'ast, 'tcx> Unpin for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

§

impl<'a, 'b, 'ast, 'tcx> !UnwindSafe for LateResolutionVisitor<'a, 'b, 'ast, 'tcx>

Blanket Implementations§

source§

impl<T> Aligned for T

source§

const ALIGN: Alignment = _

Alignment of Self.
source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, R> CollectAndApply<T, R> for T

source§

fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to f(&iter.collect::<Vec<_>>()).

source§

type Output = R

source§

impl<T> Filterable for T

source§

fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>

Creates a filterable data provider with the given name for debugging. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<P> IntoQueryParam<P> for P

source§

impl<T> MaybeResult<T> for T

source§

type Error = !

source§

fn from(_: Result<T, <T as MaybeResult<T>>::Error>) -> T

source§

fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

source§

fn upcast(self, interner: I) -> U

source§

impl<I, T> UpcastFrom<I, T> for T

source§

fn upcast_from(from: T, _tcx: I) -> T

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<Tcx, T> Value<Tcx> for T
where Tcx: DepContext,

source§

default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 336 bytes