pub(crate) struct PathLoweringContext<'a, 'b, 'db> {
ctx: &'a mut TyLoweringContext<'db, 'b>,
on_diagnostic: PathDiagnosticCallback<'a, 'db>,
path: &'a Path,
segments: PathSegments<'a>,
current_segment_idx: usize,
current_or_prev_segment: PathSegment<'a>,
}Fields§
§ctx: &'a mut TyLoweringContext<'db, 'b>§on_diagnostic: PathDiagnosticCallback<'a, 'db>§path: &'a Path§segments: PathSegments<'a>§current_segment_idx: usize§current_or_prev_segment: PathSegment<'a>Contains the previous segment if current_segment_idx == segments.len()
Implementations§
Source§impl<'a, 'b, 'db> PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> PathLoweringContext<'a, 'b, 'db>
pub(crate) fn new( ctx: &'a mut TyLoweringContext<'db, 'b>, on_diagnostic: PathDiagnosticCallback<'a, 'db>, path: &'a Path, ) -> Self
pub(crate) fn expect_table(&mut self) -> &mut InferenceTable<'db>
fn on_diagnostic(&mut self, diag: PathLoweringDiagnostic)
pub(crate) fn ty_ctx(&mut self) -> &mut TyLoweringContext<'db, 'b>
fn current_segment_u32(&self) -> u32
fn skip_resolved_segment(&mut self)
fn update_current_segment(&mut self)
pub(crate) fn ignore_last_segment(&mut self)
pub(crate) fn set_current_segment(&mut self, segment: usize)
fn with_lifetime_elision<T>( &mut self, lifetime_elision: LifetimeElisionKind<'db>, f: impl FnOnce(&mut PathLoweringContext<'_, '_, 'db>) -> T, ) -> T
pub(crate) fn lower_ty_relative_path( &mut self, ty: Ty<'db>, res: Option<TypeNs>, infer_args: bool, span: Span, ) -> (Ty<'db>, Option<TypeNs>)
pub(crate) fn lower_partly_resolved_path( &mut self, resolution: TypeNs, infer_args: bool, span: Span, ) -> (Ty<'db>, Option<TypeNs>)
Sourcefn handle_type_ns_resolution(&mut self, resolution: &TypeNs) -> bool
fn handle_type_ns_resolution(&mut self, resolution: &TypeNs) -> bool
This returns whether to keep the resolution (true) of throw it (false).
pub(crate) fn resolve_path_in_type_ns_fully(&mut self) -> Option<TypeNs>
pub(crate) fn resolve_path_in_type_ns( &mut self, ) -> Option<(TypeNs, Option<usize>)>
pub(crate) fn resolve_path_in_value_ns( &mut self, hygiene_id: HygieneId, ) -> Option<ResolveValueResult>
fn select_associated_type( &mut self, res: Option<TypeNs>, infer_args: bool, span: Span, ) -> Ty<'db>
fn lower_path_inner( &mut self, typeable: TyDefId, infer_args: bool, span: Span, ) -> Ty<'db>
Sourcepub(crate) fn substs_from_path(
&mut self,
resolved: ValueTyDefId,
infer_args: bool,
lowering_assoc_type_generics: bool,
span: Span,
) -> GenericArgs<'db>
pub(crate) fn substs_from_path( &mut self, resolved: ValueTyDefId, infer_args: bool, lowering_assoc_type_generics: bool, span: Span, ) -> GenericArgs<'db>
Collect generic arguments from a path into a Substs. See also
create_substs_for_ast_path and def_to_ty in rustc.
pub(crate) fn substs_from_path_segment( &mut self, def: GenericDefId, infer_args: bool, explicit_self_ty: Option<Ty<'db>>, lowering_assoc_type_generics: bool, span: Span, ) -> GenericArgs<'db>
pub(super) fn substs_from_args_and_bindings( &mut self, args_and_bindings: Option<&HirGenericArgs>, def: GenericDefId, infer_args: bool, explicit_self_ty: Option<Ty<'db>>, generics_source: PathGenericsSource, lowering_assoc_type_generics: bool, lifetime_elision: LifetimeElisionKind<'db>, span: Span, ) -> GenericArgs<'db>
pub(crate) fn lower_trait_ref_from_resolved_path( &mut self, resolved: TraitId, explicit_self_ty: Ty<'db>, infer_args: bool, span: Span, ) -> TraitRef<'db>
fn trait_ref_substs_from_path( &mut self, resolved: TraitId, explicit_self_ty: Ty<'db>, infer_args: bool, span: Span, ) -> GenericArgs<'db>
pub(super) fn assoc_type_bindings_from_type_bound( self, trait_ref: TraitRef<'db>, span: Span, ) -> Option<impl Iterator<Item = (Clause<'db>, GenericPredicateSource)> + use<'a, 'b, 'db>>
pub(crate) fn interner(&self) -> DbInterner<'db>
Auto Trait Implementations§
impl<'a, 'b, 'db> Freeze for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> !RefUnwindSafe for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> !Send for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> !Sync for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> Unpin for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> UnsafeUnpin for PathLoweringContext<'a, 'b, 'db>
impl<'a, 'b, 'db> !UnwindSafe for PathLoweringContext<'a, 'b, 'db>
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
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more