rustc_hir/attrs/
encode_cross_crate.rs1use 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 CoherenceIsCore => No,
30 Coinductive(..) => No,
31 Cold(..) => No,
32 Confusables { .. } => Yes,
33 ConstContinue(..) => No,
34 ConstStability { .. } => Yes,
35 ConstStabilityIndirect => No,
36 ConstTrait(..) => No,
37 Coroutine(..) => No,
38 Coverage(..) => No,
39 CrateName { .. } => No,
40 CustomMir(_, _, _) => Yes,
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 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, Optimize(..) => No,
73 ParenSugar(..) => No,
74 PassByValue(..) => Yes,
75 Path(..) => No,
76 PatternComplexityLimit { .. } => No,
77 Pointee(..) => No,
78 ProcMacro(..) => No,
79 ProcMacroAttribute(..) => No,
80 ProcMacroDerive { .. } => No,
81 PubTransparent(..) => Yes,
82 RecursionLimit { .. } => No,
83 Repr { .. } => No,
84 RustcBuiltinMacro { .. } => Yes,
85 RustcLayoutScalarValidRangeEnd(..) => Yes,
86 RustcLayoutScalarValidRangeStart(..) => Yes,
87 RustcObjectLifetimeDefault => No,
88 Sanitize { .. } => No,
89 ShouldPanic { .. } => No,
90 SkipDuringMethodDispatch { .. } => No,
91 SpecializationTrait(..) => No,
92 Stability { .. } => Yes,
93 StdInternalSymbol(..) => No,
94 TargetFeature { .. } => No,
95 TrackCaller(..) => Yes,
96 TypeConst(..) => Yes,
97 TypeLengthLimit { .. } => No,
98 UnsafeSpecializationMarker(..) => No,
99 UnstableFeatureBound(..) => No,
100 Used { .. } => No,
101 }
103 }
104}