Skip to main content

CheckInfo

Struct CheckInfo 

Source
pub struct CheckInfo {
    pub errors: Vec<String>,
    pub warnings: Vec<String>,
    pub deps: Vec<PathBuf>,
    pub lints: Vec<String>,
    pub requires: Vec<RequireSite>,
    pub error_fixes: Vec<Option<Fix>>,
    pub lint_fixes: Vec<Option<Fix>>,
    pub dependency_errors: Vec<DependencyError>,
}
Expand description

Result of type-checking one .tl file.

Fields§

§errors: Vec<String>

file:line:col: message for syntax and type errors.

§warnings: Vec<String>

file:line:col: message for warnings (non-fatal).

§deps: Vec<PathBuf>

Files pulled in via require during checking (.tl / .d.tl / .lua).

§lints: Vec<String>

htl lint findings (nil-index, enum-exhaustive). Advisory unless the caller promotes them (htl check --strict, include_tl!).

§requires: Vec<RequireSite>

Every require("<literal>") in the file and where the checker resolved it. Input to require_cycles.

§error_fixes: Vec<Option<Fix>>

error_fixes[i] is the fix for errors[i], when the error has one.

§lint_fixes: Vec<Option<Fix>>

lint_fixes[i] is the fix for lints[i], when the lint has one.

§dependency_errors: Vec<DependencyError>

Type errors in the modules this check pulled in through require, transitively, each dependency once. Not in errors, and not what ok answers: the file itself checked, and generates; it is the require of that module that will raise at run time (Htl::install_searcher), which is why a caller reporting on a project treats these as errors too (htl check, include_tl!).

Implementations§

Source§

impl CheckInfo

Source

pub fn ok(&self) -> bool

true when nothing failed the check — errors only. Warnings and lints are the caller’s to promote (clean is the stricter question), so this is what decides whether generated code may be run.

Source

pub fn clean(&self) -> bool

true when there are no errors, warnings or lints.

Source

pub fn diagnostics(&self) -> Vec<Diagnostic>

Everything this check found about the file itself, structured, in the order the text output says it: warnings, then lints, then errors.

Errors in what the file required are not here — they belong to the module they are in, and it is the reporting caller that decides how to say them (dependency_errors).

Source

pub fn error_diagnostics(&self) -> Vec<Diagnostic>

errors with their positions and their fixes.

Source

pub fn warning_diagnostics(&self) -> Vec<Diagnostic>

warnings with their positions. Warnings carry no fix.

Source

pub fn lint_diagnostics(&self) -> Vec<Diagnostic>

lints with their positions, their rule names and their fixes.

Trait Implementations§

Source§

impl Clone for CheckInfo

Source§

fn clone(&self) -> CheckInfo

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 CheckInfo

Source§

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

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

impl Default for CheckInfo

Source§

fn default() -> CheckInfo

Returns the “default value” for a type. 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> 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<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> MaybeSend for T

Source§

impl<T> MaybeSync for T

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