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 Coroutine(..) => No,
36 Coverage(..) => No,
37 CrateName { .. } => No,
38 CustomMir(_, _, _) => Yes,
39 DebuggerVisualizer(..) => No,
40 DenyExplicitImpl(..) => No,
41 Deprecation { .. } => Yes,
42 DoNotImplementViaObject(..) => No,
43 DocComment { .. } => Yes,
44 Dummy => No,
45 ExportName { .. } => Yes,
46 ExportStable => No,
47 FfiConst(..) => No,
48 FfiPure(..) => No,
49 Fundamental { .. } => Yes,
50 Ignore { .. } => No,
51 Inline(..) => No,
52 Link(..) => No,
53 LinkName { .. } => Yes, LinkOrdinal { .. } => No,
55 LinkSection { .. } => Yes, Linkage(..) => No,
57 LoopMatch(..) => No,
58 MacroEscape(..) => No,
59 MacroExport { .. } => Yes,
60 MacroTransparency(..) => Yes,
61 MacroUse { .. } => No,
62 Marker(..) => No,
63 MayDangle(..) => No,
64 MoveSizeLimit { .. } => No,
65 MustUse { .. } => Yes,
66 Naked(..) => No,
67 NoCore(..) => No,
68 NoImplicitPrelude(..) => No,
69 NoMangle(..) => Yes, NoStd(..) => No,
71 NonExhaustive(..) => Yes, ObjcClass { .. } => No,
73 ObjcSelector { .. } => No,
74 Optimize(..) => No,
75 ParenSugar(..) => No,
76 PassByValue(..) => Yes,
77 Path(..) => No,
78 PatternComplexityLimit { .. } => No,
79 PinV2(..) => Yes,
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 RustcMain => No,
92 RustcObjectLifetimeDefault => No,
93 RustcPassIndirectlyInNonRusticAbis(..) => No,
94 RustcShouldNotBeCalledOnConstItems(..) => Yes,
95 RustcSimdMonomorphizeLaneLimit(..) => Yes, Sanitize { .. } => No,
97 ShouldPanic { .. } => No,
98 SkipDuringMethodDispatch { .. } => No,
99 SpecializationTrait(..) => No,
100 Stability { .. } => Yes,
101 StdInternalSymbol(..) => No,
102 TargetFeature { .. } => No,
103 TrackCaller(..) => Yes,
104 TypeConst(..) => Yes,
105 TypeLengthLimit { .. } => No,
106 UnsafeSpecializationMarker(..) => No,
107 UnstableFeatureBound(..) => No,
108 Used { .. } => No,
109 }
111 }
112}