about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2024-09-12 11:34:07 +0200
committerSamuel Tardieu <sam@rfc1149.net>2024-09-22 21:10:16 +0200
commitcc2f447f073abdd103b749ce6725c9c6f60934f1 (patch)
treefa5767d282dee3582bdca24571fcf6740c74bb54
parent43e338458168db91b8459735ba6ac0f230d78d92 (diff)
downloadrust-cc2f447f073abdd103b749ce6725c9c6f60934f1.tar.gz
rust-cc2f447f073abdd103b749ce6725c9c6f60934f1.zip
Check that #[deny(allow_attributes)] do not issue spurious messages
-rw-r--r--tests/ui/allow_attributes.fixed7
-rw-r--r--tests/ui/allow_attributes.rs7
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/allow_attributes.fixed b/tests/ui/allow_attributes.fixed
index 49ee3ee17c7..058dbb77a32 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<u8> {
+    let allow = None;
+    allow?;
+    Some(42)
+}
diff --git a/tests/ui/allow_attributes.rs b/tests/ui/allow_attributes.rs
index 854acf8348d..6d94ce50e4c 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<u8> {
+    let allow = None;
+    allow?;
+    Some(42)
+}