Repository: clap-rs/clap (language: rust)

Issue:
Deprecated `arg_enum` depends on removed `_clap_count_exprs`
### Please complete the following tasks

- [X] I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
- [X] I have searched the [open](https://github.com/clap-rs/clap/issues) and [rejected](https://github.com/clap-rs/clap/issues?q=is%3Aissue+label%3AS-wont-fix+is%3Aclosed) issues

### Rust Version

rustc 1.60.0 (Fedora 1.60.0-1.fc35)

### Clap Version

3.1.17

### Minimal reproducible code

```rust
use clap::arg_enum;

arg_enum! {
    pub enum Column {
        A,
        B,
        C,
    }
}

fn main() {}
```


### Steps to reproduce the bug with the above code

```
cargo build
```

### Actual Behaviour

```
error[E0433]: failed to resolve: could not find `_clap_count_exprs` in `$crate`
 --> src/main.rs:3:1  |
3 | / arg_enum! {
4 | |     pub enum Column {
5 | |         A,
6 | |         B,
7 | |         C,
8 | |     }
9 | | }
  | |_^ could not find `_clap_count_exprs` in `$crate`
  |
  = note: this error originates in the macro `$crate::arg_enum` (in Nightly builds, run with -Z macro-backtrace for more info)
```

### Expected Behaviour

Code compiles.

### Additional Context

c8254918d60ff552d5e881a8e8391e3127299804 re-added `arg_enum`, which uses `_clap_count_exprs`, but in the meantime `_clap_count_exprs` had been removed by https://github.com/clap-rs/clap/pull/1970.

### Debug Output

Same as above.


Discussion / hints:

Fix patch:
diff --git a/src/macros.rs b/src/macros.rs
index 13921b1474a..f50b854959e 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -71,6 +71,15 @@ macro_rules! values_t_or_exit {
     };
 }
 
+#[deprecated(since = "3.0.0", note = "Replaced with `ArgEnum`")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! _clap_count_exprs {
+    () => { 0 };
+    ($e:expr) => { 1 };
+    ($e:expr, $($es:expr),+) => { 1 + $crate::_clap_count_exprs!($($es),*) };
+}
+
 /// Deprecated, replaced with [`ArgEnum`][crate::ArgEnum]
 #[deprecated(since = "3.0.0", note = "Replaced with `ArgEnum`")]
 #[doc(hidden)]


Test patch: