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_data_structures::fx::FxHashMap;
12use rustc_data_structures::svh::Svh;
13use rustc_hir::attrs::StrippedCfgItem;
14use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap, MacroKinds};
15use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIndex, DefPathHash, StableCrateId};
16use rustc_hir::definitions::DefKey;
17use rustc_hir::lang_items::LangItem;
18use rustc_hir::{PreciseCapturingArgKind, attrs};
19use rustc_index::IndexVec;
20use rustc_index::bit_set::DenseBitSet;
21use rustc_macros::{
22 BlobDecodable, Decodable, Encodable, LazyDecodable, MetadataEncodable, TyDecodable, TyEncodable,
23};
24use rustc_middle::metadata::{AmbigModChild, ModChild};
25use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
26use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
27use rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs;
28use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
29use rustc_middle::middle::lib_features::FeatureStability;
30use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
31use rustc_middle::mir;
32use rustc_middle::mir::ConstValue;
33use rustc_middle::ty::fast_reject::SimplifiedType;
34use rustc_middle::ty::{self, Ty, TyCtxt, UnusedGenericParams};
35use rustc_middle::util::Providers;
36use rustc_serialize::opaque::FileEncoder;
37use rustc_session::config::{SymbolManglingVersion, TargetModifier};
38use rustc_session::cstore::{CrateDepKind, ForeignModule, LinkagePreference, NativeLib};
39use rustc_span::edition::Edition;
40use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextKey};
41use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Ident, Span, Symbol};
42use rustc_target::spec::{PanicStrategy, TargetTuple};
43use table::TableBuilder;
44use {rustc_ast as ast, rustc_hir as hir};
45
46use crate::creader::CrateMetadataRef;
47use crate::eii::EiiMapEncodedKeyValue;
48
49mod decoder;
50mod def_path_hash_map;
51mod encoder;
52mod parameterized;
53mod table;
54
55pub(crate) fn rustc_version(cfg_version: &'static str) -> String {
56 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("rustc {0}", cfg_version))
})format!("rustc {cfg_version}")
57}
58
59const METADATA_VERSION: u8 = 10;
63
64pub const METADATA_HEADER: &[u8] = &[b'r', b'u', b's', b't', 0, 0, 0, METADATA_VERSION];
70
71#[must_use]
87struct LazyValue<T> {
88 position: NonZero<usize>,
89 _marker: PhantomData<fn() -> T>,
90}
91
92impl<T> LazyValue<T> {
93 fn from_position(position: NonZero<usize>) -> LazyValue<T> {
94 LazyValue { position, _marker: PhantomData }
95 }
96}
97
98struct LazyArray<T> {
109 position: NonZero<usize>,
110 num_elems: usize,
111 _marker: PhantomData<fn() -> T>,
112}
113
114impl<T> Default for LazyArray<T> {
115 fn default() -> LazyArray<T> {
116 LazyArray::from_position_and_num_elems(NonZero::new(1).unwrap(), 0)
117 }
118}
119
120impl<T> LazyArray<T> {
121 fn from_position_and_num_elems(position: NonZero<usize>, num_elems: usize) -> LazyArray<T> {
122 LazyArray { position, num_elems, _marker: PhantomData }
123 }
124}
125
126struct LazyTable<I, T> {
132 position: NonZero<usize>,
133 width: usize,
136 len: usize,
138 _marker: PhantomData<fn(I) -> T>,
139}
140
141impl<I, T> LazyTable<I, T> {
142 fn from_position_and_encoded_size(
143 position: NonZero<usize>,
144 width: usize,
145 len: usize,
146 ) -> LazyTable<I, T> {
147 LazyTable { position, width, len, _marker: PhantomData }
148 }
149}
150
151impl<T> Copy for LazyValue<T> {}
152impl<T> Clone for LazyValue<T> {
153 fn clone(&self) -> Self {
154 *self
155 }
156}
157
158impl<T> Copy for LazyArray<T> {}
159impl<T> Clone for LazyArray<T> {
160 fn clone(&self) -> Self {
161 *self
162 }
163}
164
165impl<I, T> Copy for LazyTable<I, T> {}
166impl<I, T> Clone for LazyTable<I, T> {
167 fn clone(&self) -> Self {
168 *self
169 }
170}
171
172#[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_receiver_is_total_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)]
174enum LazyState {
175 NoNode,
177
178 NodeStart(NonZero<usize>),
181
182 Previous(NonZero<usize>),
185}
186
187type SyntaxContextTable = LazyTable<u32, Option<LazyValue<SyntaxContextKey>>>;
188type ExpnDataTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnData>>>;
189type ExpnHashTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnHash>>>;
190
191#[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)]
192pub(crate) struct ProcMacroData {
193 proc_macro_decls_static: DefIndex,
194 stability: Option<hir::Stability>,
195 macros: LazyArray<DefIndex>,
196}
197
198#[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)]
206pub(crate) struct CrateHeader {
207 pub(crate) triple: TargetTuple,
208 pub(crate) hash: Svh,
209 pub(crate) name: Symbol,
210 pub(crate) is_proc_macro_crate: bool,
215 pub(crate) is_stub: bool,
221}
222
223#[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,
compiler_builtins: ref __binding_38,
needs_allocator: ref __binding_39,
needs_panic_runtime: ref __binding_40,
no_builtins: ref __binding_41,
panic_runtime: ref __binding_42,
profiler_runtime: ref __binding_43,
symbol_mangling_version: ref __binding_44,
specialization_enabled_in: ref __binding_45 } => {
::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);
}
}
}
}
};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),
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)]
241pub(crate) struct CrateRoot {
242 header: CrateHeader,
244
245 extra_filename: String,
246 stable_crate_id: StableCrateId,
247 required_panic_strategy: Option<PanicStrategy>,
248 panic_in_drop_strategy: PanicStrategy,
249 edition: Edition,
250 has_global_allocator: bool,
251 has_alloc_error_handler: bool,
252 has_panic_handler: bool,
253 has_default_lib_allocator: bool,
254 externally_implementable_items: LazyArray<EiiMapEncodedKeyValue>,
255
256 crate_deps: LazyArray<CrateDep>,
257 dylib_dependency_formats: LazyArray<Option<LinkagePreference>>,
258 lib_features: LazyArray<(Symbol, FeatureStability)>,
259 stability_implications: LazyArray<(Symbol, Symbol)>,
260 lang_items: LazyArray<(DefIndex, LangItem)>,
261 lang_items_missing: LazyArray<LangItem>,
262 stripped_cfg_items: LazyArray<StrippedCfgItem<DefIndex>>,
263 diagnostic_items: LazyArray<(Symbol, DefIndex)>,
264 native_libraries: LazyArray<NativeLib>,
265 foreign_modules: LazyArray<ForeignModule>,
266 traits: LazyArray<DefIndex>,
267 impls: LazyArray<TraitImpls>,
268 incoherent_impls: LazyArray<IncoherentImpls>,
269 interpret_alloc_index: LazyArray<u64>,
270 proc_macro_data: Option<ProcMacroData>,
271
272 tables: LazyTables,
273 debugger_visualizers: LazyArray<DebuggerVisualizerFile>,
274
275 exportable_items: LazyArray<DefIndex>,
276 stable_order_of_exportable_impls: LazyArray<(DefIndex, usize)>,
277 exported_non_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
278 exported_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
279
280 syntax_contexts: SyntaxContextTable,
281 expn_data: ExpnDataTable,
282 expn_hashes: ExpnHashTable,
283
284 def_path_hash_map: LazyValue<DefPathHashMapRef<'static>>,
285
286 source_map: LazyTable<u32, Option<LazyValue<rustc_span::SourceFile>>>,
287 target_modifiers: LazyArray<TargetModifier>,
288
289 compiler_builtins: bool,
290 needs_allocator: bool,
291 needs_panic_runtime: bool,
292 no_builtins: bool,
293 panic_runtime: bool,
294 profiler_runtime: bool,
295 symbol_mangling_version: SymbolManglingVersion,
296
297 specialization_enabled_in: bool,
298}
299
300#[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)]
304pub(crate) struct RawDefId {
305 krate: u32,
306 index: u32,
307}
308
309impl From<DefId> for RawDefId {
310 fn from(val: DefId) -> Self {
311 RawDefId { krate: val.krate.as_u32(), index: val.index.as_u32() }
312 }
313}
314
315impl RawDefId {
316 fn decode(self, meta: (CrateMetadataRef<'_>, TyCtxt<'_>)) -> DefId {
318 self.decode_from_cdata(meta.0)
319 }
320
321 fn decode_from_cdata(self, cdata: CrateMetadataRef<'_>) -> DefId {
322 let krate = CrateNum::from_u32(self.krate);
323 let krate = cdata.map_encoded_cnum_to_current(krate);
324 DefId { krate, index: DefIndex::from_u32(self.index) }
325 }
326}
327
328#[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)]
329pub(crate) struct CrateDep {
330 pub name: Symbol,
331 pub hash: Svh,
332 pub host_hash: Option<Svh>,
333 pub kind: CrateDepKind,
334 pub extra_filename: String,
335 pub is_private: bool,
336}
337
338#[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)]
339pub(crate) struct TraitImpls {
340 trait_id: (u32, DefIndex),
341 impls: LazyArray<(DefIndex, Option<SimplifiedType>)>,
342}
343
344#[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)]
345pub(crate) struct IncoherentImpls {
346 self_ty: LazyValue<SimplifiedType>,
347 impls: LazyArray<DefIndex>,
348}
349
350macro_rules! define_tables {
352 (
353 - defaulted: $($name1:ident: Table<$IDX1:ty, $T1:ty>,)+
354 - optional: $($name2:ident: Table<$IDX2:ty, $T2:ty>,)+
355 ) => {
356 #[derive(MetadataEncodable, LazyDecodable)]
357 pub(crate) struct LazyTables {
358 $($name1: LazyTable<$IDX1, $T1>,)+
359 $($name2: LazyTable<$IDX2, Option<$T2>>,)+
360 }
361
362 #[derive(Default)]
363 struct TableBuilders {
364 $($name1: TableBuilder<$IDX1, $T1>,)+
365 $($name2: TableBuilder<$IDX2, Option<$T2>>,)+
366 }
367
368 impl TableBuilders {
369 fn encode(&self, buf: &mut FileEncoder) -> LazyTables {
370 LazyTables {
371 $($name1: self.$name1.encode(buf),)+
372 $($name2: self.$name2.encode(buf),)+
373 }
374 }
375 }
376 }
377}
378
379pub(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! {
380- defaulted:
381 intrinsic: Table<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
382 is_macro_rules: Table<DefIndex, bool>,
383 type_alias_is_lazy: Table<DefIndex, bool>,
384 attr_flags: Table<DefIndex, AttrFlags>,
385 def_path_hashes: Table<DefIndex, u64>,
391 explicit_item_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
392 explicit_item_self_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
393 inferred_outlives_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
394 explicit_super_predicates_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
395 explicit_implied_predicates_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
396 explicit_implied_const_bounds: Table<DefIndex, LazyArray<(ty::PolyTraitRef<'static>, Span)>>,
397 inherent_impls: Table<DefIndex, LazyArray<DefIndex>>,
398 opt_rpitit_info: Table<DefIndex, Option<LazyValue<ty::ImplTraitInTraitData>>>,
399 module_children_reexports: Table<DefIndex, LazyArray<ModChild>>,
404 ambig_module_children: Table<DefIndex, LazyArray<AmbigModChild>>,
405 cross_crate_inlinable: Table<DefIndex, bool>,
406 asyncness: Table<DefIndex, ty::Asyncness>,
407 constness: Table<DefIndex, hir::Constness>,
408 safety: Table<DefIndex, hir::Safety>,
409 defaultness: Table<DefIndex, hir::Defaultness>,
410
411- optional:
412 attributes: Table<DefIndex, LazyArray<hir::Attribute>>,
413 module_children_non_reexports: Table<DefIndex, LazyArray<DefIndex>>,
416 associated_item_or_field_def_ids: Table<DefIndex, LazyArray<DefIndex>>,
417 def_kind: Table<DefIndex, DefKind>,
418 visibility: Table<DefIndex, LazyValue<ty::Visibility<DefIndex>>>,
419 def_span: Table<DefIndex, LazyValue<Span>>,
420 def_ident_span: Table<DefIndex, LazyValue<Span>>,
421 lookup_stability: Table<DefIndex, LazyValue<hir::Stability>>,
422 lookup_const_stability: Table<DefIndex, LazyValue<hir::ConstStability>>,
423 lookup_default_body_stability: Table<DefIndex, LazyValue<hir::DefaultBodyStability>>,
424 lookup_deprecation_entry: Table<DefIndex, LazyValue<attrs::Deprecation>>,
425 explicit_predicates_of: Table<DefIndex, LazyValue<ty::GenericPredicates<'static>>>,
426 generics_of: Table<DefIndex, LazyValue<ty::Generics>>,
427 type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>,
428 variances_of: Table<DefIndex, LazyArray<ty::Variance>>,
429 fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>,
430 codegen_fn_attrs: Table<DefIndex, LazyValue<CodegenFnAttrs>>,
431 impl_trait_header: Table<DefIndex, LazyValue<ty::ImplTraitHeader<'static>>>,
432 const_param_default: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, rustc_middle::ty::Const<'static>>>>,
433 object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
434 optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
435 mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
436 trivial_const: Table<DefIndex, LazyValue<(ConstValue, Ty<'static>)>>,
437 closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
438 mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
439 promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
440 thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
441 impl_parent: Table<DefIndex, RawDefId>,
442 const_conditions: Table<DefIndex, LazyValue<ty::ConstConditions<'static>>>,
443 coerce_unsized_info: Table<DefIndex, LazyValue<ty::adjustment::CoerceUnsizedInfo>>,
445 mir_const_qualif: Table<DefIndex, LazyValue<mir::ConstQualifs>>,
446 rendered_const: Table<DefIndex, LazyValue<String>>,
447 rendered_precise_capturing_args: Table<DefIndex, LazyArray<PreciseCapturingArgKind<Symbol, Symbol>>>,
448 fn_arg_idents: Table<DefIndex, LazyArray<Option<Ident>>>,
449 coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
450 coroutine_for_closure: Table<DefIndex, RawDefId>,
451 adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
452 adt_async_destructor: Table<DefIndex, LazyValue<ty::AsyncDestructor>>,
453 coroutine_by_move_body_def_id: Table<DefIndex, RawDefId>,
454 eval_static_initializer: Table<DefIndex, LazyValue<mir::interpret::ConstAllocation<'static>>>,
455 trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,
456 expn_that_defined: Table<DefIndex, LazyValue<ExpnId>>,
457 default_fields: Table<DefIndex, LazyValue<DefId>>,
458 params_in_repr: Table<DefIndex, LazyValue<DenseBitSet<u32>>>,
459 repr_options: Table<DefIndex, LazyValue<ReprOptions>>,
460 def_keys: Table<DefIndex, LazyValue<DefKey>>,
465 proc_macro_quoted_spans: Table<usize, LazyValue<Span>>,
466 variant_data: Table<DefIndex, LazyValue<VariantData>>,
467 assoc_container: Table<DefIndex, LazyValue<ty::AssocContainer>>,
468 macro_definition: Table<DefIndex, LazyValue<ast::DelimArgs>>,
469 proc_macro: Table<DefIndex, MacroKind>,
470 deduced_param_attrs: Table<DefIndex, LazyArray<DeducedParamAttrs>>,
471 trait_impl_trait_tys: Table<DefIndex, LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>,
472 doc_link_resolutions: Table<DefIndex, LazyValue<DocLinkResMap>>,
473 doc_link_traits_in_scope: Table<DefIndex, LazyArray<DefId>>,
474 assumed_wf_types_for_rpitit: Table<DefIndex, LazyArray<(Ty<'static>, Span)>>,
475 opaque_ty_origin: Table<DefIndex, LazyValue<hir::OpaqueTyOrigin<DefId>>>,
476 anon_const_kind: Table<DefIndex, LazyValue<ty::AnonConstKind>>,
477 const_of_item: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
478 associated_types_for_impl_traits_in_trait_or_impl: Table<DefIndex, LazyValue<DefIdMap<Vec<DefId>>>>,
479}
480
481#[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)]
482struct VariantData {
483 idx: VariantIdx,
484 discr: ty::VariantDiscr,
485 ctor: Option<(CtorKind, DefIndex)>,
487 is_non_exhaustive: bool,
488}
489
490pub 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_receiver_is_total_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! {
491 #[derive(Default)]
492 pub struct AttrFlags: u8 {
493 const IS_DOC_HIDDEN = 1 << 0;
494 }
495}
496
497#[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)]
514struct SpanTag(u8);
515
516#[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_receiver_is_total_eq(&self) -> () {}
}Eq)]
517enum SpanKind {
518 Local = 0b00,
519 Foreign = 0b01,
520 Partial = 0b10,
521 Indirect = 0b11,
525}
526
527impl SpanTag {
528 fn new(kind: SpanKind, context: rustc_span::SyntaxContext, length: usize) -> SpanTag {
529 let mut data = 0u8;
530 data |= kind as u8;
531 if context.is_root() {
532 data |= 0b100;
533 }
534 let all_1s_len = (0xffu8 << 3) >> 3;
535 if length < all_1s_len as usize {
537 data |= (length as u8) << 3;
538 } else {
539 data |= all_1s_len << 3;
540 }
541
542 SpanTag(data)
543 }
544
545 fn indirect(relative: bool, length_bytes: u8) -> SpanTag {
546 let mut tag = SpanTag(SpanKind::Indirect as u8);
547 if relative {
548 tag.0 |= 0b100;
549 }
550 if !(length_bytes <= 8) {
::core::panicking::panic("assertion failed: length_bytes <= 8")
};assert!(length_bytes <= 8);
551 tag.0 |= length_bytes << 3;
552 tag
553 }
554
555 fn kind(self) -> SpanKind {
556 let masked = self.0 & 0b11;
557 match masked {
558 0b00 => SpanKind::Local,
559 0b01 => SpanKind::Foreign,
560 0b10 => SpanKind::Partial,
561 0b11 => SpanKind::Indirect,
562 _ => ::core::panicking::panic("internal error: entered unreachable code")unreachable!(),
563 }
564 }
565
566 fn is_relative_offset(self) -> bool {
567 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);
568 self.0 & 0b100 != 0
569 }
570
571 fn context(self) -> Option<rustc_span::SyntaxContext> {
572 if self.0 & 0b100 != 0 { Some(rustc_span::SyntaxContext::root()) } else { None }
573 }
574
575 fn length(self) -> Option<rustc_span::BytePos> {
576 let all_1s_len = (0xffu8 << 3) >> 3;
577 let len = self.0 >> 3;
578 if len != all_1s_len { Some(rustc_span::BytePos(u32::from(len))) } else { None }
579 }
580}
581
582const SYMBOL_STR: u8 = 0;
584const SYMBOL_OFFSET: u8 = 1;
585const SYMBOL_PREDEFINED: u8 = 2;
586
587pub fn provide(providers: &mut Providers) {
588 encoder::provide(&mut providers.queries);
589 decoder::provide(providers);
590}