#[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
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
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
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
Storage
A query’s native scratch allocation failed for a reason other than a configured budget. The original failure is retained for diagnosis.
Trait Implementations§
Source§impl Clone for ResolveError
impl Clone for ResolveError
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
impl Eq for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ResolveError
impl PartialEq for ResolveError
impl StructuralPartialEq for ResolveError
Auto Trait Implementations§
impl Forget for ResolveError
impl Freeze for ResolveError
impl Move for ResolveError
impl RefUnwindSafe for ResolveError
impl Send for ResolveError
impl Sync for ResolveError
impl Unpin for ResolveError
impl UnsafeUnpin for ResolveError
impl UnwindSafe for ResolveError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> ErrorExt for T
impl<T> ErrorExt for T
Source§fn raise_typed(self) -> Exn<Self>where
Self: Sized,
fn raise_typed(self) -> Exn<Self>where
Self: Sized,
Self even when it is already an Error.Source§fn and_raise_typed<T>(self, context: T) -> Exn<T>
fn and_raise_typed<T>(self, context: T) -> Exn<T>
Self::and_raise(), retaining the context’s type in an exception.Source§fn raise_erased(self) -> Exnwhere
Self: Sized,
fn raise_erased(self) -> Exnwhere
Self: Sized,
crate::Error values reuse their existing frame and caller location.impl<T> EvidenceLease for T
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> ⓘ
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> ⓘ
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