target_path_not_found_error_message in cargo::util::toml::targets - Rust
Description: Build an error message for a target path that cannot be determined either by auto-discovery or specifying.

Skip to main content

## target_path_not_found_error_message

# Function target_path_not_found_error_message

Source

    fn target_path_not_found_error_message(
        package_root: &Path,
        target: &TomlTarget,
        target_kind: &str,
        inferred: &[(String, PathBuf)],
    ) -> String

Expand description

Build an error message for a target path that cannot be determined either by auto-discovery or specifying.

This function tries to detect commonly wrong paths for targets:

test -> tests/.rs, tests//main.rs bench -> benches/.rs, benches//main.rs example -> examples/.rs, examples//main.rs bin -> src/bin/.rs, src/bin//main.rs

Note that the logic need to sync with `infer_from_directory` if changes.