about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorPavel Grigorenko <GrigorenkoPV@ya.ru>2025-06-23 23:41:33 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2025-07-09 01:03:00 +0300
commit62f58dbb2d4b9cc0f2a20cb836eb48d869358416 (patch)
tree76bde429674db93c6ebd2746dca68b44add1aabf /compiler/rustc_passes/src
parentab68b0fb26485ab1fa6977b2d8b59cc8a171c4aa (diff)
downloadrust-62f58dbb2d4b9cc0f2a20cb836eb48d869358416.tar.gz
rust-62f58dbb2d4b9cc0f2a20cb836eb48d869358416.zip
Port `#[const_trait]` to the new attribute system
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/check_attr.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 0aa6a2b41cf..744f93506fe 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -120,10 +120,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
         for attr in attrs {
             let mut style = None;
             match attr {
-                Attribute::Parsed(AttributeKind::SkipDuringMethodDispatch {
-                    span: attr_span,
-                    ..
-                }) => {
+                Attribute::Parsed(
+                    AttributeKind::SkipDuringMethodDispatch { span: attr_span, .. }
+                    | AttributeKind::ConstTrait(attr_span),
+                ) => {
                     self.check_must_be_applied_to_trait(*attr_span, span, target);
                 }
                 Attribute::Parsed(AttributeKind::Confusables { first_span, .. }) => {
@@ -301,7 +301,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                         | [sym::rustc_must_implement_one_of, ..]
                         | [sym::rustc_deny_explicit_impl, ..]
                         | [sym::rustc_do_not_implement_via_object, ..]
-                        | [sym::const_trait, ..] => self.check_must_be_applied_to_trait(attr.span(), span, target),
+                        => self.check_must_be_applied_to_trait(attr.span(), span, target),
                         [sym::collapse_debuginfo, ..] => self.check_collapse_debuginfo(attr, span, target),
                         [sym::must_not_suspend, ..] => self.check_must_not_suspend(attr, span, target),
                         [sym::rustc_allow_incoherent_impl, ..] => {