Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest cargo add when installing library crate #11410

Merged
merged 1 commit into from Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cargo/ops/cargo_install.rs
Expand Up @@ -209,8 +209,8 @@ impl<'cfg, 'a> InstallablePackage<'cfg, 'a> {
bail!(
"there is nothing to install in `{}`, because it has no binaries\n\
`cargo install` is only for installing programs, and can't be used with libraries.\n\
To use a library crate, add it as a dependency in a Cargo project instead.",
pkg
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.",
pkg,
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/install.rs
Expand Up @@ -730,7 +730,7 @@ fn no_binaries() {
"\
[ERROR] there is nothing to install in `foo v0.0.1 ([..])`, because it has no binaries[..]
[..]
[..]",
To use a library crate, add it as a dependency to a Cargo project with `cargo add`.",
)
.run();
}
Expand Down