@@ -706,14 +706,20 @@ impl CheckAttrVisitor<'_> {
706706 true
707707 }
708708
709- fn check_doc_tuple_variadic ( & self , meta : & NestedMetaItem , hir_id : HirId ) -> bool {
709+ fn check_doc_fake_variadic ( & self , meta : & NestedMetaItem , hir_id : HirId ) -> bool {
710710 match self . tcx . hir ( ) . find ( hir_id) . and_then ( |node| match node {
711711 hir:: Node :: Item ( item) => Some ( & item. kind ) ,
712712 _ => None ,
713713 } ) {
714714 Some ( ItemKind :: Impl ( ref i) ) => {
715- if !matches ! ( & i. self_ty. kind, hir:: TyKind :: Tup ( [ _] ) ) {
716- self . tcx . sess . emit_err ( errors:: DocTupleVariadicNotFirst { span : meta. span ( ) } ) ;
715+ let is_valid = matches ! ( & i. self_ty. kind, hir:: TyKind :: Tup ( [ _] ) )
716+ || if let hir:: TyKind :: BareFn ( bare_fn_ty) = & i. self_ty . kind {
717+ bare_fn_ty. decl . inputs . len ( ) == 1
718+ } else {
719+ false
720+ } ;
721+ if !is_valid {
722+ self . tcx . sess . emit_err ( errors:: DocFakeVariadicNotValid { span : meta. span ( ) } ) ;
717723 return false ;
718724 }
719725 }
@@ -887,9 +893,9 @@ impl CheckAttrVisitor<'_> {
887893 is_valid = false
888894 }
889895
890- sym:: tuple_variadic
891- if !self . check_attr_not_crate_level ( meta, hir_id, "tuple_variadic " )
892- || !self . check_doc_tuple_variadic ( meta, hir_id) =>
896+ sym:: fake_variadic
897+ if !self . check_attr_not_crate_level ( meta, hir_id, "fake_variadic " )
898+ || !self . check_doc_fake_variadic ( meta, hir_id) =>
893899 {
894900 is_valid = false
895901 }
@@ -939,7 +945,7 @@ impl CheckAttrVisitor<'_> {
939945 | sym:: notable_trait
940946 | sym:: passes
941947 | sym:: plugins
942- | sym:: tuple_variadic => { }
948+ | sym:: fake_variadic => { }
943949
944950 sym:: test => {
945951 if !self . check_test_attr ( meta, hir_id) {
0 commit comments