Skip to main content

CodeResolveError

Enum CodeResolveError 

Source
#[non_exhaustive]
pub enum CodeResolveError {
Show 14 variants UnknownItem(ItemId), UnknownImpl(ImplId), OutsideItem(ItemId, usize), MissingContext(ItemId), ExpectedModule(ItemId), MacroDefinition(ItemId), Resolve(ResolveError), Exports(Box<ExportError>), ConfiguredSyntax(Box<LoadError>), Query(Box<LoadError>), MethodApplicability(ItemId), AliasMember { alias: ItemId, member: String, reason: &'static str, }, SyntaxContext { target: TargetId, file: RelPath, reason: &'static str, }, NotExported { root: ItemId, path: String, },
}
Expand description

Failure to establish a reading context or resolve its module-level code path.

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.
§

UnknownItem(ItemId)

The load-local owner is absent from this workspace.

§

UnknownImpl(ImplId)

The load-local impl is absent from this workspace.

§

OutsideItem(ItemId, usize)

The byte is outside the selected item’s source span.

§

MissingContext(ItemId)

An indexed owner has no source-owned reading module.

§

ExpectedModule(ItemId)

A definition-scope query names an item that is not a module.

§

MacroDefinition(ItemId)

Macro definition tokens require invocation context before name resolution.

§

Resolve(ResolveError)

The shared resolver refused the path; its original cause is retained.

§

Exports(Box<ExportError>)

The library’s public surface refused its original resource or resolution query.

§

ConfiguredSyntax(Box<LoadError>)

Configured syntax selection preserves its original parser/load refusal.

§

Query(Box<LoadError>)

The bounded code query preserves its original resource refusal.

§

MethodApplicability(ItemId)

Generic applicability of this inherent method is not established.

§

AliasMember

Alias-member applicability is outside the explicitly supported syntax.

Fields

§alias: ItemId

The actual alias definition needing additional evidence.

§member: String

The requested associated member.

§reason: &'static str

The missing applicability evidence.

§

SyntaxContext

A configured syntax query lacks an actual admitted target/file context.

Fields

§target: TargetId

The requested actual target.

§file: RelPath

The requested source file.

§reason: &'static str

The missing context that the caller must supply.

§

NotExported

A definition exists but is not exported by the selected library.

Fields

§root: ItemId

The selected actual library root.

§path: String

The requested relative API path.

Trait Implementations§

Source§

impl Debug for CodeResolveError

Source§

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

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

impl Display for CodeResolveError

Source§

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

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

impl Error for CodeResolveError

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

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> 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> 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.