1use std::marker::PhantomData;
2use std::num::NonZero;
3
4use decoder::LazyDecoder;
5pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob, TargetModifiers};
6use def_path_hash_map::DefPathHashMapRef;
7use encoder::EncodeContext;
8pub use encoder::{EncodedMetadata, encode_metadata, rendered_const};
9pub(crate) use parameterized::ParameterizedOverTcx;
10use rustc_abi::{FieldIdx, ReprOptions, VariantIdx};
11use rustc_ast as ast;
12use rustc_data_structures::fx::FxHashMap;
13use rustc_data_structures::svh::Svh;
14use rustc_hir as hir;
15use rustc_hir::attrs::StrippedCfgItem;
16use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap, MacroKinds};
17use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIndex, DefPathHash, StableCrateId};
18use rustc_hir::definitions::DefKey;
19use rustc_hir::lang_items::LangItem;
20use rustc_hir::{PreciseCapturingArgKind, attrs};
21use rustc_index::IndexVec;
22use rustc_index::bit_set::DenseBitSet;
23use rustc_macros::{
24 BlobDecodable, Decodable, Encodable, LazyDecodable, MetadataEncodable, TyDecodable, TyEncodable,
25};
26use rustc_middle::metadata::{AmbigModChild, ModChild};
27use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
28use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
29use rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs;
30use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
31use rustc_middle::middle::lib_features::FeatureStability;
32use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
33use rustc_middle::mir;
34use rustc_middle::mir::ConstValue;
35use rustc_middle::ty::fast_reject::SimplifiedType;
36use rustc_middle::ty::{self, Ty, TyCtxt};
37use rustc_middle::util::Providers;
38use rustc_serialize::opaque::FileEncoder;
39use rustc_session::config::mitigation_coverage::DeniedPartialMitigation;
40use rustc_session::config::{SymbolManglingVersion, TargetModifier};
41use rustc_session::cstore::{CrateDepKind, ForeignModule, LinkagePreference, NativeLib};
42use rustc_span::edition::Edition;
43use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextKey};
44use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Ident, Span, Symbol};
45use rustc_target::spec::{PanicStrategy, TargetTuple};
46use table::TableBuilder;
47
48use crate::eii::EiiMapEncodedKeyValue;
49
50mod decoder;
51mod def_path_hash_map;
52mod encoder;
53mod parameterized;
54mod table;
55
56pub(crate) fn rustc_version(cfg_version: &'static str) -> String {
57 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("rustc {0}", cfg_version))
})format!("rustc {cfg_version}")
58}
59
60const METADATA_VERSION: u8 = 10;
64
65pub const METADATA_HEADER: &[u8] = &[b'r', b'u', b's', b't', 0, 0, 0, METADATA_VERSION];
71
72#[must_use]
88struct LazyValue<T> {
89 position: NonZero<usize>,
90 _marker: PhantomData<fn() -> T>,
91}
92
93impl<T> LazyValue<T> {
94 fn from_position(position: NonZero<usize>) -> LazyValue<T> {
95 LazyValue { position, _marker: PhantomData }
96 }
97}
98
99struct LazyArray<T> {
110 position: NonZero<usize>,
111 num_elems: usize,
112 _marker: PhantomData<fn() -> T>,
113}
114
115impl<T> Default for LazyArray<T> {
116 fn default() -> LazyArray<T> {
117 LazyArray::from_position_and_num_elems(NonZero::new(1).unwrap(), 0)
118 }
119}
120
121impl<T> LazyArray<T> {
122 fn from_position_and_num_elems(position: NonZero<usize>, num_elems: usize) -> LazyArray<T> {
123 LazyArray { position, num_elems, _marker: PhantomData }
124 }
125}
126
127struct LazyTable<I, T> {
133 position: NonZero<usize>,
134 width: usize,
137 len: usize,
139 _marker: PhantomData<fn(I) -> T>,
140}
141
142impl<I, T> LazyTable<I, T> {
143 fn from_position_and_encoded_size(
144 position: NonZero<usize>,
145 width: usize,
146 len: usize,
147 ) -> LazyTable<I, T> {
148 LazyTable { position, width, len, _marker: PhantomData }
149 }
150}
151
152impl<T> Copy for LazyValue<T> {}
153impl<T> Clone for LazyValue<T> {
154 fn clone(&self) -> Self {
155 *self
156 }
157}
158
159impl<T> Copy for LazyArray<T> {}
160impl<T> Clone for LazyArray<T> {
161 fn clone(&self) -> Self {
162 *self
163 }
164}
165
166impl<I, T> Copy for LazyTable<I, T> {}
167impl<I, T> Clone for LazyTable<I, T> {
168 fn clone(&self) -> Self {
169 *self
170 }
171}
172
173#[derive(#[automatically_derived]
impl ::core::marker::Copy for LazyState { }Copy, #[automatically_derived]
impl ::core::clone::Clone for LazyState {
#[inline]
fn clone(&self) -> LazyState {
let _: ::core::clone::AssertParamIsClone<NonZero<usize>>;
let _: ::core::clone::AssertParamIsClone<NonZero<usize>>;
*self
}
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for LazyState {
#[inline]
fn eq(&self, other: &LazyState) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr &&
match (self, other) {
(LazyState::NodeStart(__self_0),
LazyState::NodeStart(__arg1_0)) => __self_0 == __arg1_0,
(LazyState::Previous(__self_0), LazyState::Previous(__arg1_0))
=> __self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for LazyState {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<NonZero<usize>>;
let _: ::core::cmp::AssertParamIsEq<NonZero<usize>>;
}
}Eq, #[automatically_derived]
impl ::core::fmt::Debug for LazyState {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
LazyState::NoNode =>
::core::fmt::Formatter::write_str(f, "NoNode"),
LazyState::NodeStart(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"NodeStart", &__self_0),
LazyState::Previous(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Previous", &__self_0),
}
}
}Debug)]
175enum LazyState {
176 NoNode,
178
179 NodeStart(NonZero<usize>),
182
183 Previous(NonZero<usize>),
186}
187
188type SyntaxContextTable = LazyTable<u32, Option<LazyValue<SyntaxContextKey>>>;
189type ExpnDataTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnData>>>;
190type ExpnHashTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnHash>>>;
191
192#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
ProcMacroData {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
ProcMacroData {
proc_macro_decls_static: ref __binding_0,
stability: ref __binding_1,
macros: ref __binding_2 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_2, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for
ProcMacroData {
fn decode(__decoder: &mut __D) -> Self {
ProcMacroData {
proc_macro_decls_static: ::rustc_serialize::Decodable::decode(__decoder),
stability: ::rustc_serialize::Decodable::decode(__decoder),
macros: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};LazyDecodable)]
193pub(crate) struct ProcMacroData {
194 proc_macro_decls_static: DefIndex,
195 stability: Option<hir::Stability>,
196 macros: LazyArray<DefIndex>,
197}
198
199#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
CrateHeader {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
CrateHeader {
triple: ref __binding_0,
hash: ref __binding_1,
name: ref __binding_2,
is_proc_macro_crate: ref __binding_3,
is_stub: ref __binding_4 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_2, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_3, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_4, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
for CrateHeader {
fn decode(__decoder: &mut __D) -> Self {
CrateHeader {
triple: ::rustc_serialize::Decodable::decode(__decoder),
hash: ::rustc_serialize::Decodable::decode(__decoder),
name: ::rustc_serialize::Decodable::decode(__decoder),
is_proc_macro_crate: ::rustc_serialize::Decodable::decode(__decoder),
is_stub: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};BlobDecodable)]
207pub(crate) struct CrateHeader {
208 pub(crate) triple: TargetTuple,
209 pub(crate) hash: Svh,
210 pub(crate) name: Symbol,
211 pub(crate) is_proc_macro_crate: bool,
216 pub(crate) is_stub: bool,
222}
223
224#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
CrateRoot {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
CrateRoot {
header: ref __binding_0,
extra_filename: ref __binding_1,
stable_crate_id: ref __binding_2,
required_panic_strategy: ref __binding_3,
panic_in_drop_strategy: ref __binding_4,
edition: ref __binding_5,
has_global_allocator: ref __binding_6,
has_alloc_error_handler: ref __binding_7,
has_panic_handler: ref __binding_8,
has_default_lib_allocator: ref __binding_9,
externally_implementable_items: ref __binding_10,
crate_deps: ref __binding_11,
dylib_dependency_formats: ref __binding_12,
lib_features: ref __binding_13,
stability_implications: ref __binding_14,
lang_items: ref __binding_15,
lang_items_missing: ref __binding_16,
stripped_cfg_items: ref __binding_17,
diagnostic_items: ref __binding_18,
native_libraries: ref __binding_19,
foreign_modules: ref __binding_20,
traits: ref __binding_21,
impls: ref __binding_22,
incoherent_impls: ref __binding_23,
interpret_alloc_index: ref __binding_24,
proc_macro_data: ref __binding_25,
tables: ref __binding_26,
debugger_visualizers: ref __binding_27,
exportable_items: ref __binding_28,
stable_order_of_exportable_impls: ref __binding_29,
exported_non_generic_symbols: ref __binding_30,
exported_generic_symbols: ref __binding_31,
syntax_contexts: ref __binding_32,
expn_data: ref __binding_33,
expn_hashes: ref __binding_34,
def_path_hash_map: ref __binding_35,
source_map: ref __binding_36,
target_modifiers: ref __binding_37,
denied_partial_mitigations: ref __binding_38,
compiler_builtins: ref __binding_39,
needs_allocator: ref __binding_40,
needs_panic_runtime: ref __binding_41,
no_builtins: ref __binding_42,
panic_runtime: ref __binding_43,
profiler_runtime: ref __binding_44,
symbol_mangling_version: ref __binding_45,
specialization_enabled_in: ref __binding_46 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_2, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_3, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_4, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_5, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_6, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_7, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_8, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_9, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_10, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_11, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_12, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_13, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_14, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_15, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_16, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_17, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_18, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_19, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_20, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_21, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_22, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_23, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_24, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_25, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_26, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_27, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_28, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_29, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_30, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_31, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_32, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_33, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_34, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_35, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_36, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_37, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_38, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_39, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_40, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_41, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_42, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_43, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_44, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_45, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_46, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for CrateRoot
{
fn decode(__decoder: &mut __D) -> Self {
CrateRoot {
header: ::rustc_serialize::Decodable::decode(__decoder),
extra_filename: ::rustc_serialize::Decodable::decode(__decoder),
stable_crate_id: ::rustc_serialize::Decodable::decode(__decoder),
required_panic_strategy: ::rustc_serialize::Decodable::decode(__decoder),
panic_in_drop_strategy: ::rustc_serialize::Decodable::decode(__decoder),
edition: ::rustc_serialize::Decodable::decode(__decoder),
has_global_allocator: ::rustc_serialize::Decodable::decode(__decoder),
has_alloc_error_handler: ::rustc_serialize::Decodable::decode(__decoder),
has_panic_handler: ::rustc_serialize::Decodable::decode(__decoder),
has_default_lib_allocator: ::rustc_serialize::Decodable::decode(__decoder),
externally_implementable_items: ::rustc_serialize::Decodable::decode(__decoder),
crate_deps: ::rustc_serialize::Decodable::decode(__decoder),
dylib_dependency_formats: ::rustc_serialize::Decodable::decode(__decoder),
lib_features: ::rustc_serialize::Decodable::decode(__decoder),
stability_implications: ::rustc_serialize::Decodable::decode(__decoder),
lang_items: ::rustc_serialize::Decodable::decode(__decoder),
lang_items_missing: ::rustc_serialize::Decodable::decode(__decoder),
stripped_cfg_items: ::rustc_serialize::Decodable::decode(__decoder),
diagnostic_items: ::rustc_serialize::Decodable::decode(__decoder),
native_libraries: ::rustc_serialize::Decodable::decode(__decoder),
foreign_modules: ::rustc_serialize::Decodable::decode(__decoder),
traits: ::rustc_serialize::Decodable::decode(__decoder),
impls: ::rustc_serialize::Decodable::decode(__decoder),
incoherent_impls: ::rustc_serialize::Decodable::decode(__decoder),
interpret_alloc_index: ::rustc_serialize::Decodable::decode(__decoder),
proc_macro_data: ::rustc_serialize::Decodable::decode(__decoder),
tables: ::rustc_serialize::Decodable::decode(__decoder),
debugger_visualizers: ::rustc_serialize::Decodable::decode(__decoder),
exportable_items: ::rustc_serialize::Decodable::decode(__decoder),
stable_order_of_exportable_impls: ::rustc_serialize::Decodable::decode(__decoder),
exported_non_generic_symbols: ::rustc_serialize::Decodable::decode(__decoder),
exported_generic_symbols: ::rustc_serialize::Decodable::decode(__decoder),
syntax_contexts: ::rustc_serialize::Decodable::decode(__decoder),
expn_data: ::rustc_serialize::Decodable::decode(__decoder),
expn_hashes: ::rustc_serialize::Decodable::decode(__decoder),
def_path_hash_map: ::rustc_serialize::Decodable::decode(__decoder),
source_map: ::rustc_serialize::Decodable::decode(__decoder),
target_modifiers: ::rustc_serialize::Decodable::decode(__decoder),
denied_partial_mitigations: ::rustc_serialize::Decodable::decode(__decoder),
compiler_builtins: ::rustc_serialize::Decodable::decode(__decoder),
needs_allocator: ::rustc_serialize::Decodable::decode(__decoder),
needs_panic_runtime: ::rustc_serialize::Decodable::decode(__decoder),
no_builtins: ::rustc_serialize::Decodable::decode(__decoder),
panic_runtime: ::rustc_serialize::Decodable::decode(__decoder),
profiler_runtime: ::rustc_serialize::Decodable::decode(__decoder),
symbol_mangling_version: ::rustc_serialize::Decodable::decode(__decoder),
specialization_enabled_in: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};LazyDecodable)]
242pub(crate) struct CrateRoot {
243 header: CrateHeader,
245
246 extra_filename: String,
247 stable_crate_id: StableCrateId,
248 required_panic_strategy: Option<PanicStrategy>,
249 panic_in_drop_strategy: PanicStrategy,
250 edition: Edition,
251 has_global_allocator: bool,
252 has_alloc_error_handler: bool,
253 has_panic_handler: bool,
254 has_default_lib_allocator: bool,
255 externally_implementable_items: LazyArray<EiiMapEncodedKeyValue>,
256
257 crate_deps: LazyArray<CrateDep>,
258 dylib_dependency_formats: LazyArray<Option<LinkagePreference>>,
259 lib_features: LazyArray<(Symbol, FeatureStability)>,
260 stability_implications: LazyArray<(Symbol, Symbol)>,
261 lang_items: LazyArray<(DefIndex, LangItem)>,
262 lang_items_missing: LazyArray<LangItem>,
263 stripped_cfg_items: LazyArray<StrippedCfgItem<DefIndex>>,
264 diagnostic_items: LazyArray<(Symbol, DefIndex)>,
265 native_libraries: LazyArray<NativeLib>,
266 foreign_modules: LazyArray<ForeignModule>,
267 traits: LazyArray<DefIndex>,
268 impls: LazyArray<TraitImpls>,
269 incoherent_impls: LazyArray<IncoherentImpls>,
270 interpret_alloc_index: LazyArray<u64>,
271 proc_macro_data: Option<ProcMacroData>,
272
273 tables: LazyTables,
274 debugger_visualizers: LazyArray<DebuggerVisualizerFile>,
275
276 exportable_items: LazyArray<DefIndex>,
277 stable_order_of_exportable_impls: LazyArray<(DefIndex, usize)>,
278 exported_non_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
279 exported_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
280
281 syntax_contexts: SyntaxContextTable,
282 expn_data: ExpnDataTable,
283 expn_hashes: ExpnHashTable,
284
285 def_path_hash_map: LazyValue<DefPathHashMapRef<'static>>,
286
287 source_map: LazyTable<u32, Option<LazyValue<rustc_span::SourceFile>>>,
288 target_modifiers: LazyArray<TargetModifier>,
289 denied_partial_mitigations: LazyArray<DeniedPartialMitigation>,
290
291 compiler_builtins: bool,
292 needs_allocator: bool,
293 needs_panic_runtime: bool,
294 no_builtins: bool,
295 panic_runtime: bool,
296 profiler_runtime: bool,
297 symbol_mangling_version: SymbolManglingVersion,
298
299 specialization_enabled_in: bool,
300}
301
302#[derive(#[automatically_derived]
impl ::core::marker::Copy for RawDefId { }Copy, #[automatically_derived]
impl ::core::clone::Clone for RawDefId {
#[inline]
fn clone(&self) -> RawDefId {
let _: ::core::clone::AssertParamIsClone<u32>;
*self
}
}Clone)]
306pub(crate) struct RawDefId {
307 krate: u32,
308 index: u32,
309}
310
311impl From<DefId> for RawDefId {
312 fn from(val: DefId) -> Self {
313 RawDefId { krate: val.krate.as_u32(), index: val.index.as_u32() }
314 }
315}
316
317impl RawDefId {
318 fn decode(self, meta: (&CrateMetadata, TyCtxt<'_>)) -> DefId {
320 let krate = CrateNum::from_u32(self.krate);
321 let krate = meta.0.map_encoded_cnum_to_current(krate);
322 DefId { krate, index: DefIndex::from_u32(self.index) }
323 }
324}
325
326#[derive(const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for CrateDep {
fn encode(&self, __encoder: &mut __E) {
match *self {
CrateDep {
name: ref __binding_0,
hash: ref __binding_1,
host_hash: ref __binding_2,
kind: ref __binding_3,
extra_filename: ref __binding_4,
is_private: ref __binding_5 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_4,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_5,
__encoder);
}
}
}
}
};Encodable, const _: () =
{
impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
for CrateDep {
fn decode(__decoder: &mut __D) -> Self {
CrateDep {
name: ::rustc_serialize::Decodable::decode(__decoder),
hash: ::rustc_serialize::Decodable::decode(__decoder),
host_hash: ::rustc_serialize::Decodable::decode(__decoder),
kind: ::rustc_serialize::Decodable::decode(__decoder),
extra_filename: ::rustc_serialize::Decodable::decode(__decoder),
is_private: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};BlobDecodable)]
327pub(crate) struct CrateDep {
328 pub name: Symbol,
329 pub hash: Svh,
330 pub host_hash: Option<Svh>,
331 pub kind: CrateDepKind,
332 pub extra_filename: String,
333 pub is_private: bool,
334}
335
336#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
TraitImpls {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
TraitImpls {
trait_id: ref __binding_0, impls: ref __binding_1 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for
TraitImpls {
fn decode(__decoder: &mut __D) -> Self {
TraitImpls {
trait_id: ::rustc_serialize::Decodable::decode(__decoder),
impls: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};LazyDecodable)]
337pub(crate) struct TraitImpls {
338 trait_id: (u32, DefIndex),
339 impls: LazyArray<(DefIndex, Option<SimplifiedType>)>,
340}
341
342#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
IncoherentImpls {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
IncoherentImpls {
self_ty: ref __binding_0, impls: ref __binding_1 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for
IncoherentImpls {
fn decode(__decoder: &mut __D) -> Self {
IncoherentImpls {
self_ty: ::rustc_serialize::Decodable::decode(__decoder),
impls: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};LazyDecodable)]
343pub(crate) struct IncoherentImpls {
344 self_ty: LazyValue<SimplifiedType>,
345 impls: LazyArray<DefIndex>,
346}
347
348macro_rules! define_tables {
350 (
351 - defaulted: $($name1:ident: Table<$IDX1:ty, $T1:ty>,)+
352 - optional: $($name2:ident: Table<$IDX2:ty, $T2:ty>,)+
353 ) => {
354 #[derive(MetadataEncodable, LazyDecodable)]
355 pub(crate) struct LazyTables {
356 $($name1: LazyTable<$IDX1, $T1>,)+
357 $($name2: LazyTable<$IDX2, Option<$T2>>,)+
358 }
359
360 #[derive(Default)]
361 struct TableBuilders {
362 $($name1: TableBuilder<$IDX1, $T1>,)+
363 $($name2: TableBuilder<$IDX2, Option<$T2>>,)+
364 }
365
366 impl TableBuilders {
367 fn encode(&self, buf: &mut FileEncoder) -> LazyTables {
368 LazyTables {
369 $($name1: self.$name1.encode(buf),)+
370 $($name2: self.$name2.encode(buf),)+
371 }
372 }
373 }
374 }
375}
376
377pub(crate) struct LazyTables {
intrinsic: LazyTable<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
is_macro_rules: LazyTable<DefIndex, bool>,
type_alias_is_lazy: LazyTable<DefIndex, bool>,
attr_flags: LazyTable<DefIndex, AttrFlags>,
def_path_hashes: LazyTable<DefIndex, u64>,
explicit_item_bounds: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_item_self_bounds: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
inferred_outlives_of: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_super_predicates_of: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_predicates_of: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_const_bounds: LazyTable<DefIndex,
LazyArray<(ty::PolyTraitRef<'static>, Span)>>,
inherent_impls: LazyTable<DefIndex, LazyArray<DefIndex>>,
opt_rpitit_info: LazyTable<DefIndex,
Option<LazyValue<ty::ImplTraitInTraitData>>>,
module_children_reexports: LazyTable<DefIndex, LazyArray<ModChild>>,
ambig_module_children: LazyTable<DefIndex, LazyArray<AmbigModChild>>,
cross_crate_inlinable: LazyTable<DefIndex, bool>,
asyncness: LazyTable<DefIndex, ty::Asyncness>,
constness: LazyTable<DefIndex, hir::Constness>,
safety: LazyTable<DefIndex, hir::Safety>,
defaultness: LazyTable<DefIndex, hir::Defaultness>,
attributes: LazyTable<DefIndex, Option<LazyArray<hir::Attribute>>>,
module_children_non_reexports: LazyTable<DefIndex,
Option<LazyArray<DefIndex>>>,
associated_item_or_field_def_ids: LazyTable<DefIndex,
Option<LazyArray<DefIndex>>>,
def_kind: LazyTable<DefIndex, Option<DefKind>>,
visibility: LazyTable<DefIndex,
Option<LazyValue<ty::Visibility<DefIndex>>>>,
def_span: LazyTable<DefIndex, Option<LazyValue<Span>>>,
def_ident_span: LazyTable<DefIndex, Option<LazyValue<Span>>>,
lookup_stability: LazyTable<DefIndex, Option<LazyValue<hir::Stability>>>,
lookup_const_stability: LazyTable<DefIndex,
Option<LazyValue<hir::ConstStability>>>,
lookup_default_body_stability: LazyTable<DefIndex,
Option<LazyValue<hir::DefaultBodyStability>>>,
lookup_deprecation_entry: LazyTable<DefIndex,
Option<LazyValue<attrs::Deprecation>>>,
explicit_predicates_of: LazyTable<DefIndex,
Option<LazyValue<ty::GenericPredicates<'static>>>>,
generics_of: LazyTable<DefIndex, Option<LazyValue<ty::Generics>>>,
type_of: LazyTable<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>>,
variances_of: LazyTable<DefIndex, Option<LazyArray<ty::Variance>>>,
fn_sig: LazyTable<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>>,
codegen_fn_attrs: LazyTable<DefIndex, Option<LazyValue<CodegenFnAttrs>>>,
impl_trait_header: LazyTable<DefIndex,
Option<LazyValue<ty::ImplTraitHeader<'static>>>>,
const_param_default: LazyTable<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static,
rustc_middle::ty::Const<'static>>>>>,
object_lifetime_default: LazyTable<DefIndex,
Option<LazyValue<ObjectLifetimeDefault>>>,
optimized_mir: LazyTable<DefIndex, Option<LazyValue<mir::Body<'static>>>>,
mir_for_ctfe: LazyTable<DefIndex, Option<LazyValue<mir::Body<'static>>>>,
trivial_const: LazyTable<DefIndex,
Option<LazyValue<(ConstValue, Ty<'static>)>>>,
closure_saved_names_of_captured_variables: LazyTable<DefIndex,
Option<LazyValue<IndexVec<FieldIdx, Symbol>>>>,
mir_coroutine_witnesses: LazyTable<DefIndex,
Option<LazyValue<mir::CoroutineLayout<'static>>>>,
promoted_mir: LazyTable<DefIndex,
Option<LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>>,
thir_abstract_const: LazyTable<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>>,
impl_parent: LazyTable<DefIndex, Option<RawDefId>>,
const_conditions: LazyTable<DefIndex,
Option<LazyValue<ty::ConstConditions<'static>>>>,
coerce_unsized_info: LazyTable<DefIndex,
Option<LazyValue<ty::adjustment::CoerceUnsizedInfo>>>,
mir_const_qualif: LazyTable<DefIndex,
Option<LazyValue<mir::ConstQualifs>>>,
rendered_const: LazyTable<DefIndex, Option<LazyValue<String>>>,
rendered_precise_capturing_args: LazyTable<DefIndex,
Option<LazyArray<PreciseCapturingArgKind<Symbol, Symbol>>>>,
fn_arg_idents: LazyTable<DefIndex, Option<LazyArray<Option<Ident>>>>,
coroutine_kind: LazyTable<DefIndex, Option<hir::CoroutineKind>>,
coroutine_for_closure: LazyTable<DefIndex, Option<RawDefId>>,
adt_destructor: LazyTable<DefIndex, Option<LazyValue<ty::Destructor>>>,
adt_async_destructor: LazyTable<DefIndex,
Option<LazyValue<ty::AsyncDestructor>>>,
coroutine_by_move_body_def_id: LazyTable<DefIndex, Option<RawDefId>>,
eval_static_initializer: LazyTable<DefIndex,
Option<LazyValue<mir::interpret::ConstAllocation<'static>>>>,
trait_def: LazyTable<DefIndex, Option<LazyValue<ty::TraitDef>>>,
expn_that_defined: LazyTable<DefIndex, Option<LazyValue<ExpnId>>>,
default_fields: LazyTable<DefIndex, Option<LazyValue<DefId>>>,
params_in_repr: LazyTable<DefIndex, Option<LazyValue<DenseBitSet<u32>>>>,
repr_options: LazyTable<DefIndex, Option<LazyValue<ReprOptions>>>,
def_keys: LazyTable<DefIndex, Option<LazyValue<DefKey>>>,
proc_macro_quoted_spans: LazyTable<usize, Option<LazyValue<Span>>>,
variant_data: LazyTable<DefIndex, Option<LazyValue<VariantData>>>,
assoc_container: LazyTable<DefIndex,
Option<LazyValue<ty::AssocContainer>>>,
macro_definition: LazyTable<DefIndex, Option<LazyValue<ast::DelimArgs>>>,
proc_macro: LazyTable<DefIndex, Option<MacroKind>>,
deduced_param_attrs: LazyTable<DefIndex,
Option<LazyArray<DeducedParamAttrs>>>,
trait_impl_trait_tys: LazyTable<DefIndex,
Option<LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>>,
doc_link_resolutions: LazyTable<DefIndex,
Option<LazyValue<DocLinkResMap>>>,
doc_link_traits_in_scope: LazyTable<DefIndex, Option<LazyArray<DefId>>>,
assumed_wf_types_for_rpitit: LazyTable<DefIndex,
Option<LazyArray<(Ty<'static>, Span)>>>,
opaque_ty_origin: LazyTable<DefIndex,
Option<LazyValue<hir::OpaqueTyOrigin<DefId>>>>,
anon_const_kind: LazyTable<DefIndex,
Option<LazyValue<ty::AnonConstKind>>>,
const_of_item: LazyTable<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>>,
associated_types_for_impl_traits_in_trait_or_impl: LazyTable<DefIndex,
Option<LazyValue<DefIdMap<Vec<DefId>>>>>,
}
const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
LazyTables {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
match *self {
LazyTables {
intrinsic: ref __binding_0,
is_macro_rules: ref __binding_1,
type_alias_is_lazy: ref __binding_2,
attr_flags: ref __binding_3,
def_path_hashes: ref __binding_4,
explicit_item_bounds: ref __binding_5,
explicit_item_self_bounds: ref __binding_6,
inferred_outlives_of: ref __binding_7,
explicit_super_predicates_of: ref __binding_8,
explicit_implied_predicates_of: ref __binding_9,
explicit_implied_const_bounds: ref __binding_10,
inherent_impls: ref __binding_11,
opt_rpitit_info: ref __binding_12,
module_children_reexports: ref __binding_13,
ambig_module_children: ref __binding_14,
cross_crate_inlinable: ref __binding_15,
asyncness: ref __binding_16,
constness: ref __binding_17,
safety: ref __binding_18,
defaultness: ref __binding_19,
attributes: ref __binding_20,
module_children_non_reexports: ref __binding_21,
associated_item_or_field_def_ids: ref __binding_22,
def_kind: ref __binding_23,
visibility: ref __binding_24,
def_span: ref __binding_25,
def_ident_span: ref __binding_26,
lookup_stability: ref __binding_27,
lookup_const_stability: ref __binding_28,
lookup_default_body_stability: ref __binding_29,
lookup_deprecation_entry: ref __binding_30,
explicit_predicates_of: ref __binding_31,
generics_of: ref __binding_32,
type_of: ref __binding_33,
variances_of: ref __binding_34,
fn_sig: ref __binding_35,
codegen_fn_attrs: ref __binding_36,
impl_trait_header: ref __binding_37,
const_param_default: ref __binding_38,
object_lifetime_default: ref __binding_39,
optimized_mir: ref __binding_40,
mir_for_ctfe: ref __binding_41,
trivial_const: ref __binding_42,
closure_saved_names_of_captured_variables: ref __binding_43,
mir_coroutine_witnesses: ref __binding_44,
promoted_mir: ref __binding_45,
thir_abstract_const: ref __binding_46,
impl_parent: ref __binding_47,
const_conditions: ref __binding_48,
coerce_unsized_info: ref __binding_49,
mir_const_qualif: ref __binding_50,
rendered_const: ref __binding_51,
rendered_precise_capturing_args: ref __binding_52,
fn_arg_idents: ref __binding_53,
coroutine_kind: ref __binding_54,
coroutine_for_closure: ref __binding_55,
adt_destructor: ref __binding_56,
adt_async_destructor: ref __binding_57,
coroutine_by_move_body_def_id: ref __binding_58,
eval_static_initializer: ref __binding_59,
trait_def: ref __binding_60,
expn_that_defined: ref __binding_61,
default_fields: ref __binding_62,
params_in_repr: ref __binding_63,
repr_options: ref __binding_64,
def_keys: ref __binding_65,
proc_macro_quoted_spans: ref __binding_66,
variant_data: ref __binding_67,
assoc_container: ref __binding_68,
macro_definition: ref __binding_69,
proc_macro: ref __binding_70,
deduced_param_attrs: ref __binding_71,
trait_impl_trait_tys: ref __binding_72,
doc_link_resolutions: ref __binding_73,
doc_link_traits_in_scope: ref __binding_74,
assumed_wf_types_for_rpitit: ref __binding_75,
opaque_ty_origin: ref __binding_76,
anon_const_kind: ref __binding_77,
const_of_item: ref __binding_78,
associated_types_for_impl_traits_in_trait_or_impl: ref __binding_79
} => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_2, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_3, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_4, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_5, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_6, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_7, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_8, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_9, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_10, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_11, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_12, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_13, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_14, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_15, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_16, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_17, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_18, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_19, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_20, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_21, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_22, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_23, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_24, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_25, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_26, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_27, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_28, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_29, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_30, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_31, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_32, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_33, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_34, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_35, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_36, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_37, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_38, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_39, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_40, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_41, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_42, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_43, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_44, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_45, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_46, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_47, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_48, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_49, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_50, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_51, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_52, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_53, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_54, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_55, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_56, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_57, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_58, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_59, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_60, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_61, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_62, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_63, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_64, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_65, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_66, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_67, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_68, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_69, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_70, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_71, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_72, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_73, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_74, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_75, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_76, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_77, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_78, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_79, __encoder);
}
}
}
}
};
const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for
LazyTables {
fn decode(__decoder: &mut __D) -> Self {
LazyTables {
intrinsic: ::rustc_serialize::Decodable::decode(__decoder),
is_macro_rules: ::rustc_serialize::Decodable::decode(__decoder),
type_alias_is_lazy: ::rustc_serialize::Decodable::decode(__decoder),
attr_flags: ::rustc_serialize::Decodable::decode(__decoder),
def_path_hashes: ::rustc_serialize::Decodable::decode(__decoder),
explicit_item_bounds: ::rustc_serialize::Decodable::decode(__decoder),
explicit_item_self_bounds: ::rustc_serialize::Decodable::decode(__decoder),
inferred_outlives_of: ::rustc_serialize::Decodable::decode(__decoder),
explicit_super_predicates_of: ::rustc_serialize::Decodable::decode(__decoder),
explicit_implied_predicates_of: ::rustc_serialize::Decodable::decode(__decoder),
explicit_implied_const_bounds: ::rustc_serialize::Decodable::decode(__decoder),
inherent_impls: ::rustc_serialize::Decodable::decode(__decoder),
opt_rpitit_info: ::rustc_serialize::Decodable::decode(__decoder),
module_children_reexports: ::rustc_serialize::Decodable::decode(__decoder),
ambig_module_children: ::rustc_serialize::Decodable::decode(__decoder),
cross_crate_inlinable: ::rustc_serialize::Decodable::decode(__decoder),
asyncness: ::rustc_serialize::Decodable::decode(__decoder),
constness: ::rustc_serialize::Decodable::decode(__decoder),
safety: ::rustc_serialize::Decodable::decode(__decoder),
defaultness: ::rustc_serialize::Decodable::decode(__decoder),
attributes: ::rustc_serialize::Decodable::decode(__decoder),
module_children_non_reexports: ::rustc_serialize::Decodable::decode(__decoder),
associated_item_or_field_def_ids: ::rustc_serialize::Decodable::decode(__decoder),
def_kind: ::rustc_serialize::Decodable::decode(__decoder),
visibility: ::rustc_serialize::Decodable::decode(__decoder),
def_span: ::rustc_serialize::Decodable::decode(__decoder),
def_ident_span: ::rustc_serialize::Decodable::decode(__decoder),
lookup_stability: ::rustc_serialize::Decodable::decode(__decoder),
lookup_const_stability: ::rustc_serialize::Decodable::decode(__decoder),
lookup_default_body_stability: ::rustc_serialize::Decodable::decode(__decoder),
lookup_deprecation_entry: ::rustc_serialize::Decodable::decode(__decoder),
explicit_predicates_of: ::rustc_serialize::Decodable::decode(__decoder),
generics_of: ::rustc_serialize::Decodable::decode(__decoder),
type_of: ::rustc_serialize::Decodable::decode(__decoder),
variances_of: ::rustc_serialize::Decodable::decode(__decoder),
fn_sig: ::rustc_serialize::Decodable::decode(__decoder),
codegen_fn_attrs: ::rustc_serialize::Decodable::decode(__decoder),
impl_trait_header: ::rustc_serialize::Decodable::decode(__decoder),
const_param_default: ::rustc_serialize::Decodable::decode(__decoder),
object_lifetime_default: ::rustc_serialize::Decodable::decode(__decoder),
optimized_mir: ::rustc_serialize::Decodable::decode(__decoder),
mir_for_ctfe: ::rustc_serialize::Decodable::decode(__decoder),
trivial_const: ::rustc_serialize::Decodable::decode(__decoder),
closure_saved_names_of_captured_variables: ::rustc_serialize::Decodable::decode(__decoder),
mir_coroutine_witnesses: ::rustc_serialize::Decodable::decode(__decoder),
promoted_mir: ::rustc_serialize::Decodable::decode(__decoder),
thir_abstract_const: ::rustc_serialize::Decodable::decode(__decoder),
impl_parent: ::rustc_serialize::Decodable::decode(__decoder),
const_conditions: ::rustc_serialize::Decodable::decode(__decoder),
coerce_unsized_info: ::rustc_serialize::Decodable::decode(__decoder),
mir_const_qualif: ::rustc_serialize::Decodable::decode(__decoder),
rendered_const: ::rustc_serialize::Decodable::decode(__decoder),
rendered_precise_capturing_args: ::rustc_serialize::Decodable::decode(__decoder),
fn_arg_idents: ::rustc_serialize::Decodable::decode(__decoder),
coroutine_kind: ::rustc_serialize::Decodable::decode(__decoder),
coroutine_for_closure: ::rustc_serialize::Decodable::decode(__decoder),
adt_destructor: ::rustc_serialize::Decodable::decode(__decoder),
adt_async_destructor: ::rustc_serialize::Decodable::decode(__decoder),
coroutine_by_move_body_def_id: ::rustc_serialize::Decodable::decode(__decoder),
eval_static_initializer: ::rustc_serialize::Decodable::decode(__decoder),
trait_def: ::rustc_serialize::Decodable::decode(__decoder),
expn_that_defined: ::rustc_serialize::Decodable::decode(__decoder),
default_fields: ::rustc_serialize::Decodable::decode(__decoder),
params_in_repr: ::rustc_serialize::Decodable::decode(__decoder),
repr_options: ::rustc_serialize::Decodable::decode(__decoder),
def_keys: ::rustc_serialize::Decodable::decode(__decoder),
proc_macro_quoted_spans: ::rustc_serialize::Decodable::decode(__decoder),
variant_data: ::rustc_serialize::Decodable::decode(__decoder),
assoc_container: ::rustc_serialize::Decodable::decode(__decoder),
macro_definition: ::rustc_serialize::Decodable::decode(__decoder),
proc_macro: ::rustc_serialize::Decodable::decode(__decoder),
deduced_param_attrs: ::rustc_serialize::Decodable::decode(__decoder),
trait_impl_trait_tys: ::rustc_serialize::Decodable::decode(__decoder),
doc_link_resolutions: ::rustc_serialize::Decodable::decode(__decoder),
doc_link_traits_in_scope: ::rustc_serialize::Decodable::decode(__decoder),
assumed_wf_types_for_rpitit: ::rustc_serialize::Decodable::decode(__decoder),
opaque_ty_origin: ::rustc_serialize::Decodable::decode(__decoder),
anon_const_kind: ::rustc_serialize::Decodable::decode(__decoder),
const_of_item: ::rustc_serialize::Decodable::decode(__decoder),
associated_types_for_impl_traits_in_trait_or_impl: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};
struct TableBuilders {
intrinsic: TableBuilder<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
is_macro_rules: TableBuilder<DefIndex, bool>,
type_alias_is_lazy: TableBuilder<DefIndex, bool>,
attr_flags: TableBuilder<DefIndex, AttrFlags>,
def_path_hashes: TableBuilder<DefIndex, u64>,
explicit_item_bounds: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_item_self_bounds: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
inferred_outlives_of: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_super_predicates_of: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_predicates_of: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_const_bounds: TableBuilder<DefIndex,
LazyArray<(ty::PolyTraitRef<'static>, Span)>>,
inherent_impls: TableBuilder<DefIndex, LazyArray<DefIndex>>,
opt_rpitit_info: TableBuilder<DefIndex,
Option<LazyValue<ty::ImplTraitInTraitData>>>,
module_children_reexports: TableBuilder<DefIndex, LazyArray<ModChild>>,
ambig_module_children: TableBuilder<DefIndex, LazyArray<AmbigModChild>>,
cross_crate_inlinable: TableBuilder<DefIndex, bool>,
asyncness: TableBuilder<DefIndex, ty::Asyncness>,
constness: TableBuilder<DefIndex, hir::Constness>,
safety: TableBuilder<DefIndex, hir::Safety>,
defaultness: TableBuilder<DefIndex, hir::Defaultness>,
attributes: TableBuilder<DefIndex, Option<LazyArray<hir::Attribute>>>,
module_children_non_reexports: TableBuilder<DefIndex,
Option<LazyArray<DefIndex>>>,
associated_item_or_field_def_ids: TableBuilder<DefIndex,
Option<LazyArray<DefIndex>>>,
def_kind: TableBuilder<DefIndex, Option<DefKind>>,
visibility: TableBuilder<DefIndex,
Option<LazyValue<ty::Visibility<DefIndex>>>>,
def_span: TableBuilder<DefIndex, Option<LazyValue<Span>>>,
def_ident_span: TableBuilder<DefIndex, Option<LazyValue<Span>>>,
lookup_stability: TableBuilder<DefIndex,
Option<LazyValue<hir::Stability>>>,
lookup_const_stability: TableBuilder<DefIndex,
Option<LazyValue<hir::ConstStability>>>,
lookup_default_body_stability: TableBuilder<DefIndex,
Option<LazyValue<hir::DefaultBodyStability>>>,
lookup_deprecation_entry: TableBuilder<DefIndex,
Option<LazyValue<attrs::Deprecation>>>,
explicit_predicates_of: TableBuilder<DefIndex,
Option<LazyValue<ty::GenericPredicates<'static>>>>,
generics_of: TableBuilder<DefIndex, Option<LazyValue<ty::Generics>>>,
type_of: TableBuilder<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>>,
variances_of: TableBuilder<DefIndex, Option<LazyArray<ty::Variance>>>,
fn_sig: TableBuilder<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>>,
codegen_fn_attrs: TableBuilder<DefIndex,
Option<LazyValue<CodegenFnAttrs>>>,
impl_trait_header: TableBuilder<DefIndex,
Option<LazyValue<ty::ImplTraitHeader<'static>>>>,
const_param_default: TableBuilder<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static,
rustc_middle::ty::Const<'static>>>>>,
object_lifetime_default: TableBuilder<DefIndex,
Option<LazyValue<ObjectLifetimeDefault>>>,
optimized_mir: TableBuilder<DefIndex,
Option<LazyValue<mir::Body<'static>>>>,
mir_for_ctfe: TableBuilder<DefIndex,
Option<LazyValue<mir::Body<'static>>>>,
trivial_const: TableBuilder<DefIndex,
Option<LazyValue<(ConstValue, Ty<'static>)>>>,
closure_saved_names_of_captured_variables: TableBuilder<DefIndex,
Option<LazyValue<IndexVec<FieldIdx, Symbol>>>>,
mir_coroutine_witnesses: TableBuilder<DefIndex,
Option<LazyValue<mir::CoroutineLayout<'static>>>>,
promoted_mir: TableBuilder<DefIndex,
Option<LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>>,
thir_abstract_const: TableBuilder<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>>,
impl_parent: TableBuilder<DefIndex, Option<RawDefId>>,
const_conditions: TableBuilder<DefIndex,
Option<LazyValue<ty::ConstConditions<'static>>>>,
coerce_unsized_info: TableBuilder<DefIndex,
Option<LazyValue<ty::adjustment::CoerceUnsizedInfo>>>,
mir_const_qualif: TableBuilder<DefIndex,
Option<LazyValue<mir::ConstQualifs>>>,
rendered_const: TableBuilder<DefIndex, Option<LazyValue<String>>>,
rendered_precise_capturing_args: TableBuilder<DefIndex,
Option<LazyArray<PreciseCapturingArgKind<Symbol, Symbol>>>>,
fn_arg_idents: TableBuilder<DefIndex, Option<LazyArray<Option<Ident>>>>,
coroutine_kind: TableBuilder<DefIndex, Option<hir::CoroutineKind>>,
coroutine_for_closure: TableBuilder<DefIndex, Option<RawDefId>>,
adt_destructor: TableBuilder<DefIndex, Option<LazyValue<ty::Destructor>>>,
adt_async_destructor: TableBuilder<DefIndex,
Option<LazyValue<ty::AsyncDestructor>>>,
coroutine_by_move_body_def_id: TableBuilder<DefIndex, Option<RawDefId>>,
eval_static_initializer: TableBuilder<DefIndex,
Option<LazyValue<mir::interpret::ConstAllocation<'static>>>>,
trait_def: TableBuilder<DefIndex, Option<LazyValue<ty::TraitDef>>>,
expn_that_defined: TableBuilder<DefIndex, Option<LazyValue<ExpnId>>>,
default_fields: TableBuilder<DefIndex, Option<LazyValue<DefId>>>,
params_in_repr: TableBuilder<DefIndex,
Option<LazyValue<DenseBitSet<u32>>>>,
repr_options: TableBuilder<DefIndex, Option<LazyValue<ReprOptions>>>,
def_keys: TableBuilder<DefIndex, Option<LazyValue<DefKey>>>,
proc_macro_quoted_spans: TableBuilder<usize, Option<LazyValue<Span>>>,
variant_data: TableBuilder<DefIndex, Option<LazyValue<VariantData>>>,
assoc_container: TableBuilder<DefIndex,
Option<LazyValue<ty::AssocContainer>>>,
macro_definition: TableBuilder<DefIndex,
Option<LazyValue<ast::DelimArgs>>>,
proc_macro: TableBuilder<DefIndex, Option<MacroKind>>,
deduced_param_attrs: TableBuilder<DefIndex,
Option<LazyArray<DeducedParamAttrs>>>,
trait_impl_trait_tys: TableBuilder<DefIndex,
Option<LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>>,
doc_link_resolutions: TableBuilder<DefIndex,
Option<LazyValue<DocLinkResMap>>>,
doc_link_traits_in_scope: TableBuilder<DefIndex,
Option<LazyArray<DefId>>>,
assumed_wf_types_for_rpitit: TableBuilder<DefIndex,
Option<LazyArray<(Ty<'static>, Span)>>>,
opaque_ty_origin: TableBuilder<DefIndex,
Option<LazyValue<hir::OpaqueTyOrigin<DefId>>>>,
anon_const_kind: TableBuilder<DefIndex,
Option<LazyValue<ty::AnonConstKind>>>,
const_of_item: TableBuilder<DefIndex,
Option<LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>>,
associated_types_for_impl_traits_in_trait_or_impl: TableBuilder<DefIndex,
Option<LazyValue<DefIdMap<Vec<DefId>>>>>,
}
#[automatically_derived]
impl ::core::default::Default for TableBuilders {
#[inline]
fn default() -> TableBuilders {
TableBuilders {
intrinsic: ::core::default::Default::default(),
is_macro_rules: ::core::default::Default::default(),
type_alias_is_lazy: ::core::default::Default::default(),
attr_flags: ::core::default::Default::default(),
def_path_hashes: ::core::default::Default::default(),
explicit_item_bounds: ::core::default::Default::default(),
explicit_item_self_bounds: ::core::default::Default::default(),
inferred_outlives_of: ::core::default::Default::default(),
explicit_super_predicates_of: ::core::default::Default::default(),
explicit_implied_predicates_of: ::core::default::Default::default(),
explicit_implied_const_bounds: ::core::default::Default::default(),
inherent_impls: ::core::default::Default::default(),
opt_rpitit_info: ::core::default::Default::default(),
module_children_reexports: ::core::default::Default::default(),
ambig_module_children: ::core::default::Default::default(),
cross_crate_inlinable: ::core::default::Default::default(),
asyncness: ::core::default::Default::default(),
constness: ::core::default::Default::default(),
safety: ::core::default::Default::default(),
defaultness: ::core::default::Default::default(),
attributes: ::core::default::Default::default(),
module_children_non_reexports: ::core::default::Default::default(),
associated_item_or_field_def_ids: ::core::default::Default::default(),
def_kind: ::core::default::Default::default(),
visibility: ::core::default::Default::default(),
def_span: ::core::default::Default::default(),
def_ident_span: ::core::default::Default::default(),
lookup_stability: ::core::default::Default::default(),
lookup_const_stability: ::core::default::Default::default(),
lookup_default_body_stability: ::core::default::Default::default(),
lookup_deprecation_entry: ::core::default::Default::default(),
explicit_predicates_of: ::core::default::Default::default(),
generics_of: ::core::default::Default::default(),
type_of: ::core::default::Default::default(),
variances_of: ::core::default::Default::default(),
fn_sig: ::core::default::Default::default(),
codegen_fn_attrs: ::core::default::Default::default(),
impl_trait_header: ::core::default::Default::default(),
const_param_default: ::core::default::Default::default(),
object_lifetime_default: ::core::default::Default::default(),
optimized_mir: ::core::default::Default::default(),
mir_for_ctfe: ::core::default::Default::default(),
trivial_const: ::core::default::Default::default(),
closure_saved_names_of_captured_variables: ::core::default::Default::default(),
mir_coroutine_witnesses: ::core::default::Default::default(),
promoted_mir: ::core::default::Default::default(),
thir_abstract_const: ::core::default::Default::default(),
impl_parent: ::core::default::Default::default(),
const_conditions: ::core::default::Default::default(),
coerce_unsized_info: ::core::default::Default::default(),
mir_const_qualif: ::core::default::Default::default(),
rendered_const: ::core::default::Default::default(),
rendered_precise_capturing_args: ::core::default::Default::default(),
fn_arg_idents: ::core::default::Default::default(),
coroutine_kind: ::core::default::Default::default(),
coroutine_for_closure: ::core::default::Default::default(),
adt_destructor: ::core::default::Default::default(),
adt_async_destructor: ::core::default::Default::default(),
coroutine_by_move_body_def_id: ::core::default::Default::default(),
eval_static_initializer: ::core::default::Default::default(),
trait_def: ::core::default::Default::default(),
expn_that_defined: ::core::default::Default::default(),
default_fields: ::core::default::Default::default(),
params_in_repr: ::core::default::Default::default(),
repr_options: ::core::default::Default::default(),
def_keys: ::core::default::Default::default(),
proc_macro_quoted_spans: ::core::default::Default::default(),
variant_data: ::core::default::Default::default(),
assoc_container: ::core::default::Default::default(),
macro_definition: ::core::default::Default::default(),
proc_macro: ::core::default::Default::default(),
deduced_param_attrs: ::core::default::Default::default(),
trait_impl_trait_tys: ::core::default::Default::default(),
doc_link_resolutions: ::core::default::Default::default(),
doc_link_traits_in_scope: ::core::default::Default::default(),
assumed_wf_types_for_rpitit: ::core::default::Default::default(),
opaque_ty_origin: ::core::default::Default::default(),
anon_const_kind: ::core::default::Default::default(),
const_of_item: ::core::default::Default::default(),
associated_types_for_impl_traits_in_trait_or_impl: ::core::default::Default::default(),
}
}
}
impl TableBuilders {
fn encode(&self, buf: &mut FileEncoder) -> LazyTables {
LazyTables {
intrinsic: self.intrinsic.encode(buf),
is_macro_rules: self.is_macro_rules.encode(buf),
type_alias_is_lazy: self.type_alias_is_lazy.encode(buf),
attr_flags: self.attr_flags.encode(buf),
def_path_hashes: self.def_path_hashes.encode(buf),
explicit_item_bounds: self.explicit_item_bounds.encode(buf),
explicit_item_self_bounds: self.explicit_item_self_bounds.encode(buf),
inferred_outlives_of: self.inferred_outlives_of.encode(buf),
explicit_super_predicates_of: self.explicit_super_predicates_of.encode(buf),
explicit_implied_predicates_of: self.explicit_implied_predicates_of.encode(buf),
explicit_implied_const_bounds: self.explicit_implied_const_bounds.encode(buf),
inherent_impls: self.inherent_impls.encode(buf),
opt_rpitit_info: self.opt_rpitit_info.encode(buf),
module_children_reexports: self.module_children_reexports.encode(buf),
ambig_module_children: self.ambig_module_children.encode(buf),
cross_crate_inlinable: self.cross_crate_inlinable.encode(buf),
asyncness: self.asyncness.encode(buf),
constness: self.constness.encode(buf),
safety: self.safety.encode(buf),
defaultness: self.defaultness.encode(buf),
attributes: self.attributes.encode(buf),
module_children_non_reexports: self.module_children_non_reexports.encode(buf),
associated_item_or_field_def_ids: self.associated_item_or_field_def_ids.encode(buf),
def_kind: self.def_kind.encode(buf),
visibility: self.visibility.encode(buf),
def_span: self.def_span.encode(buf),
def_ident_span: self.def_ident_span.encode(buf),
lookup_stability: self.lookup_stability.encode(buf),
lookup_const_stability: self.lookup_const_stability.encode(buf),
lookup_default_body_stability: self.lookup_default_body_stability.encode(buf),
lookup_deprecation_entry: self.lookup_deprecation_entry.encode(buf),
explicit_predicates_of: self.explicit_predicates_of.encode(buf),
generics_of: self.generics_of.encode(buf),
type_of: self.type_of.encode(buf),
variances_of: self.variances_of.encode(buf),
fn_sig: self.fn_sig.encode(buf),
codegen_fn_attrs: self.codegen_fn_attrs.encode(buf),
impl_trait_header: self.impl_trait_header.encode(buf),
const_param_default: self.const_param_default.encode(buf),
object_lifetime_default: self.object_lifetime_default.encode(buf),
optimized_mir: self.optimized_mir.encode(buf),
mir_for_ctfe: self.mir_for_ctfe.encode(buf),
trivial_const: self.trivial_const.encode(buf),
closure_saved_names_of_captured_variables: self.closure_saved_names_of_captured_variables.encode(buf),
mir_coroutine_witnesses: self.mir_coroutine_witnesses.encode(buf),
promoted_mir: self.promoted_mir.encode(buf),
thir_abstract_const: self.thir_abstract_const.encode(buf),
impl_parent: self.impl_parent.encode(buf),
const_conditions: self.const_conditions.encode(buf),
coerce_unsized_info: self.coerce_unsized_info.encode(buf),
mir_const_qualif: self.mir_const_qualif.encode(buf),
rendered_const: self.rendered_const.encode(buf),
rendered_precise_capturing_args: self.rendered_precise_capturing_args.encode(buf),
fn_arg_idents: self.fn_arg_idents.encode(buf),
coroutine_kind: self.coroutine_kind.encode(buf),
coroutine_for_closure: self.coroutine_for_closure.encode(buf),
adt_destructor: self.adt_destructor.encode(buf),
adt_async_destructor: self.adt_async_destructor.encode(buf),
coroutine_by_move_body_def_id: self.coroutine_by_move_body_def_id.encode(buf),
eval_static_initializer: self.eval_static_initializer.encode(buf),
trait_def: self.trait_def.encode(buf),
expn_that_defined: self.expn_that_defined.encode(buf),
default_fields: self.default_fields.encode(buf),
params_in_repr: self.params_in_repr.encode(buf),
repr_options: self.repr_options.encode(buf),
def_keys: self.def_keys.encode(buf),
proc_macro_quoted_spans: self.proc_macro_quoted_spans.encode(buf),
variant_data: self.variant_data.encode(buf),
assoc_container: self.assoc_container.encode(buf),
macro_definition: self.macro_definition.encode(buf),
proc_macro: self.proc_macro.encode(buf),
deduced_param_attrs: self.deduced_param_attrs.encode(buf),
trait_impl_trait_tys: self.trait_impl_trait_tys.encode(buf),
doc_link_resolutions: self.doc_link_resolutions.encode(buf),
doc_link_traits_in_scope: self.doc_link_traits_in_scope.encode(buf),
assumed_wf_types_for_rpitit: self.assumed_wf_types_for_rpitit.encode(buf),
opaque_ty_origin: self.opaque_ty_origin.encode(buf),
anon_const_kind: self.anon_const_kind.encode(buf),
const_of_item: self.const_of_item.encode(buf),
associated_types_for_impl_traits_in_trait_or_impl: self.associated_types_for_impl_traits_in_trait_or_impl.encode(buf),
}
}
}define_tables! {
378- defaulted:
379 intrinsic: Table<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
380 is_macro_rules: Table<DefIndex, bool>,
381 type_alias_is_lazy: Table<DefIndex, bool>,
382 attr_flags: Table<DefIndex, AttrFlags>,
383 def_path_hashes: Table<DefIndex, u64>,
389 explicit_item_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
390 explicit_item_self_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
391 inferred_outlives_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
392 explicit_super_predicates_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
393 explicit_implied_predicates_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
394 explicit_implied_const_bounds: Table<DefIndex, LazyArray<(ty::PolyTraitRef<'static>, Span)>>,
395 inherent_impls: Table<DefIndex, LazyArray<DefIndex>>,
396 opt_rpitit_info: Table<DefIndex, Option<LazyValue<ty::ImplTraitInTraitData>>>,
397 module_children_reexports: Table<DefIndex, LazyArray<ModChild>>,
402 ambig_module_children: Table<DefIndex, LazyArray<AmbigModChild>>,
403 cross_crate_inlinable: Table<DefIndex, bool>,
404 asyncness: Table<DefIndex, ty::Asyncness>,
405 constness: Table<DefIndex, hir::Constness>,
406 safety: Table<DefIndex, hir::Safety>,
407 defaultness: Table<DefIndex, hir::Defaultness>,
408
409- optional:
410 attributes: Table<DefIndex, LazyArray<hir::Attribute>>,
411 module_children_non_reexports: Table<DefIndex, LazyArray<DefIndex>>,
414 associated_item_or_field_def_ids: Table<DefIndex, LazyArray<DefIndex>>,
415 def_kind: Table<DefIndex, DefKind>,
416 visibility: Table<DefIndex, LazyValue<ty::Visibility<DefIndex>>>,
417 def_span: Table<DefIndex, LazyValue<Span>>,
418 def_ident_span: Table<DefIndex, LazyValue<Span>>,
419 lookup_stability: Table<DefIndex, LazyValue<hir::Stability>>,
420 lookup_const_stability: Table<DefIndex, LazyValue<hir::ConstStability>>,
421 lookup_default_body_stability: Table<DefIndex, LazyValue<hir::DefaultBodyStability>>,
422 lookup_deprecation_entry: Table<DefIndex, LazyValue<attrs::Deprecation>>,
423 explicit_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
424 generics_of: Table<DefIndex, LazyValue<ty::Generics>>,
425 type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>,
426 variances_of: Table<DefIndex, LazyArray<ty::Variance>>,
427 fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>,
428 codegen_fn_attrs: Table<DefIndex, LazyValue<CodegenFnAttrs>>,
429 impl_trait_header: Table<DefIndex, LazyValue<ty::ImplTraitHeader<'static>>>,
430 const_param_default: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, rustc_middle::ty::Const<'static>>>>,
431 object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
432 optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
433 mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
434 trivial_const: Table<DefIndex, LazyValue<(ConstValue, Ty<'static>)>>,
435 closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
436 mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
437 promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
438 thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
439 impl_parent: Table<DefIndex, RawDefId>,
440 const_conditions: Table<DefIndex, LazyValue<ty::ConstConditions<'static>>>,
441 coerce_unsized_info: Table<DefIndex, LazyValue<ty::adjustment::CoerceUnsizedInfo>>,
443 mir_const_qualif: Table<DefIndex, LazyValue<mir::ConstQualifs>>,
444 rendered_const: Table<DefIndex, LazyValue<String>>,
445 rendered_precise_capturing_args: Table<DefIndex, LazyArray<PreciseCapturingArgKind<Symbol, Symbol>>>,
446 fn_arg_idents: Table<DefIndex, LazyArray<Option<Ident>>>,
447 coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
448 coroutine_for_closure: Table<DefIndex, RawDefId>,
449 adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
450 adt_async_destructor: Table<DefIndex, LazyValue<ty::AsyncDestructor>>,
451 coroutine_by_move_body_def_id: Table<DefIndex, RawDefId>,
452 eval_static_initializer: Table<DefIndex, LazyValue<mir::interpret::ConstAllocation<'static>>>,
453 trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,
454 expn_that_defined: Table<DefIndex, LazyValue<ExpnId>>,
455 default_fields: Table<DefIndex, LazyValue<DefId>>,
456 params_in_repr: Table<DefIndex, LazyValue<DenseBitSet<u32>>>,
457 repr_options: Table<DefIndex, LazyValue<ReprOptions>>,
458 def_keys: Table<DefIndex, LazyValue<DefKey>>,
463 proc_macro_quoted_spans: Table<usize, LazyValue<Span>>,
464 variant_data: Table<DefIndex, LazyValue<VariantData>>,
465 assoc_container: Table<DefIndex, LazyValue<ty::AssocContainer>>,
466 macro_definition: Table<DefIndex, LazyValue<ast::DelimArgs>>,
467 proc_macro: Table<DefIndex, MacroKind>,
468 deduced_param_attrs: Table<DefIndex, LazyArray<DeducedParamAttrs>>,
469 trait_impl_trait_tys: Table<DefIndex, LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>,
470 doc_link_resolutions: Table<DefIndex, LazyValue<DocLinkResMap>>,
471 doc_link_traits_in_scope: Table<DefIndex, LazyArray<DefId>>,
472 assumed_wf_types_for_rpitit: Table<DefIndex, LazyArray<(Ty<'static>, Span)>>,
473 opaque_ty_origin: Table<DefIndex, LazyValue<hir::OpaqueTyOrigin<DefId>>>,
474 anon_const_kind: Table<DefIndex, LazyValue<ty::AnonConstKind>>,
475 const_of_item: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
476 associated_types_for_impl_traits_in_trait_or_impl: Table<DefIndex, LazyValue<DefIdMap<Vec<DefId>>>>,
477}
478
479#[derive(const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for VariantData {
fn encode(&self, __encoder: &mut __E) {
match *self {
VariantData {
idx: ref __binding_0,
discr: ref __binding_1,
ctor: ref __binding_2,
is_non_exhaustive: ref __binding_3 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
}
}
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for VariantData {
fn decode(__decoder: &mut __D) -> Self {
VariantData {
idx: ::rustc_serialize::Decodable::decode(__decoder),
discr: ::rustc_serialize::Decodable::decode(__decoder),
ctor: ::rustc_serialize::Decodable::decode(__decoder),
is_non_exhaustive: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
480struct VariantData {
481 idx: VariantIdx,
482 discr: ty::VariantDiscr,
483 ctor: Option<(CtorKind, DefIndex)>,
485 is_non_exhaustive: bool,
486}
487
488pub struct AttrFlags(<AttrFlags as
::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for AttrFlags {
#[inline]
fn default() -> AttrFlags {
AttrFlags(::core::default::Default::default())
}
}
impl AttrFlags {
#[allow(deprecated, non_upper_case_globals,)]
pub const IS_DOC_HIDDEN: Self = Self::from_bits_retain(1 << 0);
}
impl ::bitflags::Flags for AttrFlags {
const FLAGS: &'static [::bitflags::Flag<AttrFlags>] =
&[{
#[allow(deprecated, non_upper_case_globals,)]
::bitflags::Flag::new("IS_DOC_HIDDEN",
AttrFlags::IS_DOC_HIDDEN)
}];
type Bits = u8;
fn bits(&self) -> u8 { AttrFlags::bits(self) }
fn from_bits_retain(bits: u8) -> AttrFlags {
AttrFlags::from_bits_retain(bits)
}
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
{
#[repr(transparent)]
pub struct InternalBitFlags(u8);
#[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
#[automatically_derived]
impl ::core::clone::Clone for InternalBitFlags {
#[inline]
fn clone(&self) -> InternalBitFlags {
let _: ::core::clone::AssertParamIsClone<u8>;
*self
}
}
#[automatically_derived]
impl ::core::marker::Copy for InternalBitFlags { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
#[automatically_derived]
impl ::core::cmp::PartialEq for InternalBitFlags {
#[inline]
fn eq(&self, other: &InternalBitFlags) -> bool {
self.0 == other.0
}
}
#[automatically_derived]
impl ::core::cmp::Eq for InternalBitFlags {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<u8>;
}
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for InternalBitFlags {
#[inline]
fn partial_cmp(&self, other: &InternalBitFlags)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::cmp::PartialOrd::partial_cmp(&self.0, &other.0)
}
}
#[automatically_derived]
impl ::core::cmp::Ord for InternalBitFlags {
#[inline]
fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
::core::cmp::Ord::cmp(&self.0, &other.0)
}
}
#[automatically_derived]
impl ::core::hash::Hash for InternalBitFlags {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.0, state)
}
}
impl ::bitflags::__private::PublicFlags for AttrFlags {
type Primitive = u8;
type Internal = InternalBitFlags;
}
impl ::bitflags::__private::core::default::Default for
InternalBitFlags {
#[inline]
fn default() -> Self { InternalBitFlags::empty() }
}
impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
fn fmt(&self,
f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
-> ::bitflags::__private::core::fmt::Result {
if self.is_empty() {
f.write_fmt(format_args!("{0:#x}",
<u8 as ::bitflags::Bits>::EMPTY))
} else {
::bitflags::__private::core::fmt::Display::fmt(self, f)
}
}
}
impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
fn fmt(&self,
f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
-> ::bitflags::__private::core::fmt::Result {
::bitflags::parser::to_writer(&AttrFlags(*self), f)
}
}
impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
type Err = ::bitflags::parser::ParseError;
fn from_str(s: &str)
->
::bitflags::__private::core::result::Result<Self,
Self::Err> {
::bitflags::parser::from_str::<AttrFlags>(s).map(|flags|
flags.0)
}
}
impl ::bitflags::__private::core::convert::AsRef<u8> for
InternalBitFlags {
fn as_ref(&self) -> &u8 { &self.0 }
}
impl ::bitflags::__private::core::convert::From<u8> for
InternalBitFlags {
fn from(bits: u8) -> Self { Self::from_bits_retain(bits) }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl InternalBitFlags {
#[inline]
pub const fn empty() -> Self {
Self(<u8 as ::bitflags::Bits>::EMPTY)
}
#[inline]
pub const fn all() -> Self {
let mut truncated = <u8 as ::bitflags::Bits>::EMPTY;
let mut i = 0;
{
{
let flag =
<AttrFlags as ::bitflags::Flags>::FLAGS[i].value().bits();
truncated = truncated | flag;
i += 1;
}
};
let _ = i;
Self(truncated)
}
#[inline]
pub const fn bits(&self) -> u8 { self.0 }
#[inline]
pub const fn from_bits(bits: u8)
-> ::bitflags::__private::core::option::Option<Self> {
let truncated = Self::from_bits_truncate(bits).0;
if truncated == bits {
::bitflags::__private::core::option::Option::Some(Self(bits))
} else { ::bitflags::__private::core::option::Option::None }
}
#[inline]
pub const fn from_bits_truncate(bits: u8) -> Self {
Self(bits & Self::all().0)
}
#[inline]
pub const fn from_bits_retain(bits: u8) -> Self { Self(bits) }
#[inline]
pub fn from_name(name: &str)
-> ::bitflags::__private::core::option::Option<Self> {
{
if name == "IS_DOC_HIDDEN" {
return ::bitflags::__private::core::option::Option::Some(Self(AttrFlags::IS_DOC_HIDDEN.bits()));
}
};
;
let _ = name;
::bitflags::__private::core::option::Option::None
}
#[inline]
pub const fn is_empty(&self) -> bool {
self.0 == <u8 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn is_all(&self) -> bool {
Self::all().0 | self.0 == self.0
}
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0 & other.0 != <u8 as ::bitflags::Bits>::EMPTY
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
pub fn insert(&mut self, other: Self) {
*self = Self(self.0).union(other);
}
#[inline]
pub fn remove(&mut self, other: Self) {
*self = Self(self.0).difference(other);
}
#[inline]
pub fn toggle(&mut self, other: Self) {
*self = Self(self.0).symmetric_difference(other);
}
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
if value { self.insert(other); } else { self.remove(other); }
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self::from_bits_truncate(!self.0)
}
}
impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
type Output = Self;
#[inline]
fn bitor(self, other: InternalBitFlags) -> Self {
self.union(other)
}
}
impl ::bitflags::__private::core::ops::BitOrAssign for
InternalBitFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for
InternalBitFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for
InternalBitFlags {
#[inline]
fn bitand_assign(&mut self, other: Self) {
*self =
Self::from_bits_retain(self.bits()).intersection(other);
}
}
impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
type Output = Self;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
{
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
InternalBitFlags {
fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
= Self>>(&mut self, iterator: T) {
for item in iterator { self.insert(item) }
}
}
impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
for InternalBitFlags {
fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
= Self>>(iterator: T) -> Self {
use ::bitflags::__private::core::iter::Extend;
let mut result = Self::empty();
result.extend(iterator);
result
}
}
impl InternalBitFlags {
#[inline]
pub const fn iter(&self) -> ::bitflags::iter::Iter<AttrFlags> {
::bitflags::iter::Iter::__private_const_new(<AttrFlags as
::bitflags::Flags>::FLAGS,
AttrFlags::from_bits_retain(self.bits()),
AttrFlags::from_bits_retain(self.bits()))
}
#[inline]
pub const fn iter_names(&self)
-> ::bitflags::iter::IterNames<AttrFlags> {
::bitflags::iter::IterNames::__private_const_new(<AttrFlags as
::bitflags::Flags>::FLAGS,
AttrFlags::from_bits_retain(self.bits()),
AttrFlags::from_bits_retain(self.bits()))
}
}
impl ::bitflags::__private::core::iter::IntoIterator for
InternalBitFlags {
type Item = AttrFlags;
type IntoIter = ::bitflags::iter::Iter<AttrFlags>;
fn into_iter(self) -> Self::IntoIter { self.iter() }
}
impl InternalBitFlags {
#[inline]
pub fn bits_mut(&mut self) -> &mut u8 { &mut self.0 }
}
#[allow(dead_code, deprecated, unused_attributes)]
impl AttrFlags {
#[inline]
pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
#[inline]
pub const fn all() -> Self { Self(InternalBitFlags::all()) }
#[inline]
pub const fn bits(&self) -> u8 { self.0.bits() }
#[inline]
pub const fn from_bits(bits: u8)
-> ::bitflags::__private::core::option::Option<Self> {
match InternalBitFlags::from_bits(bits) {
::bitflags::__private::core::option::Option::Some(bits) =>
::bitflags::__private::core::option::Option::Some(Self(bits)),
::bitflags::__private::core::option::Option::None =>
::bitflags::__private::core::option::Option::None,
}
}
#[inline]
pub const fn from_bits_truncate(bits: u8) -> Self {
Self(InternalBitFlags::from_bits_truncate(bits))
}
#[inline]
pub const fn from_bits_retain(bits: u8) -> Self {
Self(InternalBitFlags::from_bits_retain(bits))
}
#[inline]
pub fn from_name(name: &str)
-> ::bitflags::__private::core::option::Option<Self> {
match InternalBitFlags::from_name(name) {
::bitflags::__private::core::option::Option::Some(bits) =>
::bitflags::__private::core::option::Option::Some(Self(bits)),
::bitflags::__private::core::option::Option::None =>
::bitflags::__private::core::option::Option::None,
}
}
#[inline]
pub const fn is_empty(&self) -> bool { self.0.is_empty() }
#[inline]
pub const fn is_all(&self) -> bool { self.0.is_all() }
#[inline]
pub const fn intersects(&self, other: Self) -> bool {
self.0.intersects(other.0)
}
#[inline]
pub const fn contains(&self, other: Self) -> bool {
self.0.contains(other.0)
}
#[inline]
pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
#[inline]
pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
#[inline]
pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
#[inline]
pub fn set(&mut self, other: Self, value: bool) {
self.0.set(other.0, value)
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0.intersection(other.0))
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0.union(other.0))
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0.difference(other.0))
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0.symmetric_difference(other.0))
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self(self.0.complement())
}
}
impl ::bitflags::__private::core::fmt::Binary for AttrFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::Octal for AttrFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::LowerHex for AttrFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::fmt::UpperHex for AttrFlags {
fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
-> ::bitflags::__private::core::fmt::Result {
let inner = self.0;
::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
}
}
impl ::bitflags::__private::core::ops::BitOr for AttrFlags {
type Output = Self;
#[inline]
fn bitor(self, other: AttrFlags) -> Self { self.union(other) }
}
impl ::bitflags::__private::core::ops::BitOrAssign for AttrFlags {
#[inline]
fn bitor_assign(&mut self, other: Self) { self.insert(other); }
}
impl ::bitflags::__private::core::ops::BitXor for AttrFlags {
type Output = Self;
#[inline]
fn bitxor(self, other: Self) -> Self {
self.symmetric_difference(other)
}
}
impl ::bitflags::__private::core::ops::BitXorAssign for AttrFlags {
#[inline]
fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
}
impl ::bitflags::__private::core::ops::BitAnd for AttrFlags {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self { self.intersection(other) }
}
impl ::bitflags::__private::core::ops::BitAndAssign for AttrFlags {
#[inline]
fn bitand_assign(&mut self, other: Self) {
*self =
Self::from_bits_retain(self.bits()).intersection(other);
}
}
impl ::bitflags::__private::core::ops::Sub for AttrFlags {
type Output = Self;
#[inline]
fn sub(self, other: Self) -> Self { self.difference(other) }
}
impl ::bitflags::__private::core::ops::SubAssign for AttrFlags {
#[inline]
fn sub_assign(&mut self, other: Self) { self.remove(other); }
}
impl ::bitflags::__private::core::ops::Not for AttrFlags {
type Output = Self;
#[inline]
fn not(self) -> Self { self.complement() }
}
impl ::bitflags::__private::core::iter::Extend<AttrFlags> for
AttrFlags {
fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
= Self>>(&mut self, iterator: T) {
for item in iterator { self.insert(item) }
}
}
impl ::bitflags::__private::core::iter::FromIterator<AttrFlags> for
AttrFlags {
fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
= Self>>(iterator: T) -> Self {
use ::bitflags::__private::core::iter::Extend;
let mut result = Self::empty();
result.extend(iterator);
result
}
}
impl AttrFlags {
#[inline]
pub const fn iter(&self) -> ::bitflags::iter::Iter<AttrFlags> {
::bitflags::iter::Iter::__private_const_new(<AttrFlags as
::bitflags::Flags>::FLAGS,
AttrFlags::from_bits_retain(self.bits()),
AttrFlags::from_bits_retain(self.bits()))
}
#[inline]
pub const fn iter_names(&self)
-> ::bitflags::iter::IterNames<AttrFlags> {
::bitflags::iter::IterNames::__private_const_new(<AttrFlags as
::bitflags::Flags>::FLAGS,
AttrFlags::from_bits_retain(self.bits()),
AttrFlags::from_bits_retain(self.bits()))
}
}
impl ::bitflags::__private::core::iter::IntoIterator for AttrFlags {
type Item = AttrFlags;
type IntoIter = ::bitflags::iter::Iter<AttrFlags>;
fn into_iter(self) -> Self::IntoIter { self.iter() }
}
};bitflags::bitflags! {
489 #[derive(Default)]
490 pub struct AttrFlags: u8 {
491 const IS_DOC_HIDDEN = 1 << 0;
492 }
493}
494
495#[derive(const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for SpanTag {
fn encode(&self, __encoder: &mut __E) {
match *self {
SpanTag(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
}
}
};Encodable, const _: () =
{
impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
for SpanTag {
fn decode(__decoder: &mut __D) -> Self {
SpanTag(::rustc_serialize::Decodable::decode(__decoder))
}
}
};Decodable, #[automatically_derived]
impl ::core::marker::Copy for SpanTag { }Copy, #[automatically_derived]
impl ::core::clone::Clone for SpanTag {
#[inline]
fn clone(&self) -> SpanTag {
let _: ::core::clone::AssertParamIsClone<u8>;
*self
}
}Clone)]
512struct SpanTag(u8);
513
514#[derive(#[automatically_derived]
impl ::core::fmt::Debug for SpanKind {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
SpanKind::Local => "Local",
SpanKind::Foreign => "Foreign",
SpanKind::Partial => "Partial",
SpanKind::Indirect => "Indirect",
})
}
}Debug, #[automatically_derived]
impl ::core::marker::Copy for SpanKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for SpanKind {
#[inline]
fn clone(&self) -> SpanKind { *self }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for SpanKind {
#[inline]
fn eq(&self, other: &SpanKind) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for SpanKind {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {}
}Eq)]
515enum SpanKind {
516 Local = 0b00,
517 Foreign = 0b01,
518 Partial = 0b10,
519 Indirect = 0b11,
523}
524
525impl SpanTag {
526 fn new(kind: SpanKind, context: rustc_span::SyntaxContext, length: usize) -> SpanTag {
527 let mut data = 0u8;
528 data |= kind as u8;
529 if context.is_root() {
530 data |= 0b100;
531 }
532 let all_1s_len = (0xffu8 << 3) >> 3;
533 if length < all_1s_len as usize {
535 data |= (length as u8) << 3;
536 } else {
537 data |= all_1s_len << 3;
538 }
539
540 SpanTag(data)
541 }
542
543 fn indirect(relative: bool, length_bytes: u8) -> SpanTag {
544 let mut tag = SpanTag(SpanKind::Indirect as u8);
545 if relative {
546 tag.0 |= 0b100;
547 }
548 if !(length_bytes <= 8) {
::core::panicking::panic("assertion failed: length_bytes <= 8")
};assert!(length_bytes <= 8);
549 tag.0 |= length_bytes << 3;
550 tag
551 }
552
553 fn kind(self) -> SpanKind {
554 let masked = self.0 & 0b11;
555 match masked {
556 0b00 => SpanKind::Local,
557 0b01 => SpanKind::Foreign,
558 0b10 => SpanKind::Partial,
559 0b11 => SpanKind::Indirect,
560 _ => ::core::panicking::panic("internal error: entered unreachable code")unreachable!(),
561 }
562 }
563
564 fn is_relative_offset(self) -> bool {
565 if true {
match (&self.kind(), &SpanKind::Indirect) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val, ::core::option::Option::None);
}
}
};
};debug_assert_eq!(self.kind(), SpanKind::Indirect);
566 self.0 & 0b100 != 0
567 }
568
569 fn context(self) -> Option<rustc_span::SyntaxContext> {
570 if self.0 & 0b100 != 0 { Some(rustc_span::SyntaxContext::root()) } else { None }
571 }
572
573 fn length(self) -> Option<rustc_span::BytePos> {
574 let all_1s_len = (0xffu8 << 3) >> 3;
575 let len = self.0 >> 3;
576 if len != all_1s_len { Some(rustc_span::BytePos(u32::from(len))) } else { None }
577 }
578}
579
580const SYMBOL_STR: u8 = 0;
582const SYMBOL_OFFSET: u8 = 1;
583const SYMBOL_PREDEFINED: u8 = 2;
584
585pub fn provide(providers: &mut Providers) {
586 encoder::provide(&mut providers.queries);
587 decoder::provide(providers);
588}