1use crate::attrs::AttributeKind;
2
3#[derive(#[automatically_derived]
impl ::core::cmp::PartialEq for EncodeCrossCrate {
#[inline]
fn eq(&self, other: &EncodeCrossCrate) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}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 AllowInternalUnsafe(..) => Yes,
22 AllowInternalUnstable(..) => Yes,
23 AutomaticallyDerived => Yes,
24 CfgAttrTrace => Yes,
25 CfgTrace(..) => Yes,
26 CfiEncoding { .. } => Yes,
27 Cold => No,
28 CollapseDebugInfo(..) => Yes,
29 CompilerBuiltins => No,
30 ConstContinue(..) => No,
31 Coroutine => No,
32 Coverage(..) => No,
33 CrateName { .. } => No,
34 CrateType(_) => No,
35 CustomMir(_, _) => Yes,
36 DebuggerVisualizer(..) => No,
37 DefaultLibAllocator => No,
38 Deprecated { .. } => Yes,
39 DoNotRecommend => Yes,
40 Doc(_) => Yes,
41 DocComment { .. } => Yes,
42 EiiDeclaration(_) => Yes,
43 EiiImpls(..) => No,
44 ExportName { .. } => Yes,
45 ExportStable => No,
46 Feature(..) => No,
47 FfiConst => No,
48 FfiPure(..) => No,
49 Fundamental { .. } => Yes,
50 Ignore { .. } => No,
51 Inline(..) => No,
52 InstructionSet(..) => No,
53 Lang(..) => Yes,
54 Link(..) => No,
55 LinkName { .. } => Yes, LinkOrdinal { .. } => No,
57 LinkSection { .. } => Yes, Linkage(..) => No,
59 LoopMatch(..) => No,
60 MacroEscape => No,
61 MacroExport { .. } => Yes,
62 MacroUse { .. } => No,
63 Marker => No,
64 MayDangle(..) => No,
65 MoveSizeLimit { .. } => No,
66 MustNotSupend { .. } => Yes,
67 MustUse { .. } => Yes,
68 Naked(..) => No,
69 NeedsAllocator => No,
70 NeedsPanicRuntime => No,
71 NoBuiltins => Yes,
72 NoCore => No,
73 NoImplicitPrelude => No,
74 NoLink => No,
75 NoMain => No,
76 NoMangle(..) => Yes, NoStd => No,
78 NonExhaustive(..) => Yes, OnConst { .. } => Yes,
80 OnMove { .. } => Yes,
81 OnUnimplemented { .. } => Yes,
82 OnUnknown { .. } => Yes,
83 OnUnmatchArgs { .. } => Yes,
84 Optimize(..) => No,
85 PanicRuntime => No,
86 PatchableFunctionEntry { .. } => Yes,
87 Path(..) => No,
88 PatternComplexityLimit { .. } => No,
89 PinV2 => Yes,
90 PreludeImport => No,
91 ProcMacro => No,
92 ProcMacroAttribute => No,
93 ProcMacroDerive { .. } => No,
94 ProfilerRuntime => No,
95 RecursionLimit { .. } => No,
96 ReexportTestHarnessMain(..) => No,
97 RegisterTool(..) => No,
98 Repr { .. } => No,
99 RustcAbi { .. } => No,
100 RustcAlign { .. } => No,
101 RustcAllocator => No,
102 RustcAllocatorZeroed => No,
103 RustcAllocatorZeroedVariant { .. } => Yes,
104 RustcAllowConstFnUnstable(..) => No,
105 RustcAllowIncoherentImpl(..) => No,
106 RustcAsPtr => Yes,
107 RustcAutodiff(..) => Yes,
108 RustcBodyStability { .. } => No,
109 RustcBuiltinMacro { .. } => Yes,
110 RustcCaptureAnalysis => No,
111 RustcCguTestAttr { .. } => No,
112 RustcClean { .. } => No,
113 RustcCoherenceIsCore => No,
114 RustcCoinductive => No,
115 RustcConfusables { .. } => Yes,
116 RustcConstStability { .. } => Yes,
117 RustcConstStableIndirect => No,
118 RustcConversionSuggestion => Yes,
119 RustcDeallocator => No,
120 RustcDelayedBugFromInsideQuery => No,
121 RustcDenyExplicitImpl => No,
122 RustcDeprecatedSafe2024 { .. } => Yes,
123 RustcDiagnosticItem(..) => Yes,
124 RustcDoNotConstCheck => Yes,
125 RustcDocPrimitive(..) => Yes,
126 RustcDummy => No,
127 RustcDumpDefParents => No,
128 RustcDumpDefPath(..) => No,
129 RustcDumpHiddenTypeOfOpaques => No,
130 RustcDumpInferredOutlives => No,
131 RustcDumpItemBounds => No,
132 RustcDumpLayout(..) => No,
133 RustcDumpObjectLifetimeDefaults => No,
134 RustcDumpPredicates => No,
135 RustcDumpSymbolName(..) => Yes,
136 RustcDumpUserArgs => No,
137 RustcDumpVariances => No,
138 RustcDumpVariancesOfOpaques => No,
139 RustcDumpVtable(..) => No,
140 RustcDynIncompatibleTrait(..) => No,
141 RustcEffectiveVisibility => Yes,
142 RustcEiiForeignItem => No,
143 RustcEvaluateWhereClauses => Yes,
144 RustcHasIncoherentInherentImpls => Yes,
145 RustcIfThisChanged(..) => No,
146 RustcInheritOverflowChecks => No,
147 RustcInsignificantDtor => Yes,
148 RustcIntrinsic => Yes,
149 RustcIntrinsicConstStableIndirect => No,
150 RustcLegacyConstGenerics { .. } => Yes,
151 RustcLintOptDenyFieldAccess { .. } => Yes,
152 RustcLintOptTy => Yes,
153 RustcLintQueryInstability => Yes,
154 RustcLintUntrackedQueryInformation => Yes,
155 RustcMacroTransparency(..) => Yes,
156 RustcMain => No,
157 RustcMir(..) => Yes,
158 RustcMustImplementOneOf { .. } => No,
159 RustcMustMatchExhaustively(..) => Yes,
160 RustcNeverReturnsNullPtr => Yes,
161 RustcNeverTypeOptions { .. } => No,
162 RustcNoImplicitAutorefs => Yes,
163 RustcNoImplicitBounds => No,
164 RustcNoMirInline => Yes,
165 RustcNoWritable => Yes,
166 RustcNonConstTraitMethod => No, RustcNonnullOptimizationGuaranteed => Yes,
168 RustcNounwind => No,
169 RustcObjcClass { .. } => No,
170 RustcObjcSelector { .. } => No,
171 RustcOffloadKernel => Yes,
172 RustcParenSugar => No,
173 RustcPassByValue => Yes,
174 RustcPassIndirectlyInNonRusticAbis(..) => No,
175 RustcPreserveUbChecks => No,
176 RustcProcMacroDecls => No,
177 RustcPubTransparent(..) => Yes,
178 RustcReallocator => No,
179 RustcRegions => No,
180 RustcReservationImpl(..) => Yes,
181 RustcScalableVector { .. } => Yes,
182 RustcShouldNotBeCalledOnConstItems => Yes,
183 RustcSimdMonomorphizeLaneLimit(..) => Yes, RustcSkipDuringMethodDispatch { .. } => No,
185 RustcSpecializationTrait => No,
186 RustcStdInternalSymbol => No,
187 RustcStrictCoherence(..) => Yes,
188 RustcTestMarker(..) => No,
189 RustcThenThisWouldNeed(..) => No,
190 RustcTrivialFieldReads => Yes,
191 RustcUnsafeSpecializationMarker => No,
192 Sanitize { .. } => No,
193 ShouldPanic { .. } => No,
194 Stability { .. } => Yes,
195 TargetFeature { .. } => No,
196 TestRunner(..) => Yes,
197 ThreadLocal => No,
198 TrackCaller(..) => Yes,
199 TypeLengthLimit { .. } => No,
200 UnstableFeatureBound(..) => No,
201 UnstableRemoved(..) => Yes,
202 Used { .. } => No,
203 WindowsSubsystem(..) => No,
204 }
206 }
207}