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 MustUse { .. } => Yes,
65 Naked(..) => No,
66 NoImplicitPrelude(..) => No,
67 NoMangle(..) => Yes, NonExhaustive(..) => Yes, Optimize(..) => No,
70 ParenSugar(..) => No,
71 PassByValue(..) => Yes,
72 Path(..) => No,
73 Pointee(..) => No,
74 ProcMacro(..) => No,
75 ProcMacroAttribute(..) => No,
76 ProcMacroDerive { .. } => No,
77 PubTransparent(..) => Yes,
78 Repr { .. } => No,
79 RustcBuiltinMacro { .. } => Yes,
80 RustcLayoutScalarValidRangeEnd(..) => Yes,
81 RustcLayoutScalarValidRangeStart(..) => Yes,
82 RustcObjectLifetimeDefault => No,
83 Sanitize { .. } => No,
84 ShouldPanic { .. } => No,
85 SkipDuringMethodDispatch { .. } => No,
86 SpecializationTrait(..) => No,
87 Stability { .. } => Yes,
88 StdInternalSymbol(..) => No,
89 TargetFeature { .. } => No,
90 TrackCaller(..) => Yes,
91 TypeConst(..) => Yes,
92 UnsafeSpecializationMarker(..) => No,
93 UnstableFeatureBound(..) => No,
94 Used { .. } => No,
95 }
97 }
98}