1use std::marker::PhantomData;
2use std::mem::size_of;
3use std::num::NonZero;
4
5use decoder::LazyDecoder;
6pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob, TargetModifiers};
7use def_path_hash_map::DefPathHashMapRef;
8use encoder::EncodeContext;
9pub use encoder::{EncodedMetadata, encode_metadata, rendered_const};
10pub(crate) use parameterized::ParameterizedOverTcx;
11use rustc_abi::{FieldIdx, ReprOptions, VariantIdx};
12use rustc_ast as ast;
13use rustc_attr_ir::lang_items::LangItem;
14use rustc_attr_ir::{Stability, StrippedCfgItem};
15use rustc_crate_store::{CrateDepKind, ForeignModule, LinkagePreference, NativeLib};
16use rustc_data_structures::fingerprint::Fingerprint;
17use rustc_data_structures::fx::FxHashMap;
18use rustc_data_structures::svh::Svh;
19use rustc_hir as hir;
20use rustc_hir::PreciseCapturingArgKind;
21use rustc_hir::def::{CtorKind, DefKind, MacroKinds};
22use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIndex, DefPathHash, StableCrateId};
23use rustc_hir::definitions::DefKey;
24use rustc_index::IndexVec;
25use rustc_index::bit_set::DenseBitSet;
26use rustc_macros::{
27 BlobDecodable, Decodable, Encodable, LazyDecodable, MetadataEncodable, TyDecodable, TyEncodable,
28};
29use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
30use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile;
31use rustc_middle::middle::deduced_param_attrs::DeducedParamAttrs;
32use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo};
33use rustc_middle::middle::lib_features::FeatureStability;
34use rustc_middle::middle::resolve::{AmbigModChild, DocLinkResMap, ModChild};
35use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
36use rustc_middle::mir;
37use rustc_middle::mir::ConstValue;
38use rustc_middle::ty::fast_reject::SimplifiedType;
39use rustc_middle::ty::{self, Ty, TyCtxt};
40use rustc_middle::util::Providers;
41use rustc_serialize::opaque::FileEncoder;
42use rustc_session::config::mitigation_coverage::DeniedPartialMitigation;
43use rustc_session::config::{SymbolManglingVersion, TargetModifier};
44use rustc_span::edition::Edition;
45use rustc_span::hygiene::{ExpnIndex, MacroKind, SyntaxContextKey};
46use rustc_span::{self, ExpnData, ExpnHash, ExpnId, Ident, Span, Symbol};
47use rustc_target::spec::{PanicStrategy, TargetTuple};
48use table::TableBuilder;
49
50use crate::eii::EiiMapEncodedKeyValue;
51
52mod decoder;
53mod def_path_hash_map;
54mod encoder;
55mod parameterized;
56mod table;
57
58pub(crate) fn rustc_version(cfg_version: &'static str) -> String {
59 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("rustc {0}", cfg_version))
})format!("rustc {cfg_version}")
60}
61
62const METADATA_VERSION: u8 = 11;
66
67pub const METADATA_HEADER: &[u8] = &[b'r', b'u', b's', b't', 0, 0, 0, METADATA_VERSION];
74
75const ROOT_POS_OFFSET: usize = METADATA_HEADER.len();
79const ROOT_POS_LEN: usize = size_of::<u64>();
80const UNHASHED_POS_OFFSET: usize = ROOT_POS_OFFSET + ROOT_POS_LEN;
81const UNHASHED_POS_LEN: usize = size_of::<u64>();
82const CRATE_HASH_OFFSET: usize = UNHASHED_POS_OFFSET + UNHASHED_POS_LEN;
83const CRATE_HASH_LEN: usize = size_of::<Fingerprint>();
84const VERSION_OFFSET: usize = CRATE_HASH_OFFSET + CRATE_HASH_LEN;
85
86#[must_use]
102struct LazyValue<T> {
103 position: NonZero<usize>,
104 _marker: PhantomData<fn() -> T>,
105}
106
107impl<T> LazyValue<T> {
108 fn from_position(position: NonZero<usize>) -> LazyValue<T> {
109 LazyValue { position, _marker: PhantomData }
110 }
111}
112
113struct LazyArray<T> {
124 position: NonZero<usize>,
125 num_elems: usize,
126 _marker: PhantomData<fn() -> T>,
127}
128
129impl<T> Default for LazyArray<T> {
130 fn default() -> LazyArray<T> {
131 LazyArray::from_position_and_num_elems(NonZero::new(1).unwrap(), 0)
132 }
133}
134
135impl<T> LazyArray<T> {
136 fn from_position_and_num_elems(position: NonZero<usize>, num_elems: usize) -> LazyArray<T> {
137 LazyArray { position, num_elems, _marker: PhantomData }
138 }
139}
140
141struct LazyTable<I, T> {
147 position: NonZero<usize>,
148 width: usize,
151 len: usize,
153 _marker: PhantomData<fn(I) -> T>,
154}
155
156impl<I, T> LazyTable<I, T> {
157 fn from_position_and_encoded_size(
158 position: NonZero<usize>,
159 width: usize,
160 len: usize,
161 ) -> LazyTable<I, T> {
162 LazyTable { position, width, len, _marker: PhantomData }
163 }
164}
165
166impl<T> Copy for LazyValue<T> {}
167impl<T> Clone for LazyValue<T> {
168 fn clone(&self) -> Self {
169 *self
170 }
171}
172
173impl<T> Copy for LazyArray<T> {}
174impl<T> Clone for LazyArray<T> {
175 fn clone(&self) -> Self {
176 *self
177 }
178}
179
180impl<I, T> Copy for LazyTable<I, T> {}
181impl<I, T> Clone for LazyTable<I, T> {
182 fn clone(&self) -> Self {
183 *self
184 }
185}
186
187#[derive(#[automatically_derived]
impl ::core::marker::Copy for LazyState { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for LazyState { }
#[automatically_derived]
impl ::core::clone::Clone for LazyState {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<NonZero<usize>>;
let _: ::core::clone::AssertParamIsClone<NonZero<usize>>;
*self
}
}Clone, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for LazyState { }
#[automatically_derived]
impl ::core::cmp::PartialEq for LazyState {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::NodeStart(__self_0), Self::NodeStart(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Previous(__self_0), Self::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 {
Self::NoNode => ::core::fmt::Formatter::write_str(f, "NoNode"),
Self::NodeStart(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"NodeStart", &__self_0),
Self::Previous(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"Previous", &__self_0),
}
}
}Debug)]
189enum LazyState {
190 NoNode,
192
193 NodeStart(NonZero<usize>),
196
197 Previous(NonZero<usize>),
200}
201
202type SyntaxContextTable = LazyTable<u32, Option<LazyValue<SyntaxContextKey>>>;
203type ExpnDataTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnData>>>;
204type ExpnHashTable = LazyTable<ExpnIndex, Option<LazyValue<ExpnHash>>>;
205
206#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
ProcMacroData {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let ProcMacroData {
proc_macro_decls_static: ref __binding_0,
stability: ref __binding_1,
macros: ref __binding_2 } = *self;
::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)]
207pub(crate) struct ProcMacroData {
208 proc_macro_decls_static: DefIndex,
209 stability: Option<Stability>,
210 macros: LazyArray<(DefIndex, LazyValue<ProcMacroKind>)>,
211}
212
213#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
ProcMacroKind {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let disc =
match *self {
ProcMacroKind::CustomDerive {
trait_name: ref __binding_0, attributes: ref __binding_1 }
=> {
0usize
}
ProcMacroKind::Attr { name: ref __binding_0 } => { 1usize }
ProcMacroKind::Bang { name: ref __binding_0 } => { 2usize }
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
ProcMacroKind::CustomDerive {
trait_name: ref __binding_0, attributes: ref __binding_1 }
=> {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_1, __encoder);
}
ProcMacroKind::Attr { name: ref __binding_0 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
}
ProcMacroKind::Bang { name: ref __binding_0 } => {
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_0, __encoder);
}
}
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for
ProcMacroKind {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
ProcMacroKind::CustomDerive {
trait_name: ::rustc_serialize::Decodable::decode(__decoder),
attributes: ::rustc_serialize::Decodable::decode(__decoder),
}
}
1usize => {
ProcMacroKind::Attr {
name: ::rustc_serialize::Decodable::decode(__decoder),
}
}
2usize => {
ProcMacroKind::Bang {
name: ::rustc_serialize::Decodable::decode(__decoder),
}
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `ProcMacroKind`, expected 0..3, actual {0}",
n));
}
}
}
}
};LazyDecodable)]
214pub enum ProcMacroKind {
215 CustomDerive { trait_name: String, attributes: Vec<String> },
216 Attr { name: String },
217 Bang { name: String },
218}
219
220#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
CrateHeader {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let CrateHeader {
triple: ref __binding_0,
name: ref __binding_1,
is_proc_macro_crate: ref __binding_2,
is_stub: ref __binding_3 } = *self;
::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);
}
}
};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),
name: ::rustc_serialize::Decodable::decode(__decoder),
is_proc_macro_crate: ::rustc_serialize::Decodable::decode(__decoder),
is_stub: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};BlobDecodable)]
228pub(crate) struct CrateHeader {
229 pub(crate) triple: TargetTuple,
230 pub(crate) name: Symbol,
231 pub(crate) is_proc_macro_crate: bool,
236 pub(crate) is_stub: bool,
242}
243
244#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
CrateRoot {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let CrateRoot {
header: ref __binding_0,
stable_crate_id: ref __binding_1,
required_panic_strategy: ref __binding_2,
panic_in_drop_strategy: ref __binding_3,
edition: ref __binding_4,
has_global_allocator: ref __binding_5,
has_alloc_error_handler: ref __binding_6,
has_panic_handler: ref __binding_7,
has_default_lib_allocator: ref __binding_8,
externally_implementable_items: ref __binding_9,
crate_deps: ref __binding_10,
dylib_dependency_formats: ref __binding_11,
lib_features: ref __binding_12,
stability_implications: ref __binding_13,
lang_items: ref __binding_14,
lang_items_missing: ref __binding_15,
stripped_cfg_items: ref __binding_16,
diagnostic_items: ref __binding_17,
canonical_symbols: ref __binding_18,
fake_doc_items: ref __binding_19,
native_libraries: ref __binding_20,
foreign_modules: ref __binding_21,
traits: ref __binding_22,
impls: ref __binding_23,
incoherent_impls: ref __binding_24,
interpret_alloc_index: ref __binding_25,
proc_macro_data: ref __binding_26,
tables: ref __binding_27,
debugger_visualizers: ref __binding_28,
exportable_items: ref __binding_29,
stable_order_of_exportable_impls: ref __binding_30,
exported_non_generic_symbols: ref __binding_31,
exported_generic_symbols: ref __binding_32,
syntax_contexts: ref __binding_33,
expn_data: ref __binding_34,
expn_hashes: ref __binding_35,
def_path_hash_map: ref __binding_36,
source_map: ref __binding_37,
target_modifiers: ref __binding_38,
denied_partial_mitigations: ref __binding_39,
compiler_builtins: ref __binding_40,
needs_allocator: ref __binding_41,
needs_panic_runtime: ref __binding_42,
no_builtins: ref __binding_43,
panic_runtime: ref __binding_44,
profiler_runtime: ref __binding_45,
symbol_mangling_version: ref __binding_46,
specialization_enabled_in: ref __binding_47 } = *self;
::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);
}
}
};MetadataEncodable, const _: () =
{
impl<__D: LazyDecoder> ::rustc_serialize::Decodable<__D> for CrateRoot
{
fn decode(__decoder: &mut __D) -> Self {
CrateRoot {
header: ::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),
canonical_symbols: ::rustc_serialize::Decodable::decode(__decoder),
fake_doc_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)]
262pub(crate) struct CrateRoot {
263 header: CrateHeader,
265
266 stable_crate_id: StableCrateId,
267 required_panic_strategy: Option<PanicStrategy>,
268 panic_in_drop_strategy: PanicStrategy,
269 edition: Edition,
270 has_global_allocator: bool,
271 has_alloc_error_handler: bool,
272 has_panic_handler: bool,
273 has_default_lib_allocator: bool,
274 externally_implementable_items: LazyArray<EiiMapEncodedKeyValue>,
275
276 crate_deps: LazyArray<CrateDep>,
277 dylib_dependency_formats: LazyArray<Option<LinkagePreference>>,
278 lib_features: LazyArray<(Symbol, FeatureStability)>,
279 stability_implications: LazyArray<(Symbol, Symbol)>,
280 lang_items: LazyArray<(DefIndex, LangItem)>,
281 lang_items_missing: LazyArray<LangItem>,
282 stripped_cfg_items: LazyArray<StrippedCfgItem<DefIndex>>,
283 diagnostic_items: LazyArray<(Symbol, DefIndex)>,
284 canonical_symbols: LazyArray<(Symbol, DefIndex)>,
285 fake_doc_items: LazyArray<DefIndex>,
286 native_libraries: LazyArray<NativeLib>,
287 foreign_modules: LazyArray<ForeignModule>,
288 traits: LazyArray<DefIndex>,
289 impls: LazyArray<TraitImpls>,
290 incoherent_impls: LazyArray<IncoherentImpls>,
291 interpret_alloc_index: LazyArray<u64>,
292 proc_macro_data: Option<ProcMacroData>,
293
294 tables: LazyTables,
295 debugger_visualizers: LazyArray<DebuggerVisualizerFile>,
296
297 exportable_items: LazyArray<DefIndex>,
298 stable_order_of_exportable_impls: LazyArray<(DefIndex, usize)>,
299 exported_non_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
300 exported_generic_symbols: LazyArray<(ExportedSymbol<'static>, SymbolExportInfo)>,
301
302 syntax_contexts: SyntaxContextTable,
303 expn_data: ExpnDataTable,
304 expn_hashes: ExpnHashTable,
305
306 def_path_hash_map: LazyValue<DefPathHashMapRef<'static>>,
307
308 source_map: LazyTable<u32, Option<LazyValue<rustc_span::SourceFile>>>,
309 target_modifiers: LazyArray<TargetModifier>,
310 denied_partial_mitigations: LazyArray<DeniedPartialMitigation>,
311
312 compiler_builtins: bool,
313 needs_allocator: bool,
314 needs_panic_runtime: bool,
315 no_builtins: bool,
316 panic_runtime: bool,
317 profiler_runtime: bool,
318 symbol_mangling_version: SymbolManglingVersion,
319
320 specialization_enabled_in: bool,
321}
322
323#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
CrateRootUnhashed {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let CrateRootUnhashed {
extra_filename: ref __binding_0,
dep_extra_filenames: ref __binding_1 } = *self;
::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
CrateRootUnhashed {
fn decode(__decoder: &mut __D) -> Self {
CrateRootUnhashed {
extra_filename: ::rustc_serialize::Decodable::decode(__decoder),
dep_extra_filenames: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};LazyDecodable)]
326pub(crate) struct CrateRootUnhashed {
327 extra_filename: String,
328
329 dep_extra_filenames: IndexVec<CrateNum, String>,
333}
334
335#[derive(#[automatically_derived]
impl ::core::marker::Copy for RawDefId { }Copy, #[automatically_derived]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for RawDefId { }
#[automatically_derived]
impl ::core::clone::Clone for RawDefId {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<u32>;
*self
}
}Clone)]
339pub(crate) struct RawDefId {
340 krate: u32,
341 index: u32,
342}
343
344impl From<DefId> for RawDefId {
345 fn from(val: DefId) -> Self {
346 RawDefId { krate: val.krate.as_u32(), index: val.index.as_u32() }
347 }
348}
349
350impl RawDefId {
351 fn decode(self, meta: (&CrateMetadata, TyCtxt<'_>)) -> DefId {
353 let krate = CrateNum::from_u32(self.krate);
354 let krate = meta.0.map_encoded_cnum_to_current(krate);
355 DefId { krate, index: DefIndex::from_u32(self.index) }
356 }
357}
358
359#[derive(const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for CrateDep {
fn encode(&self, __encoder: &mut __E) {
let CrateDep {
name: ref __binding_0,
hash: ref __binding_1,
host_hash: ref __binding_2,
kind: ref __binding_3,
is_private: ref __binding_4 } = *self;
::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);
}
}
};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),
is_private: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};BlobDecodable)]
364pub(crate) struct CrateDep {
365 pub name: Symbol,
366 pub hash: Svh,
367 pub host_hash: Option<Svh>,
368 pub kind: CrateDepKind,
369 pub is_private: bool,
370}
371
372#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
TraitImpls {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let TraitImpls {
trait_id: ref __binding_0, impls: ref __binding_1 } = *self;
::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)]
373pub(crate) struct TraitImpls {
374 trait_id: (u32, DefIndex),
375 impls: LazyArray<(DefIndex, Option<SimplifiedType>)>,
376}
377
378#[derive(const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
IncoherentImpls {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let IncoherentImpls {
self_ty: ref __binding_0, impls: ref __binding_1 } = *self;
::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)]
379pub(crate) struct IncoherentImpls {
380 self_ty: LazyValue<SimplifiedType>,
381 impls: LazyArray<DefIndex>,
382}
383
384macro_rules! define_tables {
386 (
387 - defaulted: $($name1:ident: Table<$IDX1:ty, $T1:ty>,)+
388 - optional: $($name2:ident: Table<$IDX2:ty, $T2:ty>,)+
389 ) => {
390 #[derive(MetadataEncodable, LazyDecodable)]
391 pub(crate) struct LazyTables {
392 $($name1: LazyTable<$IDX1, $T1>,)+
393 $($name2: LazyTable<$IDX2, Option<$T2>>,)+
394 }
395
396 #[derive(Default)]
397 struct TableBuilders {
398 $($name1: TableBuilder<$IDX1, $T1>,)+
399 $($name2: TableBuilder<$IDX2, Option<$T2>>,)+
400 }
401
402 impl TableBuilders {
403 fn encode(&self, buf: &mut FileEncoder<'_>) -> LazyTables {
404 LazyTables {
405 $($name1: self.$name1.encode(buf),)+
406 $($name2: self.$name2.encode(buf),)+
407 }
408 }
409 }
410 }
411}
412
413pub(crate) struct LazyTables {
intrinsic: LazyTable<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
is_macro_rules: LazyTable<DefIndex, bool>,
type_alias_is_checked: 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_clauses_of: LazyTable<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_clauses_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>,
impl_is_fully_generic_for_reflection: LazyTable<DefIndex, bool>,
attributes: LazyTable<DefIndex,
Option<LazyArray<rustc_attr_ir::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<Stability>>>,
lookup_const_stability: LazyTable<DefIndex,
Option<LazyValue<rustc_attr_ir::ConstStability>>>,
lookup_default_body_stability: LazyTable<DefIndex,
Option<LazyValue<rustc_attr_ir::DefaultBodyStability>>>,
lookup_deprecation_entry: LazyTable<DefIndex,
Option<LazyValue<rustc_attr_ir::Deprecation>>>,
explicit_clauses_of: LazyTable<DefIndex,
Option<LazyValue<ty::GenericClauses<'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>>>,
deduced_param_attrs: LazyTable<DefIndex,
Option<LazyArray<DeducedParamAttrs>>>,
collect_return_position_impl_trait_in_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<Option<ty::EarlyBinder<'static, ty::Const<'static>>>>>>,
associated_types_for_impl_traits_in_trait_or_impl: LazyTable<DefIndex,
Option<LazyValue<DefIdMap<Vec<DefId>>>>>,
live_args_for_alias_from_outlives_bounds: LazyTable<DefIndex,
Option<LazyValue<DenseBitSet<u32>>>>,
args_known_to_outlive_alias_params: LazyTable<DefIndex,
Option<LazyValue<Vec<(usize, DenseBitSet<u32>)>>>>,
mut_restriction: LazyTable<DefIndex,
Option<LazyValue<ty::RestrictionKind>>>,
}
const _: () =
{
impl<'tcx, '__a>
::rustc_serialize::Encodable<EncodeContext<'__a, 'tcx>> for
LazyTables {
fn encode(&self, __encoder: &mut EncodeContext<'__a, 'tcx>) {
#![allow(unreachable_code)]
let LazyTables {
intrinsic: ref __binding_0,
is_macro_rules: ref __binding_1,
type_alias_is_checked: 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_clauses_of: ref __binding_8,
explicit_implied_clauses_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,
impl_is_fully_generic_for_reflection: ref __binding_20,
attributes: ref __binding_21,
module_children_non_reexports: ref __binding_22,
associated_item_or_field_def_ids: ref __binding_23,
def_kind: ref __binding_24,
visibility: ref __binding_25,
def_span: ref __binding_26,
def_ident_span: ref __binding_27,
lookup_stability: ref __binding_28,
lookup_const_stability: ref __binding_29,
lookup_default_body_stability: ref __binding_30,
lookup_deprecation_entry: ref __binding_31,
explicit_clauses_of: ref __binding_32,
generics_of: ref __binding_33,
type_of: ref __binding_34,
variances_of: ref __binding_35,
fn_sig: ref __binding_36,
codegen_fn_attrs: ref __binding_37,
impl_trait_header: ref __binding_38,
const_param_default: ref __binding_39,
object_lifetime_default: ref __binding_40,
optimized_mir: ref __binding_41,
mir_for_ctfe: ref __binding_42,
trivial_const: ref __binding_43,
closure_saved_names_of_captured_variables: ref __binding_44,
mir_coroutine_witnesses: ref __binding_45,
promoted_mir: ref __binding_46,
thir_abstract_const: ref __binding_47,
impl_parent: ref __binding_48,
const_conditions: ref __binding_49,
coerce_unsized_info: ref __binding_50,
mir_const_qualif: ref __binding_51,
rendered_const: ref __binding_52,
rendered_precise_capturing_args: ref __binding_53,
fn_arg_idents: ref __binding_54,
coroutine_kind: ref __binding_55,
coroutine_for_closure: ref __binding_56,
adt_destructor: ref __binding_57,
adt_async_destructor: ref __binding_58,
coroutine_by_move_body_def_id: ref __binding_59,
eval_static_initializer: ref __binding_60,
trait_def: ref __binding_61,
expn_that_defined: ref __binding_62,
default_fields: ref __binding_63,
params_in_repr: ref __binding_64,
repr_options: ref __binding_65,
def_keys: ref __binding_66,
proc_macro_quoted_spans: ref __binding_67,
variant_data: ref __binding_68,
assoc_container: ref __binding_69,
macro_definition: ref __binding_70,
deduced_param_attrs: ref __binding_71,
collect_return_position_impl_trait_in_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,
live_args_for_alias_from_outlives_bounds: ref __binding_80,
args_known_to_outlive_alias_params: ref __binding_81,
mut_restriction: ref __binding_82 } = *self;
::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);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_80, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_81, __encoder);
::rustc_serialize::Encodable::<EncodeContext<'__a,
'tcx>>::encode(__binding_82, __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_checked: ::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_clauses_of: ::rustc_serialize::Decodable::decode(__decoder),
explicit_implied_clauses_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),
impl_is_fully_generic_for_reflection: ::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_clauses_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),
deduced_param_attrs: ::rustc_serialize::Decodable::decode(__decoder),
collect_return_position_impl_trait_in_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),
live_args_for_alias_from_outlives_bounds: ::rustc_serialize::Decodable::decode(__decoder),
args_known_to_outlive_alias_params: ::rustc_serialize::Decodable::decode(__decoder),
mut_restriction: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};
struct TableBuilders {
intrinsic: TableBuilder<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
is_macro_rules: TableBuilder<DefIndex, bool>,
type_alias_is_checked: 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_clauses_of: TableBuilder<DefIndex,
LazyArray<(ty::Clause<'static>, Span)>>,
explicit_implied_clauses_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>,
impl_is_fully_generic_for_reflection: TableBuilder<DefIndex, bool>,
attributes: TableBuilder<DefIndex,
Option<LazyArray<rustc_attr_ir::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<Stability>>>,
lookup_const_stability: TableBuilder<DefIndex,
Option<LazyValue<rustc_attr_ir::ConstStability>>>,
lookup_default_body_stability: TableBuilder<DefIndex,
Option<LazyValue<rustc_attr_ir::DefaultBodyStability>>>,
lookup_deprecation_entry: TableBuilder<DefIndex,
Option<LazyValue<rustc_attr_ir::Deprecation>>>,
explicit_clauses_of: TableBuilder<DefIndex,
Option<LazyValue<ty::GenericClauses<'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>>>,
deduced_param_attrs: TableBuilder<DefIndex,
Option<LazyArray<DeducedParamAttrs>>>,
collect_return_position_impl_trait_in_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<Option<ty::EarlyBinder<'static, ty::Const<'static>>>>>>,
associated_types_for_impl_traits_in_trait_or_impl: TableBuilder<DefIndex,
Option<LazyValue<DefIdMap<Vec<DefId>>>>>,
live_args_for_alias_from_outlives_bounds: TableBuilder<DefIndex,
Option<LazyValue<DenseBitSet<u32>>>>,
args_known_to_outlive_alias_params: TableBuilder<DefIndex,
Option<LazyValue<Vec<(usize, DenseBitSet<u32>)>>>>,
mut_restriction: TableBuilder<DefIndex,
Option<LazyValue<ty::RestrictionKind>>>,
}
#[automatically_derived]
impl ::core::default::Default for TableBuilders {
#[inline]
fn default() -> Self {
TableBuilders {
intrinsic: ::core::default::Default::default(),
is_macro_rules: ::core::default::Default::default(),
type_alias_is_checked: ::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_clauses_of: ::core::default::Default::default(),
explicit_implied_clauses_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(),
impl_is_fully_generic_for_reflection: ::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_clauses_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(),
deduced_param_attrs: ::core::default::Default::default(),
collect_return_position_impl_trait_in_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(),
live_args_for_alias_from_outlives_bounds: ::core::default::Default::default(),
args_known_to_outlive_alias_params: ::core::default::Default::default(),
mut_restriction: ::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_checked: self.type_alias_is_checked.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_clauses_of: self.explicit_super_clauses_of.encode(buf),
explicit_implied_clauses_of: self.explicit_implied_clauses_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),
impl_is_fully_generic_for_reflection: self.impl_is_fully_generic_for_reflection.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_clauses_of: self.explicit_clauses_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),
deduced_param_attrs: self.deduced_param_attrs.encode(buf),
collect_return_position_impl_trait_in_trait_tys: self.collect_return_position_impl_trait_in_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),
live_args_for_alias_from_outlives_bounds: self.live_args_for_alias_from_outlives_bounds.encode(buf),
args_known_to_outlive_alias_params: self.args_known_to_outlive_alias_params.encode(buf),
mut_restriction: self.mut_restriction.encode(buf),
}
}
}define_tables! {
414- defaulted:
415 intrinsic: Table<DefIndex, Option<LazyValue<ty::IntrinsicDef>>>,
416 is_macro_rules: Table<DefIndex, bool>,
417 type_alias_is_checked: Table<DefIndex, bool>,
418 attr_flags: Table<DefIndex, AttrFlags>,
419 def_path_hashes: Table<DefIndex, u64>,
425 explicit_item_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
426 explicit_item_self_bounds: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
427 inferred_outlives_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
428 explicit_super_clauses_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
429 explicit_implied_clauses_of: Table<DefIndex, LazyArray<(ty::Clause<'static>, Span)>>,
430 explicit_implied_const_bounds: Table<DefIndex, LazyArray<(ty::PolyTraitRef<'static>, Span)>>,
431 inherent_impls: Table<DefIndex, LazyArray<DefIndex>>,
432 opt_rpitit_info: Table<DefIndex, Option<LazyValue<ty::ImplTraitInTraitData>>>,
433 module_children_reexports: Table<DefIndex, LazyArray<ModChild>>,
438 ambig_module_children: Table<DefIndex, LazyArray<AmbigModChild>>,
439 cross_crate_inlinable: Table<DefIndex, bool>,
440 asyncness: Table<DefIndex, ty::Asyncness>,
441 constness: Table<DefIndex, hir::Constness>,
442 safety: Table<DefIndex, hir::Safety>,
443 defaultness: Table<DefIndex, hir::Defaultness>,
444 impl_is_fully_generic_for_reflection: Table<DefIndex, bool>,
445
446- optional:
447 attributes: Table<DefIndex, LazyArray<rustc_attr_ir::Attribute>>,
448 module_children_non_reexports: Table<DefIndex, LazyArray<DefIndex>>,
451 associated_item_or_field_def_ids: Table<DefIndex, LazyArray<DefIndex>>,
452 def_kind: Table<DefIndex, DefKind>,
453 visibility: Table<DefIndex, LazyValue<ty::Visibility<DefIndex>>>,
454 def_span: Table<DefIndex, LazyValue<Span>>,
455 def_ident_span: Table<DefIndex, LazyValue<Span>>,
456 lookup_stability: Table<DefIndex, LazyValue<Stability>>,
457 lookup_const_stability: Table<DefIndex, LazyValue<rustc_attr_ir::ConstStability>>,
458 lookup_default_body_stability: Table<DefIndex, LazyValue<rustc_attr_ir::DefaultBodyStability>>,
459 lookup_deprecation_entry: Table<DefIndex, LazyValue<rustc_attr_ir::Deprecation>>,
460 explicit_clauses_of: Table<DefIndex, LazyValue<ty::GenericClauses<'static>>>,
461 generics_of: Table<DefIndex, LazyValue<ty::Generics>>,
462 type_of: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, Ty<'static>>>>,
463 variances_of: Table<DefIndex, LazyArray<ty::Variance>>,
464 fn_sig: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::PolyFnSig<'static>>>>,
465 codegen_fn_attrs: Table<DefIndex, LazyValue<CodegenFnAttrs>>,
466 impl_trait_header: Table<DefIndex, LazyValue<ty::ImplTraitHeader<'static>>>,
467 const_param_default: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, rustc_middle::ty::Const<'static>>>>,
468 object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
469 optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
470 mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
471 trivial_const: Table<DefIndex, LazyValue<(ConstValue, Ty<'static>)>>,
472 closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
473 mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
474 promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
475 thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<'static, ty::Const<'static>>>>,
476 impl_parent: Table<DefIndex, RawDefId>,
477 const_conditions: Table<DefIndex, LazyValue<ty::ConstConditions<'static>>>,
478 coerce_unsized_info: Table<DefIndex, LazyValue<ty::adjustment::CoerceUnsizedInfo>>,
480 mir_const_qualif: Table<DefIndex, LazyValue<mir::ConstQualifs>>,
481 rendered_const: Table<DefIndex, LazyValue<String>>,
482 rendered_precise_capturing_args: Table<DefIndex, LazyArray<PreciseCapturingArgKind<Symbol, Symbol>>>,
483 fn_arg_idents: Table<DefIndex, LazyArray<Option<Ident>>>,
484 coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
485 coroutine_for_closure: Table<DefIndex, RawDefId>,
486 adt_destructor: Table<DefIndex, LazyValue<ty::Destructor>>,
487 adt_async_destructor: Table<DefIndex, LazyValue<ty::AsyncDestructor>>,
488 coroutine_by_move_body_def_id: Table<DefIndex, RawDefId>,
489 eval_static_initializer: Table<DefIndex, LazyValue<mir::interpret::ConstAllocation<'static>>>,
490 trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,
491 expn_that_defined: Table<DefIndex, LazyValue<ExpnId>>,
492 default_fields: Table<DefIndex, LazyValue<DefId>>,
493 params_in_repr: Table<DefIndex, LazyValue<DenseBitSet<u32>>>,
494 repr_options: Table<DefIndex, LazyValue<ReprOptions>>,
495 def_keys: Table<DefIndex, LazyValue<DefKey>>,
500 proc_macro_quoted_spans: Table<usize, LazyValue<Span>>,
501 variant_data: Table<DefIndex, LazyValue<VariantData>>,
502 assoc_container: Table<DefIndex, LazyValue<ty::AssocContainer>>,
503 macro_definition: Table<DefIndex, LazyValue<ast::DelimArgs>>,
504 deduced_param_attrs: Table<DefIndex, LazyArray<DeducedParamAttrs>>,
505 collect_return_position_impl_trait_in_trait_tys: Table<DefIndex, LazyValue<DefIdMap<ty::EarlyBinder<'static, Ty<'static>>>>>,
506 doc_link_resolutions: Table<DefIndex, LazyValue<DocLinkResMap>>,
507 doc_link_traits_in_scope: Table<DefIndex, LazyArray<DefId>>,
508 assumed_wf_types_for_rpitit: Table<DefIndex, LazyArray<(Ty<'static>, Span)>>,
509 opaque_ty_origin: Table<DefIndex, LazyValue<hir::OpaqueTyOrigin<DefId>>>,
510 anon_const_kind: Table<DefIndex, LazyValue<ty::AnonConstKind>>,
511 const_of_item: Table<DefIndex, LazyValue<Option<ty::EarlyBinder<'static, ty::Const<'static>>>>>,
512 associated_types_for_impl_traits_in_trait_or_impl: Table<DefIndex, LazyValue<DefIdMap<Vec<DefId>>>>,
513 live_args_for_alias_from_outlives_bounds: Table<DefIndex, LazyValue<DenseBitSet<u32>>>,
514 args_known_to_outlive_alias_params: Table<DefIndex, LazyValue<Vec<(usize, DenseBitSet<u32>)>>>,
515 mut_restriction: Table<DefIndex, LazyValue<ty::RestrictionKind>>,
516}
517
518#[derive(const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for VariantData {
fn encode(&self, __encoder: &mut __E) {
let VariantData {
idx: ref __binding_0,
discr: ref __binding_1,
ctor: ref __binding_2,
is_non_exhaustive: ref __binding_3 } = *self;
::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)]
519struct VariantData {
520 idx: VariantIdx,
521 discr: ty::VariantDiscr,
522 ctor: Option<(CtorKind, DefIndex)>,
524 is_non_exhaustive: bool,
525}
526
527pub struct AttrFlags(<AttrFlags as
::bitflags::__private::PublicFlags>::Internal);
#[automatically_derived]
impl ::core::default::Default for AttrFlags {
#[inline]
fn default() -> Self { 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) -> Self {
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: &Self) -> 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: &Self)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::option::Option::Some(::core::cmp::Ord::cmp(self,
other))
}
}
#[automatically_derived]
impl ::core::cmp::Ord for InternalBitFlags {
#[inline]
fn cmp(&self, other: &Self) -> ::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! {
528 #[derive(Default)]
529 pub struct AttrFlags: u8 {
530 const IS_DOC_HIDDEN = 1 << 0;
531 }
532}
533
534#[derive(const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for SpanTag {
fn encode(&self, __encoder: &mut __E) {
let SpanTag(ref __binding_0) = *self;
::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]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for SpanTag { }
#[automatically_derived]
impl ::core::clone::Clone for SpanTag {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<u8>;
*self
}
}Clone)]
551struct SpanTag(u8);
552
553#[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]
#[doc(hidden)]
unsafe impl ::core::clone::TrivialClone for SpanKind { }
#[automatically_derived]
impl ::core::clone::Clone for SpanKind {
#[inline]
fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for SpanKind { }
#[automatically_derived]
impl ::core::cmp::PartialEq for SpanKind {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other)
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for SpanKind { }Eq)]
554enum SpanKind {
555 Local = 0b00,
556 Foreign = 0b01,
557 Partial = 0b10,
558 Indirect = 0b11,
562}
563
564impl SpanTag {
565 fn new(kind: SpanKind, context: rustc_span::SyntaxContext, length: usize) -> SpanTag {
566 let mut data = 0u8;
567 data |= kind as u8;
568 if context.is_root() {
569 data |= 0b100;
570 }
571 let all_1s_len = (0xffu8 << 3) >> 3;
572 if length < all_1s_len as usize {
574 data |= (length as u8) << 3;
575 } else {
576 data |= all_1s_len << 3;
577 }
578
579 SpanTag(data)
580 }
581
582 fn indirect(relative: bool, length_bytes: u8) -> SpanTag {
583 let mut tag = SpanTag(SpanKind::Indirect as u8);
584 if relative {
585 tag.0 |= 0b100;
586 }
587 if !(length_bytes <= 8) {
::core::panicking::panic("assertion failed: length_bytes <= 8")
};assert!(length_bytes <= 8);
588 tag.0 |= length_bytes << 3;
589 tag
590 }
591
592 fn kind(self) -> SpanKind {
593 let masked = self.0 & 0b11;
594 match masked {
595 0b00 => SpanKind::Local,
596 0b01 => SpanKind::Foreign,
597 0b10 => SpanKind::Partial,
598 0b11 => SpanKind::Indirect,
599 _ => ::core::panicking::panic("internal error: entered unreachable code")unreachable!(),
600 }
601 }
602
603 fn is_relative_offset(self) -> bool {
604 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);
605 self.0 & 0b100 != 0
606 }
607
608 fn context(self) -> Option<rustc_span::SyntaxContext> {
609 if self.0 & 0b100 != 0 { Some(rustc_span::SyntaxContext::root()) } else { None }
610 }
611
612 fn length(self) -> Option<rustc_span::BytePos> {
613 let all_1s_len = (0xffu8 << 3) >> 3;
614 let len = self.0 >> 3;
615 if len != all_1s_len { Some(rustc_span::BytePos(u32::from(len))) } else { None }
616 }
617}
618
619const SYMBOL_STR: u8 = 0;
621const SYMBOL_OFFSET: u8 = 1;
622const SYMBOL_PREDEFINED: u8 = 2;
623
624pub fn provide(providers: &mut Providers) {
625 encoder::provide(&mut providers.queries);
626 decoder::provide(providers);
627}