diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-06-18 22:27:35 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2025-06-23 22:48:20 +0300 |
| commit | aa80a2b62cde51fc9796a66dfed013a581bff706 (patch) | |
| tree | fa2f84142c37f4762399cce580233940c5ff594e /compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs | |
| parent | 42245d34d22ade32b3f276dcf74deb826841594c (diff) | |
| download | rust-aa80a2b62cde51fc9796a66dfed013a581bff706.tar.gz rust-aa80a2b62cde51fc9796a66dfed013a581bff706.zip | |
Port `#[rustc_skip_during_method_dispatch]` to the new attribute system
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index 24c40c301fe..0fa69c40154 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -50,8 +50,8 @@ impl<S: Stage> SingleAttributeParser<S> for ColdParser { const TEMPLATE: AttributeTemplate = template!(Word); fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> { - if !args.no_args() { - cx.expected_no_args(args.span().unwrap_or(cx.attr_span)); + if let Err(span) = args.no_args() { + cx.expected_no_args(span); return None; } @@ -67,8 +67,8 @@ pub(crate) struct NakedParser { impl<S: Stage> AttributeParser<S> for NakedParser { const ATTRIBUTES: AcceptMapping<Self, S> = &[(&[sym::naked], template!(Word), |this, cx, args| { - if !args.no_args() { - cx.expected_no_args(args.span().unwrap_or(cx.attr_span)); + if let Err(span) = args.no_args() { + cx.expected_no_args(span); return; } @@ -175,10 +175,10 @@ impl<S: Stage> SingleAttributeParser<S> for NoMangleParser { const TEMPLATE: AttributeTemplate = template!(Word); fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> { - if !args.no_args() { - cx.expected_no_args(args.span().unwrap_or(cx.attr_span)); + if let Err(span) = args.no_args() { + cx.expected_no_args(span); return None; - }; + } Some(AttributeKind::NoMangle(cx.attr_span)) } |
