@@ -895,21 +895,29 @@ impl PubGrubReportFormatter<'_> {
895
895
// Add hints due to the package being available on an index, but not at the correct version,
896
896
// with subsequent indexes that were _not_ queried.
897
897
if matches ! ( selector. index_strategy( ) , IndexStrategy :: FirstIndex ) {
898
- if let Some ( found_index) = available_indexes. get ( name) . and_then ( BTreeSet :: first) {
899
- // Determine whether the index is the last-available index. If not, then some
900
- // indexes were not queried, and could contain a compatible version.
901
- if let Some ( next_index) = index_locations
902
- . indexes ( )
903
- . map ( Index :: url)
904
- . skip_while ( |url| * url != found_index)
905
- . nth ( 1 )
906
- {
907
- hints. insert ( PubGrubHint :: UncheckedIndex {
908
- name : name. clone ( ) ,
909
- range : set. clone ( ) ,
910
- found_index : found_index. clone ( ) ,
911
- next_index : next_index. clone ( ) ,
912
- } ) ;
898
+ // Do not include the hint if the set is "all versions". This is an unusual but valid
899
+ // case in which a package returns a 200 response, but without any versions or
900
+ // distributions for the package.
901
+ if !set
902
+ . iter ( )
903
+ . all ( |range| matches ! ( range, ( Bound :: Unbounded , Bound :: Unbounded ) ) )
904
+ {
905
+ if let Some ( found_index) = available_indexes. get ( name) . and_then ( BTreeSet :: first) {
906
+ // Determine whether the index is the last-available index. If not, then some
907
+ // indexes were not queried, and could contain a compatible version.
908
+ if let Some ( next_index) = index_locations
909
+ . indexes ( )
910
+ . map ( Index :: url)
911
+ . skip_while ( |url| * url != found_index)
912
+ . nth ( 1 )
913
+ {
914
+ hints. insert ( PubGrubHint :: UncheckedIndex {
915
+ name : name. clone ( ) ,
916
+ range : set. clone ( ) ,
917
+ found_index : found_index. clone ( ) ,
918
+ next_index : next_index. clone ( ) ,
919
+ } ) ;
920
+ }
913
921
}
914
922
}
915
923
}
0 commit comments