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: PackageNameThe 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: SourceFilesThe 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.