/// A template that the attribute input must match.
/// Only top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is considered now.
-#[derive(Clone, Copy)]
+#[derive(Clone, Copy, Default)]
pub struct AttributeTemplate {
pub word: bool,
pub list: Option<&'static str>,
pub name_value_str: Option<&'static str>,
}
-impl AttributeTemplate {
- pub fn only_word() -> Self {
- Self { word: true, list: None, name_value_str: None }
- }
-}
-
/// A convenience macro for constructing attribute templates.
/// E.g., `template!(Word, List: "description")` means that the attribute
/// supports forms `#[attr]` and `#[attr(description)]`.
rustc_test_marker, Normal, template!(Word),
"the `#[rustc_test_marker]` attribute is used internally to track tests",
),
+ rustc_attr!(
+ rustc_unsafe_specialization_marker, Normal, template!(Word),
+ "the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
+ ),
+ rustc_attr!(
+ rustc_specialization_trait, Normal, template!(Word),
+ "the `#[rustc_specialization_trait]` attribute is used to check specializations"
+ ),
// ==========================================================================
// Internal attributes, Testing: