rustc_resolve::late

Struct LateResolutionVisitor

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

Fields§

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

The module that represents the current item scope.

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

The current set of local scopes for types and values.

§last_block_rib: Option<Rib<'ra>>

Previous popped rib, only used for diagnostic.

§label_ribs: Vec<Rib<'ra, 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<'ra>, 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<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, '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, FxHashSet<String>, 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, suggested_candidates: FxHashSet<String>, ) -> 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 explain_functions_in_pattern( &mut self, err: &mut Diag<'_>, res: Option<Res<NodeId>>, source: PathSource<'_>, )

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<'ra>, 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, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx>

Source

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

Source

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

Source

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

Source

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

Source

fn with_rib<T>( &mut self, ns: Namespace, kind: RibKind<'ra>, 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, id_for_lint: NodeId, 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<'ra>>

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<'ra>, lifetime_kind: LifetimeRibKind, f: F, )
where F: FnOnce(&mut Self),

Source

fn with_label_rib(&mut self, kind: RibKind<'ra>, 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<'ra>)

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<'ra>>>

Source

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

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 legacy_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 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<'ra: 'ast, 'ast, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'ra, '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: &'ast 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_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, 'ast, 'ra, 'tcx> !DynSend for LateResolutionVisitor<'a, 'ast, 'ra, 'tcx>

§

impl<'a, 'ast, 'ra, 'tcx> !DynSync for LateResolutionVisitor<'a, 'ast, 'ra, 'tcx>

§

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

§

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

§

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

§

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

§

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

§

impl<'a, 'ast, 'ra, 'tcx> !UnwindSafe for LateResolutionVisitor<'a, 'ast, 'ra, '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
§

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

§

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<_>>()).

§

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> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

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

§

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

§

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

§

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

§

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

§

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,

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