Skip to main content

RustResolver

Struct RustResolver 

Source
struct RustResolver<'r, 'a, 'g, 'n> {
    shared: &'r mut BindingResolver<'a, 'g, 'n>,
    memberships: BTreeMap<String, Arc<Membership>>,
    roots: BTreeMap<String, Arc<[RootCandidate]>>,
    root_memberships: BTreeMap<String, Arc<RootMembershipIndex>>,
    root_modules: BTreeMap<String, BTreeMap<String, Arc<BTreeMap<String, Vec<usize>>>>>,
    slots: BTreeMap<String, Slots>,
    queries: BTreeMap<Request, Arc<CallBindingResolution>>,
    ambiguous: u32,
    candidate_queries: BTreeMap<(String, *const [(usize, usize)], *const [usize], Option<String>), Arc<CallBindingResolution>>,
}
Expand description

Bounded query caches reuse the existing source capture and entity hydration.

Fields§

§shared: &'r mut BindingResolver<'a, 'g, 'n>

Shared operation authority and budgets.

§memberships: BTreeMap<String, Arc<Membership>>

Each source membership is checked once.

§roots: BTreeMap<String, Arc<[RootCandidate]>>

Actual manifest target candidates are collected once.

§root_memberships: BTreeMap<String, Arc<RootMembershipIndex>>

Source-free root path/cause buckets are built once per owning manifest.

§root_modules: BTreeMap<String, BTreeMap<String, Arc<BTreeMap<String, Vec<usize>>>>>

Source slots are inspected lazily, only in queried ancestor directories.

§slots: BTreeMap<String, Slots>

Module/value slots indexed once per required source.

§queries: BTreeMap<Request, Arc<CallBindingResolution>>

Identical calls share one complete result and cause set.

§ambiguous: u32

Competing slots observed in the current complete root query.

§candidate_queries: BTreeMap<(String, *const [(usize, usize)], *const [usize], Option<String>), Arc<CallBindingResolution>>

Repeated local import groups share merged namespace outcomes.

Implementations§

Source§

impl<'g> RustResolver<'_, '_, 'g, '_>

Source

fn charge(&mut self, bytes: u64) -> Result<(), CliError>

Account all additional caches under the operation’s existing memory boundary.

Source

fn with_scratch<T>( &mut self, operation: impl FnOnce(&mut Self, &mut ResolverScratch) -> Result<(T, u64), CliError>, ) -> Result<T, CliError>

Release temporary construction on every exit and charge the completed owner once.

Source

fn insert_cause( &mut self, causes: &mut CauseWorkspace<'_>, key: &CanonicalResolutionKey, ) -> Result<(), CliError>

Use the shared bounded cause owner for Rust-specific source traversal.

Source

fn cause( &mut self, path: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<bool, CliError>

Missing paths remain invalidation causes, without attempting to read them.

Source

fn insert_root( &mut self, scratch: &mut ResolverScratch, roots: &mut BTreeMap<String, bool>, path: String, certain: bool, ) -> Result<(), CliError>

Preserve root certainty while reserving each new owned path before insertion.

Source

fn source( &mut self, path: &str, ) -> Result<Option<Arc<BindingSource<'g>>>, CliError>

Index complete native ownership facts once, sharing source/module payloads.

Source

fn roots( &mut self, path: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<Arc<[RootCandidate]>, CliError>

Gather roots from the owning manifest and admitted default target inventory.

Source

fn root_membership_index( &mut self, path: &str, roots: Arc<[RootCandidate]>, ) -> Result<Arc<RootMembershipIndex>, CliError>

Bucket paths and negative causes without opening any candidate root source.

Source

fn root_directory_modules( &mut self, path: &str, index: &RootMembershipIndex, directory: &str, candidates: &RootDirectoryCandidates, ) -> Result<Arc<BTreeMap<String, Vec<usize>>>, CliError>

Recover module slots once per relevant directory, leaving other roots unopened.

Source

fn membership(&mut self, path: &str) -> Result<Arc<Membership>, CliError>

Prove membership through actual module declarations along a narrowed path.

Source

fn declared_module( &mut self, owner: &Module, name: &str, causes: &mut CauseWorkspace<'_>, ) -> Result<Option<Module>, CliError>

An external module requires one declaration and exactly one admitted layout.

Source

fn address( &mut self, owner: &Module, logical: &[String], causes: &mut CauseWorkspace<'_>, ) -> Result<Option<Module>, CliError>

Recover an actual containing module from its target root.

Source

fn resolve_candidates( &mut self, source: &str, facts: &SourceSemanticFacts, call: &SourceRustCallImports, ) -> Result<Arc<CallBindingResolution>, CliError>

Merge only candidates from the actual winning import-only lexical group.

Source

fn resolve( &mut self, request: Request, ) -> Result<Arc<CallBindingResolution>, CliError>

Resolve one complete call/import request and retain all failed-branch causes.

Source

fn import_target( &mut self, namespace: Option<Selection>, value: Option<Selection>, ) -> Result<Option<GraphEntity>, CliError>

Preserve external identities and exact dependency file owners independently.

Source

fn external(&self, identity: &str) -> Result<GraphEntity, CliError>

Create a content-free toolchain identity only from source or target-edition proof.

Source

fn path( &mut self, owner: &Module, path: &SourceRustPath, namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>

Resolve an explicit anchor before walking namespace members.

Source

fn select( &mut self, owner: &Module, parts: &[String], namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>

Preserve duplicate slots and terminate cycles without narrowing partial proof.

Source

fn select_inner( &mut self, owner: &Module, parts: &[String], namespace: Namespace, requester: &[String], causes: &mut CauseWorkspace<'_>, visited: &mut BTreeSet<(Module, Vec<String>, Namespace)>, depth: usize, ) -> Result<Option<Selection>, CliError>

One namespace step checks visibility and source-owned competing bindings.

Auto Trait Implementations§

§

impl<'r, 'a, 'g, 'n> !RefUnwindSafe for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> !Send for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> !Sync for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> !UnwindSafe for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> Freeze for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> Unpin for RustResolver<'r, 'a, 'g, 'n>

§

impl<'r, 'a, 'g, 'n> UnsafeUnpin for RustResolver<'r, 'a, 'g, 'n>

Blanket Implementations§

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<'a, T> FromIn<'a, T> for T

§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
§

impl<T> Instrument for T

§

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

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

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
§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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