about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/attributes/loop_match.rs
diff options
context:
space:
mode:
authorPavel Grigorenko <GrigorenkoPV@ya.ru>2025-07-02 00:20:47 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2025-07-02 00:21:12 +0300
commit8bb7fdb236b50eb14a0b39abbb8cfaa4e2dc853f (patch)
tree7e66da0c5409a0f7e76f617bb2caab9e69ba4f45 /compiler/rustc_attr_parsing/src/attributes/loop_match.rs
parent187babc35f07153e2853ee9b6984f56aa158abc5 (diff)
downloadrust-8bb7fdb236b50eb14a0b39abbb8cfaa4e2dc853f.tar.gz
rust-8bb7fdb236b50eb14a0b39abbb8cfaa4e2dc853f.zip
NoArgsAttributeParser: use an assoc const instead
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/loop_match.rs')
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/loop_match.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/loop_match.rs b/compiler/rustc_attr_parsing/src/attributes/loop_match.rs
index 1a5368c092f..80808b90dc6 100644
--- a/compiler/rustc_attr_parsing/src/attributes/loop_match.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/loop_match.rs
@@ -8,18 +8,12 @@ pub(crate) struct LoopMatchParser;
 impl<S: Stage> NoArgsAttributeParser<S> for LoopMatchParser {
     const PATH: &[Symbol] = &[sym::loop_match];
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
-
-    fn create(span: Span) -> AttributeKind {
-        AttributeKind::LoopMatch(span)
-    }
+    const CREATE: fn(Span) -> AttributeKind = AttributeKind::LoopMatch;
 }
 
 pub(crate) struct ConstContinueParser;
 impl<S: Stage> NoArgsAttributeParser<S> for ConstContinueParser {
     const PATH: &[Symbol] = &[sym::const_continue];
     const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
-
-    fn create(span: Span) -> AttributeKind {
-        AttributeKind::ConstContinue(span)
-    }
+    const CREATE: fn(Span) -> AttributeKind = AttributeKind::ConstContinue;
 }