diff --git a/src/expr.rs b/src/expr.rs index a417508b5..a267a2e68 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -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 */ } // } // diff --git a/src/item.rs b/src/item.rs index b56f8b239..4e404e266 100644 --- a/src/item.rs +++ b/src/item.rs @@ -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 */ } // } // @@ -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 */ } // } // @@ -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 */ } // } // @@ -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 */ } // } // diff --git a/src/pat.rs b/src/pat.rs index c835d772f..ce6399d9f 100644 --- a/src/pat.rs +++ b/src/pat.rs @@ -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 */ } // } // diff --git a/src/ty.rs b/src/ty.rs index a5049f080..3213e7f3b 100644 --- a/src/ty.rs +++ b/src/ty.rs @@ -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 */ } // } //