Skip to content

Commit e68b3d4

Browse files
committed
create empty inline attr parser and associated AttributeKind variants
1 parent 9559a37 commit e68b3d4

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use thin_vec::ThinVec;
88

99
use crate::{DefaultBodyStability, PartialConstStability, PrintAttribute, RustcVersion, Stability};
1010

11-
#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
11+
#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic, PrintAttribute)]
1212
pub enum InlineAttr {
1313
None,
1414
Hint,
@@ -189,6 +189,7 @@ pub enum AttributeKind {
189189
span: Span,
190190
comment: Symbol,
191191
},
192+
Inline(InlineAttr),
192193
MacroTransparency(Transparency),
193194
Repr(ThinVec<(ReprAttr, Span)>),
194195
Stability {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use rustc_span::sym;
2+
3+
use crate::attributes::SingleAttributeParser;
4+
5+
pub(crate) struct InlineParser;
6+
7+
impl SingleAttributeParser for InlineParser {
8+
const PATH: &'static [rustc_span::Symbol] = &[sym::inline];
9+
10+
fn on_duplicate(cx: &super::AcceptContext<'_>, first_span: rustc_span::Span) {
11+
todo!()
12+
}
13+
14+
fn convert(cx: &super::AcceptContext<'_>, args: &crate::parser::ArgParser<'_>) -> Option<rustc_attr_data_structures::AttributeKind> {
15+
todo!()
16+
}
17+
}

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub(crate) mod allow_unstable;
2929
pub(crate) mod cfg;
3030
pub(crate) mod confusables;
3131
pub(crate) mod deprecation;
32+
pub(crate) mod inline;
3233
pub(crate) mod repr;
3334
pub(crate) mod stability;
3435
pub(crate) mod transparency;

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
1919
use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInternalUnstableParser};
2020
use crate::attributes::confusables::ConfusablesParser;
2121
use crate::attributes::deprecation::DeprecationParser;
22+
use crate::attributes::inline::InlineParser;
2223
use crate::attributes::repr::ReprParser;
2324
use crate::attributes::stability::{
2425
BodyStabilityParser, ConstStabilityIndirectParser, ConstStabilityParser, StabilityParser,
@@ -104,6 +105,7 @@ attribute_groups!(
104105
// tidy-alphabetical-start
105106
Single<ConstStabilityIndirectParser>,
106107
Single<DeprecationParser>,
108+
Single<InlineParser>,
107109
Single<TransparencyParser>,
108110
// tidy-alphabetical-end
109111
];

0 commit comments

Comments
 (0)