1use crate::attrs::AttributeKind;
2
3#[derive(PartialEq)]
4pub enum EncodeCrossCrate {
5 Yes,
6 No,
7}
8
9impl AttributeKind {
10 pub fn encode_cross_crate(&self) -> EncodeCrossCrate {
16 use AttributeKind::*;
17 use EncodeCrossCrate::*;
18
19 match self {
20 Align { .. } => No,
22 AllowConstFnUnstable(..) => No,
23 AllowIncoherentImpl(..) => No,
24 AllowInternalUnsafe(..) => Yes,
25 AllowInternalUnstable(..) => Yes,
26 AsPtr(..) => Yes,
27 AutomaticallyDerived(..) => Yes,
28 BodyStability { .. } => No,
29 Coinductive(..) => No,
30 Cold(..) => No,
31 Confusables { .. } => Yes,
32 ConstContinue(..) => No,
33 ConstStability { .. } => Yes,
34 ConstStabilityIndirect => No,
35 ConstTrait(..) => No,
36 Coroutine(..) => No,
37 Coverage(..) => No,
38 CrateName { .. } => No,
39 CustomMir(_, _, _) => Yes,
40 DebuggerVisualizer(..) => No,
41 DenyExplicitImpl(..) => No,
42 Deprecation { .. } => Yes,
43 DoNotImplementViaObject(..) => No,
44 DocComment { .. } => Yes,
45 Dummy => No,
46 ExportName { .. } => Yes,
47 ExportStable => No,
48 FfiConst(..) => No,
49 FfiPure(..) => No,
50 Fundamental { .. } => Yes,
51 Ignore { .. } => No,
52 Inline(..) => No,
53 Link(..) => No,
54 LinkName { .. } => Yes, LinkOrdinal { .. } => No,
56 LinkSection { .. } => Yes, Linkage(..) => No,
58 LoopMatch(..) => No,
59 MacroEscape(..) => No,
60 MacroExport { .. } => Yes,
61 MacroTransparency(..) => Yes,
62 MacroUse { .. } => No,
63 Marker(..) => No,
64 MayDangle(..) => No,
65 MoveSizeLimit { .. } => No,
66 MustUse { .. } => Yes,
67 Naked(..) => No,
68 NoCore(..) => No,
69 NoImplicitPrelude(..) => No,
70 NoMangle(..) => Yes, NoStd(..) => No,
72 NonExhaustive(..) => Yes, ObjcClass { .. } => No,
74 ObjcSelector { .. } => No,
75 Optimize(..) => No,
76 ParenSugar(..) => No,
77 PassByValue(..) => Yes,
78 Path(..) => No,
79 PatternComplexityLimit { .. } => No,
80 Pointee(..) => No,
81 ProcMacro(..) => No,
82 ProcMacroAttribute(..) => No,
83 ProcMacroDerive { .. } => No,
84 PubTransparent(..) => Yes,
85 RecursionLimit { .. } => No,
86 Repr { .. } => No,
87 RustcBuiltinMacro { .. } => Yes,
88 RustcCoherenceIsCore(..) => No,
89 RustcLayoutScalarValidRangeEnd(..) => Yes,
90 RustcLayoutScalarValidRangeStart(..) => Yes,
91 RustcObjectLifetimeDefault => No,
92 RustcSimdMonomorphizeLaneLimit(..) => Yes, Sanitize { .. } => No,
94 ShouldPanic { .. } => No,
95 SkipDuringMethodDispatch { .. } => No,
96 SpecializationTrait(..) => No,
97 Stability { .. } => Yes,
98 StdInternalSymbol(..) => No,
99 TargetFeature { .. } => No,
100 TrackCaller(..) => Yes,
101 TypeConst(..) => Yes,
102 TypeLengthLimit { .. } => No,
103 UnsafeSpecializationMarker(..) => No,
104 UnstableFeatureBound(..) => No,
105 Used { .. } => No,
106 }
108 }
109}