Skip to content

Commit

Permalink
Merge pull request #53 from dtolnay/exhaustive
Browse files Browse the repository at this point in the history
Pick up changes to non_exhaustive_omitted_patterns lint
  • Loading branch information
dtolnay authored Jan 4, 2024
2 parents cff8b5b + 5c5e3a5 commit 5f2f9b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion noexcept-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn parse(args: TokenStream2, input: TokenStream2) -> Result<ItemFn> {
// Convert `Path<impl Trait>` 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),
Expand All @@ -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))]
_ => {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ fn parse(args: TokenStream2, input: TokenStream2) -> Result<ItemFn> {
// Convert `Path<impl Trait>` 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),
Expand All @@ -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))]
_ => {}
}
}
Expand Down

0 comments on commit 5f2f9b4

Please sign in to comment.