rustc_attr_data_structures/
encode_cross_crate.rs

1use crate::AttributeKind;
2
3#[derive(PartialEq)]
4pub enum EncodeCrossCrate {
5    Yes,
6    No,
7}
8
9impl AttributeKind {
10    pub fn encode_cross_crate(&self) -> EncodeCrossCrate {
11        use AttributeKind::*;
12        use EncodeCrossCrate::*;
13
14        match self {
15            // tidy-alphabetical-start
16            Align { .. } => No,
17            AllowConstFnUnstable(..) => No,
18            AllowIncoherentImpl(..) => No,
19            AllowInternalUnstable(..) => Yes,
20            AsPtr(..) => Yes,
21            AutomaticallyDerived(..) => Yes,
22            BodyStability { .. } => No,
23            CoherenceIsCore => No,
24            Coinductive(..) => No,
25            Cold(..) => No,
26            Confusables { .. } => Yes,
27            ConstContinue(..) => No,
28            ConstStability { .. } => Yes,
29            ConstStabilityIndirect => No,
30            ConstTrait(..) => No,
31            Coverage(..) => No,
32            DenyExplicitImpl(..) => No,
33            Deprecation { .. } => Yes,
34            DoNotImplementViaObject(..) => No,
35            DocComment { .. } => Yes,
36            Dummy => No,
37            ExportName { .. } => Yes,
38            ExportStable => No,
39            FfiConst(..) => No,
40            FfiPure(..) => No,
41            Fundamental { .. } => Yes,
42            Ignore { .. } => No,
43            Inline(..) => No,
44            LinkName { .. } => Yes, // Needed for rustdoc
45            LinkOrdinal { .. } => No,
46            LinkSection { .. } => Yes, // Needed for rustdoc
47            LoopMatch(..) => No,
48            MacroTransparency(..) => Yes,
49            Marker(..) => No,
50            MayDangle(..) => No,
51            MustUse { .. } => Yes,
52            Naked(..) => No,
53            NoImplicitPrelude(..) => No,
54            NoMangle(..) => Yes,      // Needed for rustdoc
55            NonExhaustive(..) => Yes, // Needed for rustdoc
56            OmitGdbPrettyPrinterSection => No,
57            Optimize(..) => No,
58            ParenSugar(..) => No,
59            PassByValue(..) => Yes,
60            Path(..) => No,
61            Pointee(..) => No,
62            PubTransparent(..) => Yes,
63            Repr { .. } => No,
64            RustcLayoutScalarValidRangeEnd(..) => Yes,
65            RustcLayoutScalarValidRangeStart(..) => Yes,
66            RustcObjectLifetimeDefault => No,
67            SkipDuringMethodDispatch { .. } => No,
68            SpecializationTrait(..) => No,
69            Stability { .. } => Yes,
70            StdInternalSymbol(..) => No,
71            TargetFeature(..) => No,
72            TrackCaller(..) => Yes,
73            TypeConst(..) => Yes,
74            UnsafeSpecializationMarker(..) => No,
75            UnstableFeatureBound(..) => No,
76            Used { .. } => No,
77            // tidy-alphabetical-end
78        }
79    }
80}