diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-03-07 15:34:14 +0100 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-06-12 09:57:38 +0200 |
| commit | e2afe04e2e45aff24bcc4e78cae04acdba8edcef (patch) | |
| tree | 0c7d3e53ee910521bfba47f227dd708a4efdff79 | |
| parent | e6a5f281ec2b78b3089dcd9fd941d9d14921c6fa (diff) | |
| download | rust-e2afe04e2e45aff24bcc4e78cae04acdba8edcef.tar.gz rust-e2afe04e2e45aff24bcc4e78cae04acdba8edcef.zip | |
remove 'static in some places
7 files changed, 13 insertions, 13 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs index 2349ee15fe6..81192f902a2 100644 --- a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs +++ b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs @@ -10,7 +10,7 @@ use crate::session_diagnostics; pub(crate) struct AllowInternalUnstableParser; impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser { - const PATH: &'static [Symbol] = &[sym::allow_internal_unstable]; + const PATH: &[Symbol] = &[sym::allow_internal_unstable]; type Item = (Symbol, Span); const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowInternalUnstable; @@ -26,7 +26,7 @@ impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser { pub(crate) struct AllowConstFnUnstableParser; impl<S: Stage> CombineAttributeParser<S> for AllowConstFnUnstableParser { - const PATH: &'static [Symbol] = &[sym::rustc_allow_const_fn_unstable]; + const PATH: &[Symbol] = &[sym::rustc_allow_const_fn_unstable]; type Item = Symbol; const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowConstFnUnstable; diff --git a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs index ba1bdb9fd02..1faee41c2a9 100644 --- a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs +++ b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs @@ -42,7 +42,7 @@ fn get<S: Stage>( } impl<S: Stage> SingleAttributeParser<S> for DeprecationParser { - const PATH: &'static [Symbol] = &[sym::deprecated]; + const PATH: &[Symbol] = &[sym::deprecated]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst; const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error; diff --git a/compiler/rustc_attr_parsing/src/attributes/mod.rs b/compiler/rustc_attr_parsing/src/attributes/mod.rs index 1d239bd43f4..caf55e6685e 100644 --- a/compiler/rustc_attr_parsing/src/attributes/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/mod.rs @@ -12,7 +12,7 @@ //! - [`CombineAttributeParser`]: makes it easy to implement an attribute which should combine the //! contents of attributes, if an attribute appear multiple times in a list //! -//! Attributes should be added to [`ATTRIBUTE_PARSERS`](crate::context::ATTRIBUTE_PARSERS) to be parsed. +//! Attributes should be added to `crate::context::ATTRIBUTE_PARSERS` to be parsed. use std::marker::PhantomData; @@ -83,7 +83,7 @@ pub(crate) trait AttributeParser<S: Stage>: Default + 'static { /// [`SingleAttributeParser`] can only convert attributes one-to-one, and cannot combine multiple /// attributes together like is necessary for `#[stable()]` and `#[unstable()]` for example. pub(crate) trait SingleAttributeParser<S: Stage>: 'static { - const PATH: &'static [Symbol]; + const PATH: &[Symbol]; const ATTRIBUTE_ORDER: AttributeOrder; const ON_DUPLICATE: OnDuplicate<S>; @@ -151,7 +151,7 @@ pub(crate) enum OnDuplicate<S: Stage> { /// Custom function called when a duplicate attribute is found. /// /// - `unused` is the span of the attribute that was unused or bad because of some - /// duplicate reason (see [`AttributeDuplicates`]) + /// duplicate reason (see [`AttributeOrder`]) /// - `used` is the span of the attribute that was used in favor of the unused attribute Custom(fn(cx: &AcceptContext<'_, '_, S>, used: Span, unused: Span)), } @@ -217,7 +217,7 @@ type ConvertFn<E> = fn(ThinVec<E>) -> AttributeKind; /// [`CombineAttributeParser`] can only convert a single kind of attribute, and cannot combine multiple /// attributes together like is necessary for `#[stable()]` and `#[unstable()]` for example. pub(crate) trait CombineAttributeParser<S: Stage>: 'static { - const PATH: &'static [Symbol]; + const PATH: &[rustc_span::Symbol]; type Item; const CONVERT: ConvertFn<Self::Item>; diff --git a/compiler/rustc_attr_parsing/src/attributes/repr.rs b/compiler/rustc_attr_parsing/src/attributes/repr.rs index 8b2981ddb08..753b2366b41 100644 --- a/compiler/rustc_attr_parsing/src/attributes/repr.rs +++ b/compiler/rustc_attr_parsing/src/attributes/repr.rs @@ -21,7 +21,7 @@ pub(crate) struct ReprParser; impl<S: Stage> CombineAttributeParser<S> for ReprParser { type Item = (ReprAttr, Span); - const PATH: &'static [Symbol] = &[sym::repr]; + const PATH: &[Symbol] = &[sym::repr]; const CONVERT: ConvertFn<Self::Item> = AttributeKind::Repr; fn extend<'c>( diff --git a/compiler/rustc_attr_parsing/src/attributes/stability.rs b/compiler/rustc_attr_parsing/src/attributes/stability.rs index d8cf56a9830..3cbadd4c7ec 100644 --- a/compiler/rustc_attr_parsing/src/attributes/stability.rs +++ b/compiler/rustc_attr_parsing/src/attributes/stability.rs @@ -117,7 +117,7 @@ impl<S: Stage> AttributeParser<S> for BodyStabilityParser { pub(crate) struct ConstStabilityIndirectParser; // FIXME(jdonszelmann): single word attribute group when we have these impl<S: Stage> SingleAttributeParser<S> for ConstStabilityIndirectParser { - const PATH: &'static [Symbol] = &[sym::rustc_const_stable_indirect]; + const PATH: &[Symbol] = &[sym::rustc_const_stable_indirect]; const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst; const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Ignore; diff --git a/compiler/rustc_attr_parsing/src/attributes/transparency.rs b/compiler/rustc_attr_parsing/src/attributes/transparency.rs index 1de3a9cfeba..16ad9d03e50 100644 --- a/compiler/rustc_attr_parsing/src/attributes/transparency.rs +++ b/compiler/rustc_attr_parsing/src/attributes/transparency.rs @@ -2,8 +2,8 @@ use rustc_attr_data_structures::AttributeKind; use rustc_span::hygiene::Transparency; use rustc_span::{Symbol, sym}; -use super::{AcceptContext, AttributeOrder, OnDuplicate, SingleAttributeParser}; -use crate::context::Stage; +use super::{AttributeOrder, OnDuplicate, SingleAttributeParser}; +use crate::context::{AcceptContext, Stage}; use crate::parser::ArgParser; pub(crate) struct TransparencyParser; diff --git a/compiler/rustc_attr_parsing/src/lib.rs b/compiler/rustc_attr_parsing/src/lib.rs index 5c458575c76..47eeb63bad3 100644 --- a/compiler/rustc_attr_parsing/src/lib.rs +++ b/compiler/rustc_attr_parsing/src/lib.rs @@ -62,7 +62,7 @@ //! a "stability" of an item. So, the stability attribute has an //! [`AttributeParser`](attributes::AttributeParser) that recognizes both the `#[stable()]` //! and `#[unstable()]` syntactic attributes, and at the end produce a single -//! [`AttributeKind::Stability`]. +//! [`AttributeKind::Stability`](rustc_attr_data_structures::AttributeKind::Stability). //! //! When multiple instances of the same attribute are allowed, they're combined into a single //! semantic attribute. For example: @@ -85,7 +85,7 @@ #[macro_use] mod attributes; -mod context; +pub(crate) mod context; mod lints; pub mod parser; mod session_diagnostics; |
