From b0ef9bfd285ef3b5adbd127f54837f580a5e29b4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 3 Jan 2024 18:21:26 -0800 Subject: [PATCH] Pick up changes to non_exhaustive_omitted_patterns lint warning: the lint level must be set on the whole match --> impl/src/declaration.rs:304:9 | 303 | #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] | ------------------------------- remove this attribute 304 | _ => unimplemented!("unknown Type"), | ^ | = help: it no longer has any effect to set the lint level on an individual match arm help: set the lint level on the whole match | 269 + #[deny(non_exhaustive_omitted_patterns)] 270 | match ty { | --- impl/src/declaration.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/impl/src/declaration.rs b/impl/src/declaration.rs index 4bb04d0..76494b1 100644 --- a/impl/src/declaration.rs +++ b/impl/src/declaration.rs @@ -267,6 +267,7 @@ pub fn expand(input: TokenStream) -> TokenStream { fn populate_static_lifetimes(ty: &mut Type) { match ty { + #![cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] Type::Array(ty) => populate_static_lifetimes(&mut ty.elem), Type::Group(ty) => populate_static_lifetimes(&mut ty.elem), Type::Paren(ty) => populate_static_lifetimes(&mut ty.elem), @@ -300,7 +301,7 @@ fn populate_static_lifetimes(ty: &mut Type) { | Type::TraitObject(_) | Type::BareFn(_) | Type::Verbatim(_) => {} - #[cfg_attr(all(test, exhaustive), deny(non_exhaustive_omitted_patterns))] + _ => unimplemented!("unknown Type"), } }