about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-23 16:48:30 +0000
committerbors <bors@rust-lang.org>2024-09-23 16:48:30 +0000
commitb39323bf255fa79b20f75b7650d64b91d2e0517e (patch)
tree5ed2e7a9b133fa3007795bfb1f4f8d235375835a
parent59bac6a1b1496283be36e9e1319ba2039d149af7 (diff)
parentcc2f447f073abdd103b749ce6725c9c6f60934f1 (diff)
downloadrust-b39323bf255fa79b20f75b7650d64b91d2e0517e.tar.gz
rust-b39323bf255fa79b20f75b7650d64b91d2e0517e.zip
Auto merge of #13389 - samueltardieu:issue-13380, r=xFrednet
Check that #[deny(allow_attributes)] do not issue spurious messages

Add a new test for #13380. This bug was caused by a bug in rustc which has been fixed in https://github.com/rust-lang/rust/pull/130244/commits/6ee87ae5944e02342e3d600700b773a1d4303845.

Close #13380

changelog: [`allow_attributes`]: fix spurious warning 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)
+}