Skip to main content

ResolveError

Enum ResolveError 

Source
#[non_exhaustive]
pub enum ResolveError {
Show 15 variants NotFound(String), Ambiguous(Vec<ItemId>), Cyclic(String), IndeterminateImport { path: String, file: RelPath, line: usize, }, Invalid(String), UnresolvedSelf(String), UnknownPackage(String), AmbiguousPackageName(String), UnknownPackageId(PackageId), UnconfiguredPackage(PackageId), UnconfiguredDefinition(ItemId), UnknownModule(String), UnresolvedGlob { path: String, glob: String, module: String, }, Budget { budget: Budget, limit: usize, file: RelPath, line: Option<usize>, }, Storage { file: RelPath, line: Option<usize>, what: String, },
}
Expand description

Why a path did not resolve.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NotFound(String)

Nothing the workspace defines has this path. A dependency item, a macro expansion and a misspelling all end here.

§

Ambiguous(Vec<ItemId>)

The path names more than one symbol: two globs that bring in different items, two imports of one name, two canonical targets, items of two targets at one path, a crate path that targets of several packages share, or a path through a crate name that stands for several libraries (the ids are then the crate roots).

§

Cyclic(String)

The imports that the path goes through depend on each other.

§

IndeterminateImport

An import initially found an inaccessible binding, then a later glob route made its path accessible. A settled lookup can read that path, but the earlier import cannot acquire the late binding.

Fields

§path: String

The path the caller tried to resolve.

§file: RelPath

The source file of the import that could not be determined.

§line: usize

Its one-based source line.

§

Invalid(String)

The text is not a path.

§

UnresolvedSelf(String)

Nothing the workspace defines has this path, and the path goes through the self type of an inherent impl that the index cannot see (see SelfType::Unresolved), which may define it.

§

UnknownPackage(String)

The package named to qualify the path is not a package of the workspace.

§

AmbiguousPackageName(String)

Several loaded packages have the requested display name. Select a load-local package identity instead.

§

UnknownPackageId(PackageId)

The package identity does not exist in this workspace.

§

UnconfiguredPackage(PackageId)

The package has only a structural index, without a declared active context.

§

UnconfiguredDefinition(ItemId)

A resolved site has no admitted active definition context.

§

UnknownModule(String)

The module named to read a use path from is not a module of the workspace.

§

UnresolvedGlob

A lookup on the way of the path reads the names a glob import brings in, and the glob’s path names nothing in the workspace past its first segment (use self::missing::*;, use crate::a::gone::*;). rustc refuses such a glob, so what the lookup would find is not known. The load does not fail for it: a module that a macro generates is globbed this way. A glob whose first segment names nothing in the workspace, as a dependency does, is not one: the index cannot look into it.

Fields

§path: String

The path that was resolved.

§glob: String

The written path of the glob, without its ::*.

§module: String

The path of the module that declares the glob.

§

Budget

The query passed its lookup/proof work or transient proof-byte limit. Lookup and proof work share the limit of the work of one query, LoadOptions::max_query_work: the glob reads its lookups of what the globs of a module bring in looked at, and the views that hold a name looked at to find them, counted from zero for each query. The answer is not given. This is the refusal a load gets from the same budget, LoadErrorKind::Budget: budget is Budget::Work, Budget::ItemBytes or Budget::GlobBytes, limit the limit that applied, and file and line name the declaration of the module whose lookup passed it.

Fields

§budget: Budget

The work, item-byte or glob-byte budget passed.

§limit: usize

The limit that applied.

§file: RelPath

The file of the declaration of the module whose lookup passed it.

§line: Option<usize>

The line of that declaration, when it has one.

§

Storage

A query’s native scratch allocation failed for a reason other than a configured budget. The original failure is retained for diagnosis.

Fields

§file: RelPath

The source file of the binding being checked.

§line: Option<usize>

Its source line, when known.

§what: String

The allocation failure.

Trait Implementations§

Source§

impl Clone for ResolveError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResolveError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ResolveError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ResolveError

Source§

impl Error for ResolveError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for ResolveError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolveError

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Whether this borrowed key equals the stored key.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErrorExt for T
where T: Error + Send + Sync + 'static,

Source§

fn raise(self) -> Error
where Self: Sized,

Raise this error at the caller’s location, returning a public Error. An existing Error is returned unchanged, preserving its representation and allocation.
Source§

fn raise_typed(self) -> Exn<Self>
where Self: Sized,

Raise this error as a typed exception, retaining Self even when it is already an Error.
Source§

fn and_raise<T>(self, context: T) -> Error
where T: Error + Send + Sync + 'static, Self: Sized,

Raise this error as a cause of context, returning a public Error. Read more
Source§

fn and_raise_typed<T>(self, context: T) -> Exn<T>
where T: Error + Send + Sync + 'static, Self: Sized,

Like Self::and_raise(), retaining the context’s type in an exception.
Source§

fn raise_erased(self) -> Exn
where Self: Sized,

Raise this error as a new exception, with type erasure. Tree-backed crate::Error values reuse their existing frame and caller location.
Source§

fn raise_all<T, I>(self, sources: I) -> Exn<Self>
where Self: Sized, T: Error + Send + Sync + 'static, I: IntoIterator, <I as IntoIterator>::Item: Into<Exn<T>>,

Raise this error as a new exception, with sources as causes.
Source§

impl<T> EvidenceLease for T
where T: Debug + Send + Sync,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.