Skip to main content

PackageCheck

Struct PackageCheck 

Source
pub struct PackageCheck {
    pub package: PackageName,
    pub errors: Vec<CompilationError>,
    pub sources: SourceFiles,
    pub modules: Vec<CheckedSource>,
    pub test_dependency_modules: Vec<CheckedSource>,
    pub test_modules: Vec<CheckedSource>,
    pub failing: Vec<CheckedSource>,
    pub status: Vec<Status>,
}
Expand description

What check_package found: everything a build needs to emit, and everything that went wrong, with nothing printed and nothing written.

Fields§

§package: PackageName

The package the check was pointed at.

§errors: Vec<CompilationError>

Every error the check accumulated, across every package of the build. Empty means the build checked. Each renders through CompilationError::as_diagnostic, whose labels index into sources.

§sources: SourceFiles

The one file database of the build: every file of every package that was read, which is what every SourceFileId in errors and in the modules below indexes into.

§modules: Vec<CheckedSource>

Every module that checked of every package the plain build holds — the root’s src/ and its dependencies, direct or not — dependencies first. A package whose own src/ was checked and reported an error in it contributes none of its modules here: the ones it built a tree for are in failing. A package that was never checked, because a dependency did not compile, its sources could not be read or two of its modules claim one name, has its modules in no list at all. An error from the package’s main alone (program has the check) leaves its modules here.

§test_dependency_modules: Vec<CheckedSource>

Every module that checked of every package the build reaches through the root’s test-dependencies alone. Empty unless the tests were checked (check_package_with_tests).

§test_modules: Vec<CheckedSource>

Every module of the root’s tests/ that checked. Empty unless the tests were checked, and unless the root’s src/ checked.

§failing: Vec<CheckedSource>

Every module the check built a tree for and put in none of modules, test_dependency_modules and test_modules: each module of a package whose own src/ was checked and reported an error, whether or not the module has an error of its own, and each module of the root’s tests/ that came back with errors. A module of a package that was not checked at all is in none of them, for the reasons modules lists.

They are for a reader that wants the typed tree of a file with errors in it, such as an editor, and never for a backend: an emitting build reads the three lists above, and an IR built here lists every declaration canonicalization recorded as broken or the typer rejected in ir::Module::unchecked, which no backend emits (DEC-23 decision 5).

§status: Vec<Status>

The status lines of the check, in order.

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