diff --git a/noexcept-impl/src/lib.rs b/noexcept-impl/src/lib.rs index a7c88a1..0a7e0a8 100644 --- a/noexcept-impl/src/lib.rs +++ b/noexcept-impl/src/lib.rs @@ -44,6 +44,7 @@ fn parse(args: TokenStream2, input: TokenStream2) -> Result { // Convert `Path` to `Path<_>` fn make_impl_trait_wild(ret: &mut Type) { match ret { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] Type::ImplTrait(impl_trait) => { *ret = Type::Infer(TypeInfer { underscore_token: Token![_](impl_trait.impl_token.span), @@ -65,7 +66,6 @@ fn make_impl_trait_wild(ret: &mut Type) { } Type::Tuple(ret) => ret.elems.iter_mut().for_each(make_impl_trait_wild), Type::BareFn(_) | Type::Infer(_) | Type::Macro(_) | Type::Never(_) | Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } } diff --git a/src/lib.rs b/src/lib.rs index cb0bb4d..c980abc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,6 +165,7 @@ fn parse(args: TokenStream2, input: TokenStream2) -> Result { // Convert `Path` to `Path<_>` fn make_impl_trait_wild(ret: &mut Type) { match ret { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] Type::ImplTrait(impl_trait) => { *ret = Type::Infer(TypeInfer { underscore_token: Token![_](impl_trait.impl_token.span), @@ -186,7 +187,6 @@ fn make_impl_trait_wild(ret: &mut Type) { } Type::Tuple(ret) => ret.elems.iter_mut().for_each(make_impl_trait_wild), Type::BareFn(_) | Type::Infer(_) | Type::Macro(_) | Type::Never(_) | Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] _ => {} } }