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-24 01:41:19 +0300
committerPavel Grigorenko <GrigorenkoPV@ya.ru>2025-07-09 01:07:15 +0300
commita57a885abc342cf0fec0521da21b295f8694f75e (patch)
tree9313b7c065a2a731e1473d75b7a0bb09d2d2c6e0 /compiler/rustc_passes/src
parent61937839616b89838afe77a0a9d14c70d51a3f09 (diff)
downloadrust-a57a885abc342cf0fec0521da21b295f8694f75e.tar.gz
rust-a57a885abc342cf0fec0521da21b295f8694f75e.zip
Port `#[rustc_unsafe_specialization_marker]` 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, 8 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 6e3ec5584d4..7d30c36b463 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -125,11 +125,17 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                     | AttributeKind::Coinductive(attr_span)
                     | AttributeKind::ConstTrait(attr_span)
                     | AttributeKind::DenyExplicitImpl(attr_span)
-                    | AttributeKind::DoNotImplementViaObject(attr_span)
-                    | AttributeKind::SpecializationTrait(attr_span),
+                    | AttributeKind::DoNotImplementViaObject(attr_span),
                 ) => {
                     self.check_must_be_applied_to_trait(*attr_span, span, target);
                 }
+                &Attribute::Parsed(
+                    AttributeKind::SpecializationTrait(attr_span)
+                    | AttributeKind::UnsafeSpecializationMarker(attr_span),
+                ) => {
+                    // FIXME(specialization): more validation is needed
+                    self.check_must_be_applied_to_trait(attr_span, span, target);
+                }
                 &Attribute::Parsed(AttributeKind::TypeConst(attr_span)) => {
                     self.check_type_const(hir_id, attr_span, target)
                 }