Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pick up changes to non_exhaustive_omitted_patterns lint #1576

Merged
merged 1 commit into from Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/expr.rs
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
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
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
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