diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-03-07 16:06:58 +0100 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-06-17 23:19:31 +0200 |
| commit | 0aade73c504846d36ce8a77a0b7b0ba1f6f8dfa7 (patch) | |
| tree | 08426a77e8b2c3c5e0e68a2a8dffa5d54e20b92b | |
| parent | 4f73cd0a6c7be3f706aee29090a6d91c17ca53bc (diff) | |
| download | rust-0aade73c504846d36ce8a77a0b7b0ba1f6f8dfa7.tar.gz rust-0aade73c504846d36ce8a77a0b7b0ba1f6f8dfa7.zip | |
implement rustc_force_inline parser
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/attributes.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/inline.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_attr_parsing/src/context.rs | 3 |
3 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index 4c7e91528b9..44fe7d58240 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -235,7 +235,8 @@ pub enum AttributeKind { /// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations). Repr(ThinVec<(ReprAttr, Span)>), - + /// Represents `#[rustc_force_inline]` + RustcForceInline(Span, Option<Symbol>), /// Represents `#[stable]`, `#[unstable]` and `#[rustc_allowed_through_unstable_modules]`. Stability { stability: Stability, diff --git a/compiler/rustc_attr_parsing/src/attributes/inline.rs b/compiler/rustc_attr_parsing/src/attributes/inline.rs index 3056706df37..fecddde930a 100644 --- a/compiler/rustc_attr_parsing/src/attributes/inline.rs +++ b/compiler/rustc_attr_parsing/src/attributes/inline.rs @@ -11,6 +11,7 @@ use super::{AcceptContext, AttributeOrder, OnDuplicate}; use crate::attributes::SingleAttributeParser; use crate::context::Stage; use crate::parser::ArgParser; +use crate::session_diagnostics::IncorrectMetaItem; pub(crate) struct InlineParser; diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 5409aeecb2e..3e1ef688733 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -18,7 +18,7 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym}; use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInternalUnstableParser}; use crate::attributes::confusables::ConfusablesParser; use crate::attributes::deprecation::DeprecationParser; -use crate::attributes::inline::InlineParser; +use crate::attributes::inline::{InlineParser, RustcForceInlineParser}; use crate::attributes::lint_helpers::AsPtrParser; use crate::attributes::repr::ReprParser; use crate::attributes::stability::{ @@ -108,6 +108,7 @@ attribute_parsers!( Single<ConstStabilityIndirectParser>, Single<DeprecationParser>, Single<InlineParser>, + Single<RustcForceInlineParser>, Single<TransparencyParser>, // tidy-alphabetical-end ]; |
