Skip to main content

LinkDiagnostics

Enum LinkDiagnostics 

Source
#[non_exhaustive]
pub enum LinkDiagnostics { MissingLean { tried: Vec<String>, }, MissingHeader { path: PathBuf, }, MissingLib { name: String, search_dirs: Vec<PathBuf>, }, VersionMismatch { expected: String, actual: String, }, AllowlistFailure { name: &'static str, }, FixtureArtifactMissing { path: PathBuf, recovery: &'static str, }, UnsupportedToolchain { active: String, supported_window: String, }, LakeTargetMissing { project_root: PathBuf, target_name: String, }, LakeUnavailable { project_root: PathBuf, target_name: String, detail: String, }, LakeBuildFailed { project_root: PathBuf, target_name: String, status: String, detail: String, }, LakeOutputUnresolved { project_root: PathBuf, target_name: String, reason: String, }, }
Expand description

Reasons the Lean toolchain or its linkage could not be resolved.

Variants carry enough context to produce a single actionable diagnostic. The enum is #[non_exhaustive] — adding a new failure mode is not a breaking change.

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

MissingLean

No discovery probe could locate a Lean prefix containing include/lean/lean.h.

Fields

§tried: Vec<String>

One human-readable line per probe attempted, in precedence order.

§

MissingHeader

A discovered prefix is missing the expected header file.

Fields

§path: PathBuf

Where the header was expected to live.

§

MissingLib

A required Lean library was not found in any search directory.

Fields

§name: String

Library name as it would appear in -l<name>.

§search_dirs: Vec<PathBuf>

Directories searched, in order.

§

VersionMismatch

The discovered Lean version disagrees with the build-baked one.

Fields

§expected: String

Version this build of lean-toolchain was compiled against.

§actual: String

Version reported by the active toolchain at runtime.

§

AllowlistFailure

A symbol in the required-symbols allowlist failed to resolve.

Fields

§name: &'static str

Name of the missing symbol.

§

FixtureArtifactMissing

A built Lake fixture artifact is missing.

Fields

§path: PathBuf

Path to the missing artifact.

§recovery: &'static str

One-liner recovery command for the embedder.

§

UnsupportedToolchain

The active Lean toolchain is outside the supported window declared by lean_rs_sys::SUPPORTED_TOOLCHAINS.

Fields

§active: String

LEAN_VERSION_STRING of the active toolchain.

§supported_window: String

Comma-joined versions arrays from each SupportedToolchain entry, rendered as ["4.23.0", "4.24.0", "4.24.1"], ["4.25.0", ...], ....

§

LakeTargetMissing

The requested Lake target was not declared in the project’s lakefile.

Fields

§project_root: PathBuf

Directory expected to contain the project’s lakefile.

§target_name: String

Requested Lake target name.

§

LakeUnavailable

The lake executable could not be started.

Fields

§project_root: PathBuf

Directory where the Lake command would have run.

§target_name: String

Requested Lake target name.

§detail: String

One-line process-spawn failure.

§

LakeBuildFailed

lake build <target>:shared exited unsuccessfully.

Fields

§project_root: PathBuf

Directory where the Lake command ran.

§target_name: String

Requested Lake target name.

§status: String

Process exit status rendered for diagnostics.

§detail: String

Bounded one-line stdout/stderr summary from Lake.

§

LakeOutputUnresolved

Lake completed, but lean-toolchain could not resolve the expected dylib path.

Fields

§project_root: PathBuf

Directory expected to contain the Lake project.

§target_name: String

Requested Lake target name.

§reason: String

One-line reason, including the path or manifest field that was missing.

Trait Implementations§

Source§

impl Debug for LinkDiagnostics

Source§

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

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

impl Display for LinkDiagnostics

Source§

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

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

impl Error for LinkDiagnostics

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

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