From cc2f447f073abdd103b749ce6725c9c6f60934f1 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Thu, 12 Sep 2024 11:34:07 +0200 Subject: [PATCH] Check that #[deny(allow_attributes)] do not issue spurious messages --- tests/ui/allow_attributes.fixed | 7 +++++++ tests/ui/allow_attributes.rs | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/tests/ui/allow_attributes.fixed b/tests/ui/allow_attributes.fixed index 49ee3ee17..058dbb77a 100644 --- a/tests/ui/allow_attributes.fixed +++ b/tests/ui/allow_attributes.fixed @@ -58,3 +58,10 @@ fn msrv_1_80() { #[allow(unused)] let x = 1; } + +#[deny(clippy::allow_attributes)] +fn deny_allow_attributes() -> Option { + let allow = None; + allow?; + Some(42) +} diff --git a/tests/ui/allow_attributes.rs b/tests/ui/allow_attributes.rs index 854acf834..6d94ce50e 100644 --- a/tests/ui/allow_attributes.rs +++ b/tests/ui/allow_attributes.rs @@ -58,3 +58,10 @@ fn msrv_1_80() { #[allow(unused)] let x = 1; } + +#[deny(clippy::allow_attributes)] +fn deny_allow_attributes() -> Option { + let allow = None; + allow?; + Some(42) +}