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(
284284 . filter ( |& ( d, _) | d < 4 )
285285 . collect ( ) ;
286286 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+
290296 // If dependency package name is equal to the name of the candidate here
291297 // it may be a prerelease package which hasn't been specified correctly
292298 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() {
14401440 . with_status ( 101 )
14411441 . with_stderr (
14421442 "\
1443- error: no matching package named `a` found
1443+ error: no matching package found
1444+ searched package name: `a`
14441445prerelease package needs to be specified explicitly
14451446a = { version = \" 0.1.1-alpha.0\" }
14461447location searched: [..]
You can’t perform that action at this time.
0 commit comments