Skip to content

Commit 4d0da17

Browse files
committed
chore(frontend/exporter): drop some attribute support for now
We are probably not going to use most of attribute kinds. After chatting with @Nadrieril, for easing rustc updates, I'm dropping most of the attributes kinds, hinding them behind a `Todo` variant.
1 parent 6d1129b commit 4d0da17

File tree

1 file changed

+7
-211
lines changed

1 file changed

+7
-211
lines changed

frontend/exporter/src/types/attributes.rs

Lines changed: 7 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -13,142 +13,31 @@ pub enum AttributeKind {
1313
align: Align,
1414
span: Span,
1515
},
16-
AllowConstFnUnstable(Vec<Symbol>, Span),
17-
AllowIncoherentImpl(Span),
18-
AllowInternalUnstable(Vec<(Symbol, Span)>, Span),
19-
AsPtr(Span),
2016
AutomaticallyDerived(Span),
21-
BodyStability {
22-
stability: DefaultBodyStability,
23-
span: Span,
24-
},
25-
CoherenceIsCore,
26-
Coinductive(Span),
27-
Cold(Span),
28-
Confusables {
29-
symbols: Vec<Symbol>,
30-
first_span: Span,
31-
},
32-
ConstContinue(Span),
33-
ConstStability {
34-
stability: PartialConstStability,
35-
span: Span,
36-
},
37-
ConstStabilityIndirect,
38-
ConstTrait(Span),
3917
Coverage(Span, CoverageStatus),
40-
DenyExplicitImpl(Span),
4118
Deprecation {
4219
deprecation: Deprecation,
4320
span: Span,
4421
},
45-
DoNotImplementViaObject(Span),
4622
DocComment {
4723
style: AttrStyle,
4824
kind: CommentKind,
4925
span: Span,
5026
comment: Symbol,
5127
},
52-
Dummy,
53-
ExportName {
54-
name: Symbol,
55-
span: Span,
56-
},
57-
ExportStable,
58-
FfiConst(Span),
59-
FfiPure(Span),
60-
Fundamental,
6128
Ignore {
6229
span: Span,
6330
reason: Option<Symbol>,
6431
},
65-
Inline(InlineAttr, Span),
66-
LinkName {
67-
name: Symbol,
68-
span: Span,
69-
},
70-
LinkOrdinal {
71-
ordinal: u16,
72-
span: Span,
73-
},
74-
LinkSection {
75-
name: Symbol,
76-
span: Span,
77-
},
78-
LoopMatch(Span),
79-
MacroTransparency(Transparency),
8032
Marker(Span),
8133
MayDangle(Span),
8234
MustUse {
8335
span: Span,
8436
reason: Option<Symbol>,
8537
},
86-
Naked(Span),
87-
NoImplicitPrelude(Span),
88-
NoMangle(Span),
89-
NonExhaustive(Span),
90-
OmitGdbPrettyPrinterSection,
91-
Optimize(OptimizeAttr, Span),
92-
ParenSugar(Span),
93-
PassByValue(Span),
9438
Path(Symbol, Span),
95-
Pointee(Span),
96-
PubTransparent(Span),
97-
Repr {
98-
reprs: Vec<(ReprAttr, Span)>,
99-
first_span: Span,
100-
},
101-
RustcLayoutScalarValidRangeEnd(u128, Span),
102-
RustcLayoutScalarValidRangeStart(u128, Span),
103-
RustcObjectLifetimeDefault,
104-
SkipDuringMethodDispatch {
105-
array: bool,
106-
boxed_slice: bool,
107-
span: Span,
108-
},
109-
SpecializationTrait(Span),
110-
Stability {
111-
stability: Stability,
112-
span: Span,
113-
},
114-
StdInternalSymbol(Span),
115-
TargetFeature(Vec<(Symbol, Span)>, Span),
116-
TrackCaller(Span),
117-
TypeConst(Span),
118-
UnsafeSpecializationMarker(Span),
119-
UnstableFeatureBound(Vec<(Symbol, Span)>),
120-
Used {
121-
used_by: UsedBy,
122-
span: Span,
123-
},
124-
}
125-
126-
/// Reflects [`rustc_span::hygiene::Transparency`]
127-
#[derive_group(Serializers)]
128-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
129-
#[args(<'tcx, S>, from: rustc_span::hygiene::Transparency, state: S as _s)]
130-
pub enum Transparency {
131-
Transparent,
132-
SemiOpaque,
133-
Opaque,
134-
}
135-
136-
/// Reflects [`rustc_attr_data_structures::Stability`]
137-
#[derive_group(Serializers)]
138-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
139-
#[args(<'tcx, S>, from: rustc_attr_data_structures::Stability, state: S as _s)]
140-
pub struct Stability {
141-
pub level: StabilityLevel,
142-
pub feature: Symbol,
143-
}
144-
145-
/// Reflects [`rustc_attr_data_structures::DefaultBodyStability`]
146-
#[derive_group(Serializers)]
147-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
148-
#[args(<'tcx, S>, from: rustc_attr_data_structures::DefaultBodyStability, state: S as _s)]
149-
pub struct DefaultBodyStability {
150-
pub level: StabilityLevel,
151-
pub feature: Symbol,
39+
#[todo]
40+
Todo(String),
15241
}
15342

15443
/// Reflects [`rustc_attr_data_structures::Deprecation`]
@@ -173,76 +62,6 @@ pub enum DeprecatedSince {
17362
Err,
17463
}
17564

176-
/// Reflects [`rustc_attr_data_structures::ReprAttr`]
177-
#[derive_group(Serializers)]
178-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
179-
#[args(<'tcx, S>, from: rustc_attr_data_structures::ReprAttr, state: S as _s)]
180-
pub enum ReprAttr {
181-
ReprInt(IntType),
182-
ReprRust,
183-
ReprC,
184-
ReprPacked(Align),
185-
ReprSimd,
186-
ReprTransparent,
187-
ReprAlign(Align),
188-
}
189-
190-
/// Reflects [`rustc_attr_data_structures::IntType`]
191-
#[derive_group(Serializers)]
192-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
193-
#[args(<'tcx, S>, from: rustc_attr_data_structures::IntType, state: S as _s)]
194-
pub enum IntType {
195-
SignedInt(IntTy),
196-
UnsignedInt(UintTy),
197-
}
198-
199-
/// Reflects [`rustc_attr_data_structures::UsedBy`]
200-
#[derive_group(Serializers)]
201-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
202-
#[args(<'tcx, S>, from: rustc_attr_data_structures::UsedBy, state: S as _s)]
203-
pub enum UsedBy {
204-
Compiler,
205-
Linker,
206-
}
207-
208-
/// Reflects [`rustc_attr_data_structures::StabilityLevel`]
209-
#[derive_group(Serializers)]
210-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
211-
#[args(<'tcx, S>, from: rustc_attr_data_structures::StabilityLevel, state: S as _s)]
212-
pub enum StabilityLevel {
213-
Unstable {
214-
reason: UnstableReason,
215-
#[map(x.map(|x| x.get()))]
216-
issue: Option<u32>,
217-
is_soft: bool,
218-
implied_by: Option<Symbol>,
219-
old_name: Option<Symbol>,
220-
},
221-
Stable {
222-
since: StableSince,
223-
allowed_through_unstable_modules: Option<Symbol>,
224-
},
225-
}
226-
227-
/// Reflects [`rustc_attr_data_structures::CoverageStatus`]
228-
#[derive_group(Serializers)]
229-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
230-
#[args(<'tcx, S>, from: rustc_attr_data_structures::CoverageStatus, state: S as _s)]
231-
pub enum CoverageStatus {
232-
On,
233-
Off,
234-
}
235-
236-
/// Reflects [`rustc_attr_data_structures::PartialConstStability`]
237-
#[derive_group(Serializers)]
238-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
239-
#[args(<'tcx, S>, from: rustc_attr_data_structures::PartialConstStability, state: S as _s)]
240-
pub struct PartialConstStability {
241-
pub level: StabilityLevel,
242-
pub feature: Symbol,
243-
pub promotable: bool,
244-
}
245-
24665
/// Reflects [`rustc_attr_data_structures::RustcVersion`]
24766
#[derive_group(Serializers)]
24867
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
@@ -253,36 +72,13 @@ pub struct RustcVersion {
25372
pub patch: u16,
25473
}
25574

256-
/// Reflects [`rustc_attr_data_structures::StableSince`]
257-
#[derive_group(Serializers)]
258-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
259-
#[args(<'tcx, S>, from: rustc_attr_data_structures::StableSince, state: S as _s)]
260-
pub enum StableSince {
261-
Version(RustcVersion),
262-
Current,
263-
#[custom_arm(rustc_attr_data_structures::StableSince::Err(_) => StableSince::Err,)]
264-
Err,
265-
}
266-
267-
/// Reflects [`rustc_attr_data_structures::UnstableReason`]
268-
#[derive_group(Serializers)]
269-
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
270-
#[args(<'tcx, S>, from: rustc_attr_data_structures::UnstableReason, state: S as _s)]
271-
pub enum UnstableReason {
272-
None,
273-
Default,
274-
Some(Symbol),
275-
}
276-
277-
/// Reflects [`rustc_attr_data_structures::OptimizeAttr`]
75+
/// Reflects [`rustc_attr_data_structures::CoverageStatus`]
27876
#[derive_group(Serializers)]
27977
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
280-
#[args(<'tcx, S>, from: rustc_attr_data_structures::OptimizeAttr, state: S as _s)]
281-
pub enum OptimizeAttr {
282-
Default,
283-
DoNotOptimize,
284-
Speed,
285-
Size,
78+
#[args(<'tcx, S>, from: rustc_attr_data_structures::CoverageStatus, state: S as _s)]
79+
pub enum CoverageStatus {
80+
On,
81+
Off,
28682
}
28783

28884
/// Reflects [`rustc_attr_data_structures::InlineAttr`]

0 commit comments

Comments
 (0)