File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -284,9 +284,15 @@ pub(super) fn activation_error(
284
284
. filter ( |& ( d, _) | d < 4 )
285
285
. collect ( ) ;
286
286
candidates. sort_by_key ( |o| o. 0 ) ;
287
- let mut msg = format ! (
288
- "no matching package found\n searched package name: `{}`\n " , dep. package_name( ) ) ;
289
- if !candidates. is_empty ( ) {
287
+ let mut msg: String ;
288
+ if candidates. is_empty ( ) {
289
+ msg = format ! ( "no matching package named `{}` found\n " , dep. package_name( ) ) ;
290
+ } else {
291
+ msg = format ! (
292
+ "no matching package found\n searched package name: `{}`\n " ,
293
+ dep. package_name( )
294
+ ) ;
295
+
290
296
// If dependency package name is equal to the name of the candidate here
291
297
// it may be a prerelease package which hasn't been specified correctly
292
298
if dep. package_name ( ) == candidates[ 0 ] . 1 . name ( )
Original file line number Diff line number Diff line change @@ -1440,7 +1440,8 @@ fn use_semver_package_incorrectly() {
1440
1440
. with_status ( 101 )
1441
1441
. with_stderr (
1442
1442
"\
1443
- error: no matching package named `a` found
1443
+ error: no matching package found
1444
+ searched package name: `a`
1444
1445
prerelease package needs to be specified explicitly
1445
1446
a = { version = \" 0.1.1-alpha.0\" }
1446
1447
location searched: [..]
You can’t perform that action at this time.
0 commit comments