Skip to main content

unresolved_package_alias

Function unresolved_package_alias 

Source
pub fn unresolved_package_alias(
    current_file: &Path,
    import_path: &str,
) -> Option<String>
Expand description

The package alias a failed import names, when only an installed package could ever have resolved it.

A bare specifier that no package provides is joined onto the importing file’s directory by every fallback in this crate, so the path a reader is finally shown is a guess assembled from the relative traversal of the whole import chain. It names a file that does not exist and never could, and it points at the pipeline tree rather than at the uninstalled dependency. This hands the error site the one fact that explains it.

resolve_local_import remains the owner of the classification, so a sibling file or a standard-library module can never be reported as a missing package.