about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-24 10:22:30 +0000
committerbors <bors@rust-lang.org>2025-06-24 10:22:30 +0000
commit36b21637e93b038453924d3c66821089e71d8baa (patch)
treee5abef64f88d9244a0394e45b105762d68ed275f /compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
parente4b9d0141fdd210fcceebd2b67f7be113401c461 (diff)
parent7b864ac1905f0b118d2e4ca1beeede86ac91e5a1 (diff)
downloadrust-36b21637e93b038453924d3c66821089e71d8baa.tar.gz
rust-36b21637e93b038453924d3c66821089e71d8baa.zip
Auto merge of #142956 - GuillaumeGomez:rollup-867246h, r=GuillaumeGomez
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#140005 (Set MSG_NOSIGNAL for UnixStream)
 - rust-lang/rust#140622 (compiletest: Improve diagnostics for line annotation mismatches)
 - rust-lang/rust#142354 (Fixes firefox copy paste issue)
 - rust-lang/rust#142695 (Port `#[rustc_skip_during_method_dispatch]` to the new attribute system)
 - rust-lang/rust#142779 (Add note about `str::split` handling of no matches.)
 - rust-lang/rust#142894 (phantom_variance_markers: fix identifier usage in macro)
 - rust-lang/rust#142928 (Fix hang in --print=file-names in bootstrap)
 - rust-lang/rust#142932 (rustdoc-json: Keep empty generic args if parenthesized)
 - rust-lang/rust#142933 (Simplify root goal API of solver a bit)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
index 4cfd9a82ce8..1c8fc5079da 100644
--- a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs
@@ -14,8 +14,10 @@ impl<S: Stage> SingleAttributeParser<S> for AsPtrParser {
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
     const TEMPLATE: AttributeTemplate = template!(Word);
 
-    fn convert(cx: &mut AcceptContext<'_, '_, S>, _args: &ArgParser<'_>) -> Option<AttributeKind> {
-        // FIXME: check that there's no args (this is currently checked elsewhere)
+    fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
+        if let Err(span) = args.no_args() {
+            cx.expected_no_args(span);
+        }
         Some(AttributeKind::AsPtr(cx.attr_span))
     }
 }
@@ -27,8 +29,10 @@ impl<S: Stage> SingleAttributeParser<S> for PubTransparentParser {
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
     const TEMPLATE: AttributeTemplate = template!(Word);
 
-    fn convert(cx: &mut AcceptContext<'_, '_, S>, _args: &ArgParser<'_>) -> Option<AttributeKind> {
-        // FIXME: check that there's no args (this is currently checked elsewhere)
+    fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
+        if let Err(span) = args.no_args() {
+            cx.expected_no_args(span);
+        }
         Some(AttributeKind::PubTransparent(cx.attr_span))
     }
 }