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 PinV2(..) => Yes,
81 Pointee(..) => No,
82 ProcMacro(..) => No,
83 ProcMacroAttribute(..) => No,
84 ProcMacroDerive { .. } => No,
85 PubTransparent(..) => Yes,
86 RecursionLimit { .. } => No,
87 Repr { .. } => No,
88 RustcBuiltinMacro { .. } => Yes,
89 RustcCoherenceIsCore(..) => No,
90 RustcLayoutScalarValidRangeEnd(..) => Yes,
91 RustcLayoutScalarValidRangeStart(..) => Yes,
92 RustcMain => No,
93 RustcObjectLifetimeDefault => No,
94 RustcPassIndirectlyInNonRusticAbis(..) => No,
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}