File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,12 @@ fn install_one(
305
305
// *something* to install. Explicit `--bin` or `--example` flags will be
306
306
// checked at the start of `compile_ws`.
307
307
if !opts. filter . is_specific ( ) && !pkg. targets ( ) . iter ( ) . any ( |t| t. is_bin ( ) ) {
308
- bail ! ( "specified package `{}` has no binaries" , pkg) ;
308
+ bail ! (
309
+ "there is nothing to install in `{}`, because it has no binaries\n \
310
+ `cargo install` is only for installing programs, and can't be used with libraries.\n \
311
+ To use a library crate, add it as a dependency in a Cargo project instead.",
312
+ pkg
313
+ ) ;
309
314
}
310
315
311
316
// Helper for --no-track flag to make sure it doesn't overwrite anything.
Original file line number Diff line number Diff line change @@ -567,8 +567,9 @@ fn no_binaries() {
567
567
. with_status ( 101 )
568
568
. with_stderr (
569
569
"\
570
- [ERROR] specified package `foo v0.0.1 ([..])` has no binaries
571
- " ,
570
+ [ERROR] there is nothing to install in `foo v0.0.1 ([..])`, because it has no binaries[..]
571
+ [..]
572
+ [..]" ,
572
573
)
573
574
. run ( ) ;
574
575
}
You can’t perform that action at this time.
0 commit comments