Skip to content

Commit 57ee80c

Browse files
committed
remove 'static in some places
1 parent 33a3a6d commit 57ee80c

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::session_diagnostics;
1010

1111
pub(crate) struct AllowInternalUnstableParser;
1212
impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser {
13-
const PATH: &'static [Symbol] = &[sym::allow_internal_unstable];
13+
const PATH: &[Symbol] = &[sym::allow_internal_unstable];
1414
type Item = (Symbol, Span);
1515
const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowInternalUnstable;
1616

@@ -26,7 +26,7 @@ impl<S: Stage> CombineAttributeParser<S> for AllowInternalUnstableParser {
2626

2727
pub(crate) struct AllowConstFnUnstableParser;
2828
impl<S: Stage> CombineAttributeParser<S> for AllowConstFnUnstableParser {
29-
const PATH: &'static [Symbol] = &[sym::rustc_allow_const_fn_unstable];
29+
const PATH: &[Symbol] = &[sym::rustc_allow_const_fn_unstable];
3030
type Item = Symbol;
3131
const CONVERT: ConvertFn<Self::Item> = AttributeKind::AllowConstFnUnstable;
3232

compiler/rustc_attr_parsing/src/attributes/deprecation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn get<S: Stage>(
4242
}
4343

4444
impl<S: Stage> SingleAttributeParser<S> for DeprecationParser {
45-
const PATH: &'static [Symbol] = &[sym::deprecated];
45+
const PATH: &[Symbol] = &[sym::deprecated];
4646
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst;
4747
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
4848

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! - [`CombineAttributeParser`]: makes it easy to implement an attribute which should combine the
1313
//! contents of attributes, if an attribute appear multiple times in a list
1414
//!
15-
//! Attributes should be added to [`ATTRIBUTE_MAPPING`](crate::context::ATTRIBUTE_MAPPING) to be parsed.
15+
//! Attributes should be added to `crate::context:ATTRIBUTE_MAPPING` to be parsed.
1616
1717
use std::marker::PhantomData;
1818

@@ -74,7 +74,7 @@ pub(crate) trait AttributeParser<S: Stage>: Default + 'static {
7474
/// [`SingleAttributeParser`] can only convert attributes one-to-one, and cannot combine multiple
7575
/// attributes together like is necessary for `#[stable()]` and `#[unstable()]` for example.
7676
pub(crate) trait SingleAttributeParser<S: Stage>: 'static {
77-
const PATH: &'static [Symbol];
77+
const PATH: &[Symbol];
7878
const ATTRIBUTE_ORDER: AttributeOrder;
7979
const ON_DUPLICATE: OnDuplicate<S>;
8080

@@ -142,7 +142,7 @@ pub(crate) enum OnDuplicate<S: Stage> {
142142
/// Custom function called when a duplicate attribute is found.
143143
///
144144
/// - `unused` is the span of the attribute that was unused or bad because of some
145-
/// duplicate reason (see [`AttributeDuplicates`])
145+
/// duplicate reason (see [`AttributeOrder`])
146146
/// - `used` is the span of the attribute that was used in favor of the unused attribute
147147
Custom(fn(cx: &AcceptContext<'_, '_, S>, used: Span, unused: Span)),
148148
}
@@ -208,7 +208,7 @@ type ConvertFn<E> = fn(ThinVec<E>) -> AttributeKind;
208208
/// [`CombineAttributeParser`] can only convert a single kind of attribute, and cannot combine multiple
209209
/// attributes together like is necessary for `#[stable()]` and `#[unstable()]` for example.
210210
pub(crate) trait CombineAttributeParser<S: Stage>: 'static {
211-
const PATH: &'static [Symbol];
211+
const PATH: &[rustc_span::Symbol];
212212

213213
type Item;
214214
const CONVERT: ConvertFn<Self::Item>;

compiler/rustc_attr_parsing/src/attributes/repr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(crate) struct ReprParser;
2121

2222
impl<S: Stage> CombineAttributeParser<S> for ReprParser {
2323
type Item = (ReprAttr, Span);
24-
const PATH: &'static [Symbol] = &[sym::repr];
24+
const PATH: &[Symbol] = &[sym::repr];
2525
const CONVERT: ConvertFn<Self::Item> = AttributeKind::Repr;
2626

2727
fn extend<'c>(

compiler/rustc_attr_parsing/src/attributes/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<S: Stage> AttributeParser<S> for BodyStabilityParser {
117117
pub(crate) struct ConstStabilityIndirectParser;
118118
// FIXME(jdonszelmann): single word attribute group when we have these
119119
impl<S: Stage> SingleAttributeParser<S> for ConstStabilityIndirectParser {
120-
const PATH: &'static [Symbol] = &[sym::rustc_const_stable_indirect];
120+
const PATH: &[Symbol] = &[sym::rustc_const_stable_indirect];
121121
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst;
122122
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Ignore;
123123

compiler/rustc_attr_parsing/src/attributes/transparency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use rustc_attr_data_structures::AttributeKind;
22
use rustc_span::hygiene::Transparency;
33
use rustc_span::{Symbol, sym};
44

5-
use super::{AcceptContext, AttributeOrder, OnDuplicate, SingleAttributeParser};
6-
use crate::context::Stage;
5+
use super::{AttributeOrder, OnDuplicate, SingleAttributeParser};
6+
use crate::context::{AcceptContext, Stage};
77
use crate::parser::ArgParser;
88

99
pub(crate) struct TransparencyParser;

compiler/rustc_attr_parsing/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
#[macro_use]
8787
mod attributes;
88-
mod context;
88+
pub(crate) mod context;
8989
mod lints;
9090
pub mod parser;
9191
mod session_diagnostics;

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ pub use rustc_error_messages::{
6060
SubdiagMessage, fallback_fluent_bundle, fluent_bundle,
6161
};
6262
use rustc_hashes::Hash128;
63-
use rustc_hir::HirId;
63+
use rustc_lint_defs::LintExpectationId;
6464
pub use rustc_lint_defs::{Applicability, listify, pluralize};
65-
use rustc_lint_defs::{Lint, LintExpectationId};
6665
use rustc_macros::{Decodable, Encodable};
6766
pub use rustc_span::ErrorGuaranteed;
6867
pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker};

0 commit comments

Comments
 (0)