Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(clap_derive): Unwrap
syn::TypeGroup
when checking field types
Due to macro expansions, a `syn` type may be wrapped in multiple 'layers' of `syn::Type::Group`. However, `clap_derive` currently does not check for `syn::Type::Group`, which will cause an `Option` (along with other matched types) to fail to be detected when it results from a macro expansion. This commit 'unwraps' outer type groups before checking the user-provided types against well-known types. Currently, these groups may not be present due to a rustc bug (rust-lang/rust#43081) However, once rust-lang/rust#73084 is merged, these groups will be present in more cases. This commit makes `clap` compatible with both older and newer versions of rustc.
- Loading branch information