Skip to content

Commit

Permalink
Merge pull request #1576 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 committed Jan 4, 2024
2 parents 2c96972 + 97b1df6 commit e8a5c68
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match expr {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// Expr::Array(expr) => {...}
// Expr::Assign(expr) => {...}
// ...
// Expr::Yield(expr) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down
12 changes: 8 additions & 4 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match item {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// Item::Const(item) => {...}
// Item::Enum(item) => {...}
// ...
// Item::Verbatim(item) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down Expand Up @@ -510,12 +511,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match item {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// ForeignItem::Fn(item) => {...}
// ForeignItem::Static(item) => {...}
// ...
// ForeignItem::Verbatim(item) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down Expand Up @@ -604,12 +606,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match item {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// TraitItem::Const(item) => {...}
// TraitItem::Fn(item) => {...}
// ...
// TraitItem::Verbatim(item) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down Expand Up @@ -700,12 +703,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match item {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// ImplItem::Const(item) => {...}
// ImplItem::Fn(item) => {...}
// ...
// ImplItem::Verbatim(item) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down
3 changes: 2 additions & 1 deletion src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match pat {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// Pat::Box(pat) => {...}
// Pat::Ident(pat) => {...}
// ...
// Pat::Wild(pat) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down
3 changes: 2 additions & 1 deletion src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ ast_enum_of_structs! {
// For testing exhaustiveness in downstream code, use the following idiom:
//
// match ty {
// #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
//
// Type::Array(ty) => {...}
// Type::BareFn(ty) => {...}
// ...
// Type::Verbatim(ty) => {...}
//
// #[cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
// _ => { /* some sane fallback */ }
// }
//
Expand Down

0 comments on commit e8a5c68

Please sign in to comment.