@@ -541,7 +541,7 @@ impl<'a, 'b> Context<'a, 'b> {
541541 ) {
542542 match c {
543543 parse:: CountImplied | parse:: CountIs ( ..) => { }
544- parse:: CountIsParam ( i) => {
544+ parse:: CountIsParam ( i) | parse :: CountIsStar ( i ) => {
545545 self . unused_names_lint . maybe_add_positional_named_arg (
546546 self . args . get ( i) ,
547547 named_arg_type,
@@ -589,7 +589,7 @@ impl<'a, 'b> Context<'a, 'b> {
589589 + self
590590 . arg_with_formatting
591591 . iter ( )
592- . filter ( |fmt| matches ! ( fmt. precision, parse:: CountIsParam ( _) ) )
592+ . filter ( |fmt| matches ! ( fmt. precision, parse:: CountIsStar ( _) ) )
593593 . count ( ) ;
594594 if self . names . is_empty ( ) && !numbered_position_args && count != self . num_args ( ) {
595595 e = self . ecx . struct_span_err (
@@ -639,7 +639,7 @@ impl<'a, 'b> Context<'a, 'b> {
639639 if let Some ( span) = fmt. precision_span {
640640 let span = self . fmtsp . from_inner ( InnerSpan :: new ( span. start , span. end ) ) ;
641641 match fmt. precision {
642- parse:: CountIsParam ( pos) if pos > self . num_args ( ) => {
642+ parse:: CountIsParam ( pos) if pos >= self . num_args ( ) => {
643643 e. span_label (
644644 span,
645645 & format ! (
@@ -651,12 +651,12 @@ impl<'a, 'b> Context<'a, 'b> {
651651 ) ;
652652 zero_based_note = true ;
653653 }
654- parse:: CountIsParam ( pos) => {
654+ parse:: CountIsStar ( pos) => {
655655 let count = self . pieces . len ( )
656656 + self
657657 . arg_with_formatting
658658 . iter ( )
659- . filter ( |fmt| matches ! ( fmt. precision, parse:: CountIsParam ( _) ) )
659+ . filter ( |fmt| matches ! ( fmt. precision, parse:: CountIsStar ( _) ) )
660660 . count ( ) ;
661661 e. span_label (
662662 span,
@@ -837,7 +837,7 @@ impl<'a, 'b> Context<'a, 'b> {
837837 } ;
838838 match c {
839839 parse:: CountIs ( i) => count ( sym:: Is , Some ( self . ecx . expr_usize ( sp, i) ) ) ,
840- parse:: CountIsParam ( i) => {
840+ parse:: CountIsParam ( i) | parse :: CountIsStar ( i ) => {
841841 // This needs mapping too, as `i` is referring to a macro
842842 // argument. If `i` is not found in `count_positions` then
843843 // the error had already been emitted elsewhere.
0 commit comments