Skip to main content

rustc_metadata/rmeta/decoder/
cstore_impl.rs

1use std::any::Any;
2use std::mem;
3use std::sync::Arc;
4
5use rustc_hir::attrs::Deprecation;
6use rustc_hir::def::{CtorKind, DefKind};
7use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE};
8use rustc_hir::definitions::{DefKey, DefPath, DefPathHash};
9use rustc_middle::arena::ArenaAllocatable;
10use rustc_middle::bug;
11use rustc_middle::metadata::{AmbigModChild, ModChild};
12use rustc_middle::middle::exported_symbols::ExportedSymbol;
13use rustc_middle::middle::stability::DeprecationEntry;
14use rustc_middle::queries::ExternProviders;
15use rustc_middle::query::LocalCrate;
16use rustc_middle::ty::fast_reject::SimplifiedType;
17use rustc_middle::ty::{self, TyCtxt, TypeVisitable};
18use rustc_middle::util::Providers;
19use rustc_serialize::Decoder;
20use rustc_session::StableCrateId;
21use rustc_session::cstore::{CrateStore, ExternCrate};
22use rustc_span::def_id::ModId;
23use rustc_span::hygiene::ExpnId;
24use rustc_span::{Span, Symbol, kw};
25
26use super::{Decodable, DecodeIterator};
27use crate::creader::{CStore, LoadedMacro};
28use crate::rmeta::AttrFlags;
29use crate::rmeta::table::IsDefault;
30use crate::{eii, foreign_modules, native_libs};
31
32trait ProcessQueryValue<'tcx, T> {
33    fn process_decoded(self, _tcx: TyCtxt<'tcx>, _err: impl Fn() -> !) -> T;
34}
35
36impl<T> ProcessQueryValue<'_, T> for T {
37    #[inline(always)]
38    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> T {
39        self
40    }
41}
42
43// The `TypeVisitable` bound here is merely for `EarlyBinder`'s rigidness check.
44impl<'tcx, T: TypeVisitable<TyCtxt<'tcx>>> ProcessQueryValue<'tcx, ty::EarlyBinder<'tcx, T>> for T {
45    #[inline(always)]
46    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> ty::EarlyBinder<'tcx, T> {
47        ty::EarlyBinder::bind_no_rigid_aliases(self)
48    }
49}
50
51impl<T> ProcessQueryValue<'_, T> for Option<T> {
52    #[inline(always)]
53    fn process_decoded(self, _tcx: TyCtxt<'_>, err: impl Fn() -> !) -> T {
54        if let Some(value) = self { value } else { err() }
55    }
56}
57
58impl<'tcx, T: ArenaAllocatable<'tcx>> ProcessQueryValue<'tcx, &'tcx T> for Option<T> {
59    #[inline(always)]
60    fn process_decoded(self, tcx: TyCtxt<'tcx>, err: impl Fn() -> !) -> &'tcx T {
61        if let Some(value) = self { tcx.arena.alloc(value) } else { err() }
62    }
63}
64
65impl<T, E> ProcessQueryValue<'_, Result<Option<T>, E>> for Option<T> {
66    #[inline(always)]
67    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> Result<Option<T>, E> {
68        Ok(self)
69    }
70}
71
72impl<'tcx, D: Decoder, T: Copy + Decodable<D>> ProcessQueryValue<'tcx, &'tcx [T]>
73    for Option<DecodeIterator<T, D>>
74{
75    #[inline(always)]
76    fn process_decoded(self, tcx: TyCtxt<'tcx>, err: impl Fn() -> !) -> &'tcx [T] {
77        if let Some(iter) = self { tcx.arena.alloc_from_iter(iter) } else { err() }
78    }
79}
80
81impl<'tcx, D: Decoder, T: Copy + Decodable<D>> ProcessQueryValue<'tcx, Option<&'tcx [T]>>
82    for Option<DecodeIterator<T, D>>
83{
84    #[inline(always)]
85    fn process_decoded(self, tcx: TyCtxt<'tcx>, _err: impl Fn() -> !) -> Option<&'tcx [T]> {
86        if let Some(iter) = self { Some(&*tcx.arena.alloc_from_iter(iter)) } else { None }
87    }
88}
89
90impl ProcessQueryValue<'_, Option<DeprecationEntry>> for Option<Deprecation> {
91    #[inline(always)]
92    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> Option<DeprecationEntry> {
93        self.map(DeprecationEntry::external)
94    }
95}
96
97macro_rules! provide_one {
98    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table }) => {
99        provide_one! {
100            $tcx, $def_id, $other, $cdata, $name => {
101                $cdata
102                    .root
103                    .tables
104                    .$name
105                    .get($cdata, $def_id.index)
106                    .map(|lazy| lazy.decode(($cdata, $tcx)))
107                    .process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
108            }
109        }
110    };
111    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table_defaulted_array }) => {
112        provide_one! {
113            $tcx, $def_id, $other, $cdata, $name => {
114                let lazy = $cdata.root.tables.$name.get($cdata, $def_id.index);
115                let value = if lazy.is_default() {
116                    &[] as &[_]
117                } else {
118                    $tcx.arena.alloc_from_iter(lazy.decode(($cdata, $tcx)))
119                };
120                value.process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
121            }
122        }
123    };
124    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table_direct }) => {
125        provide_one! {
126            $tcx, $def_id, $other, $cdata, $name => {
127                // We don't decode `table_direct`, since it's not a Lazy, but an actual value
128                $cdata
129                    .root
130                    .tables
131                    .$name
132                    .get($cdata, $def_id.index)
133                    .process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
134            }
135        }
136    };
137    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => $compute:block) => {
138        fn $name<'tcx>(
139            $tcx: TyCtxt<'tcx>,
140            def_id_arg: rustc_middle::queries::$name::Key<'tcx>,
141        ) -> rustc_middle::queries::$name::ProvidedValue<'tcx> {
142            let _prof_timer =
143                $tcx.prof.generic_activity(concat!("metadata_decode_entry_", stringify!($name)));
144
145            #[allow(unused_variables)]
146            let ($def_id, $other) = def_id_arg.into_args();
147            assert!(!$def_id.is_local());
148
149            // External query providers call `crate_hash` in order to register a dependency
150            // on the crate metadata. The exception is `crate_hash` itself, which obviously
151            // doesn't need to do this (and can't, as it would cause a query cycle).
152            use rustc_middle::dep_graph::DepKind;
153            if DepKind::$name != DepKind::crate_hash && $tcx.dep_graph.is_fully_enabled() {
154                $tcx.ensure_ok().crate_hash($def_id.krate);
155            }
156
157            let cstore = CStore::from_tcx($tcx);
158            let $cdata = cstore.get_crate_data($def_id.krate);
159
160            $compute
161        }
162    };
163}
164
165macro_rules! provide {
166    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident,
167      $($name:ident => { $($compute:tt)* })*) => {
168        fn provide_extern(providers: &mut ExternProviders) {
169            $(provide_one! {
170                $tcx, $def_id, $other, $cdata, $name => { $($compute)* }
171            })*
172
173            *providers = ExternProviders {
174                $($name,)*
175                ..*providers
176            };
177        }
178    }
179}
180
181// small trait to work around different signature queries all being defined via
182// the macro above.
183trait IntoArgs {
184    type Other;
185    fn into_args(self) -> (DefId, Self::Other);
186}
187
188impl IntoArgs for DefId {
189    type Other = ();
190    fn into_args(self) -> (DefId, ()) {
191        (self, ())
192    }
193}
194
195impl IntoArgs for ModId {
196    type Other = ();
197    fn into_args(self) -> (DefId, ()) {
198        (self.to_def_id(), ())
199    }
200}
201
202impl IntoArgs for CrateNum {
203    type Other = ();
204    fn into_args(self) -> (DefId, ()) {
205        (self.as_def_id(), ())
206    }
207}
208
209impl IntoArgs for (CrateNum, DefId) {
210    type Other = DefId;
211    fn into_args(self) -> (DefId, DefId) {
212        (self.0.as_def_id(), self.1)
213    }
214}
215
216impl<'tcx> IntoArgs for ty::InstanceKind<'tcx> {
217    type Other = ();
218    fn into_args(self) -> (DefId, ()) {
219        (self.def_id(), ())
220    }
221}
222
223impl IntoArgs for (CrateNum, SimplifiedType) {
224    type Other = SimplifiedType;
225    fn into_args(self) -> (DefId, SimplifiedType) {
226        (self.0.as_def_id(), self.1)
227    }
228}
229
230fn provide_extern(providers: &mut ExternProviders) {
    fn explicit_item_bounds<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::explicit_item_bounds::Key<'tcx>)
        -> rustc_middle::queries::explicit_item_bounds::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_item_bounds");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_item_bounds != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.explicit_item_bounds.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_item_bounds"));
                    })
        }
    }
    fn explicit_item_self_bounds<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::explicit_item_self_bounds::Key<'tcx>)
        ->
            rustc_middle::queries::explicit_item_self_bounds::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_item_self_bounds");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_item_self_bounds != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.explicit_item_self_bounds.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_item_self_bounds"));
                    })
        }
    }
    fn explicit_predicates_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::explicit_predicates_of::Key<'tcx>)
        ->
            rustc_middle::queries::explicit_predicates_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_predicates_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_predicates_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.explicit_predicates_of.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_predicates_of"));
                    })
        }
    }
    fn generics_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::generics_of::Key<'tcx>)
        -> rustc_middle::queries::generics_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_generics_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::generics_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.generics_of.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "generics_of"));
                    })
        }
    }
    fn inferred_outlives_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::inferred_outlives_of::Key<'tcx>)
        -> rustc_middle::queries::inferred_outlives_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_inferred_outlives_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::inferred_outlives_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.inferred_outlives_of.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "inferred_outlives_of"));
                    })
        }
    }
    fn explicit_super_predicates_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::explicit_super_predicates_of::Key<'tcx>)
        ->
            rustc_middle::queries::explicit_super_predicates_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_super_predicates_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_super_predicates_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.explicit_super_predicates_of.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_super_predicates_of"));
                    })
        }
    }
    fn explicit_implied_predicates_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::explicit_implied_predicates_of::Key<'tcx>)
        ->
            rustc_middle::queries::explicit_implied_predicates_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_implied_predicates_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_implied_predicates_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.explicit_implied_predicates_of.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_implied_predicates_of"));
                    })
        }
    }
    fn type_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::type_of::Key<'tcx>)
        -> rustc_middle::queries::type_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_type_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::type_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.type_of.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "type_of"));
                    })
        }
    }
    fn type_alias_is_checked<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::type_alias_is_checked::Key<'tcx>)
        -> rustc_middle::queries::type_alias_is_checked::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_type_alias_is_checked");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::type_alias_is_checked != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.type_alias_is_checked.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "type_alias_is_checked"));
                    })
        }
    }
    fn variances_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::variances_of::Key<'tcx>)
        -> rustc_middle::queries::variances_of::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_variances_of");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::variances_of != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.variances_of.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "variances_of"));
                    })
        }
    }
    fn fn_sig<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::fn_sig::Key<'tcx>)
        -> rustc_middle::queries::fn_sig::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_fn_sig");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::fn_sig != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.fn_sig.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "fn_sig"));
                    })
        }
    }
    fn codegen_fn_attrs<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::codegen_fn_attrs::Key<'tcx>)
        -> rustc_middle::queries::codegen_fn_attrs::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_codegen_fn_attrs");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::codegen_fn_attrs != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.codegen_fn_attrs.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "codegen_fn_attrs"));
                    })
        }
    }
    fn impl_trait_header<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::impl_trait_header::Key<'tcx>)
        -> rustc_middle::queries::impl_trait_header::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_impl_trait_header");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::impl_trait_header != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.impl_trait_header.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "impl_trait_header"));
                    })
        }
    }
    fn const_param_default<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::const_param_default::Key<'tcx>)
        -> rustc_middle::queries::const_param_default::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_const_param_default");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::const_param_default != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.const_param_default.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "const_param_default"));
                    })
        }
    }
    fn object_lifetime_default<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::object_lifetime_default::Key<'tcx>)
        ->
            rustc_middle::queries::object_lifetime_default::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_object_lifetime_default");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::object_lifetime_default != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.object_lifetime_default.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "object_lifetime_default"));
                    })
        }
    }
    fn thir_abstract_const<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::thir_abstract_const::Key<'tcx>)
        -> rustc_middle::queries::thir_abstract_const::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_thir_abstract_const");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::thir_abstract_const != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.thir_abstract_const.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "thir_abstract_const"));
                    })
        }
    }
    fn optimized_mir<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::optimized_mir::Key<'tcx>)
        -> rustc_middle::queries::optimized_mir::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_optimized_mir");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::optimized_mir != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.optimized_mir.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "optimized_mir"));
                    })
        }
    }
    fn mir_for_ctfe<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::mir_for_ctfe::Key<'tcx>)
        -> rustc_middle::queries::mir_for_ctfe::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_mir_for_ctfe");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::mir_for_ctfe != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.mir_for_ctfe.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "mir_for_ctfe"));
                    })
        }
    }
    fn trivial_const<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::trivial_const::Key<'tcx>)
        -> rustc_middle::queries::trivial_const::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_trivial_const");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::trivial_const != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.trivial_const.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "trivial_const"));
                    })
        }
    }
    fn closure_saved_names_of_captured_variables<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::closure_saved_names_of_captured_variables::Key<'tcx>)
        ->
            rustc_middle::queries::closure_saved_names_of_captured_variables::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_closure_saved_names_of_captured_variables");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::closure_saved_names_of_captured_variables !=
                    DepKind::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.closure_saved_names_of_captured_variables.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "closure_saved_names_of_captured_variables"));
                    })
        }
    }
    fn mir_coroutine_witnesses<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::mir_coroutine_witnesses::Key<'tcx>)
        ->
            rustc_middle::queries::mir_coroutine_witnesses::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_mir_coroutine_witnesses");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::mir_coroutine_witnesses != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.mir_coroutine_witnesses.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "mir_coroutine_witnesses"));
                    })
        }
    }
    fn promoted_mir<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::promoted_mir::Key<'tcx>)
        -> rustc_middle::queries::promoted_mir::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_promoted_mir");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::promoted_mir != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.promoted_mir.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "promoted_mir"));
                    })
        }
    }
    fn def_span<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::def_span::Key<'tcx>)
        -> rustc_middle::queries::def_span::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_def_span");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::def_span != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.def_span.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "def_span"));
                    })
        }
    }
    fn def_ident_span<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::def_ident_span::Key<'tcx>)
        -> rustc_middle::queries::def_ident_span::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_def_ident_span");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::def_ident_span != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.def_ident_span.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "def_ident_span"));
                    })
        }
    }
    fn lookup_stability<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::lookup_stability::Key<'tcx>)
        -> rustc_middle::queries::lookup_stability::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_lookup_stability");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::lookup_stability != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.lookup_stability.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "lookup_stability"));
                    })
        }
    }
    fn lookup_const_stability<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::lookup_const_stability::Key<'tcx>)
        ->
            rustc_middle::queries::lookup_const_stability::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_lookup_const_stability");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::lookup_const_stability != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.lookup_const_stability.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "lookup_const_stability"));
                    })
        }
    }
    fn lookup_default_body_stability<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::lookup_default_body_stability::Key<'tcx>)
        ->
            rustc_middle::queries::lookup_default_body_stability::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_lookup_default_body_stability");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::lookup_default_body_stability != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.lookup_default_body_stability.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "lookup_default_body_stability"));
                    })
        }
    }
    fn lookup_deprecation_entry<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::lookup_deprecation_entry::Key<'tcx>)
        ->
            rustc_middle::queries::lookup_deprecation_entry::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_lookup_deprecation_entry");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::lookup_deprecation_entry != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.lookup_deprecation_entry.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "lookup_deprecation_entry"));
                    })
        }
    }
    fn params_in_repr<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::params_in_repr::Key<'tcx>)
        -> rustc_middle::queries::params_in_repr::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_params_in_repr");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::params_in_repr != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.params_in_repr.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "params_in_repr"));
                    })
        }
    }
    fn def_kind<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::def_kind::Key<'tcx>)
        -> rustc_middle::queries::def_kind::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_def_kind");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::def_kind != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.def_kind(def_id.index) }
    }
    fn impl_parent<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::impl_parent::Key<'tcx>)
        -> rustc_middle::queries::impl_parent::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_impl_parent");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::impl_parent != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.impl_parent.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "impl_parent"));
                    })
        }
    }
    fn defaultness<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::defaultness::Key<'tcx>)
        -> rustc_middle::queries::defaultness::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_defaultness");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::defaultness != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.defaultness.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "defaultness"));
                    })
        }
    }
    fn constness<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::constness::Key<'tcx>)
        -> rustc_middle::queries::constness::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_constness");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::constness != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.constness.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "constness"));
                    })
        }
    }
    fn const_conditions<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::const_conditions::Key<'tcx>)
        -> rustc_middle::queries::const_conditions::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_const_conditions");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::const_conditions != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.const_conditions.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "const_conditions"));
                    })
        }
    }
    fn explicit_implied_const_bounds<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::explicit_implied_const_bounds::Key<'tcx>)
        ->
            rustc_middle::queries::explicit_implied_const_bounds::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_explicit_implied_const_bounds");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::explicit_implied_const_bounds != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let lazy =
                cdata.root.tables.explicit_implied_const_bounds.get(cdata,
                    def_id.index);
            let value =
                if lazy.is_default() {
                    &[] as &[_]
                } else {
                    tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                };
            value.process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "explicit_implied_const_bounds"));
                    })
        }
    }
    fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::coerce_unsized_info::Key<'tcx>)
        -> rustc_middle::queries::coerce_unsized_info::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_coerce_unsized_info");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::coerce_unsized_info != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            Ok(cdata.root.tables.coerce_unsized_info.get(cdata,
                            def_id.index).map(|lazy|
                            lazy.decode((cdata,
                                    tcx))).process_decoded(tcx,
                    ||
                        {
                            ::core::panicking::panic_fmt(format_args!("{0:?} does not have coerce_unsized_info",
                                    def_id));
                        }))
        }
    }
    fn mir_const_qualif<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::mir_const_qualif::Key<'tcx>)
        -> rustc_middle::queries::mir_const_qualif::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_mir_const_qualif");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::mir_const_qualif != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.mir_const_qualif.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "mir_const_qualif"));
                    })
        }
    }
    fn rendered_const<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::rendered_const::Key<'tcx>)
        -> rustc_middle::queries::rendered_const::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_rendered_const");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::rendered_const != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.rendered_const.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "rendered_const"));
                    })
        }
    }
    fn rendered_precise_capturing_args<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::rendered_precise_capturing_args::Key<'tcx>)
        ->
            rustc_middle::queries::rendered_precise_capturing_args::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_rendered_precise_capturing_args");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::rendered_precise_capturing_args != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.rendered_precise_capturing_args.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "rendered_precise_capturing_args"));
                    })
        }
    }
    fn asyncness<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::asyncness::Key<'tcx>)
        -> rustc_middle::queries::asyncness::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_asyncness");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::asyncness != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.asyncness.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "asyncness"));
                    })
        }
    }
    fn fn_arg_idents<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::fn_arg_idents::Key<'tcx>)
        -> rustc_middle::queries::fn_arg_idents::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_fn_arg_idents");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::fn_arg_idents != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.fn_arg_idents.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "fn_arg_idents"));
                    })
        }
    }
    fn coroutine_kind<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::coroutine_kind::Key<'tcx>)
        -> rustc_middle::queries::coroutine_kind::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_coroutine_kind");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::coroutine_kind != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.coroutine_kind.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "coroutine_kind"));
                    })
        }
    }
    fn coroutine_for_closure<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::coroutine_for_closure::Key<'tcx>)
        -> rustc_middle::queries::coroutine_for_closure::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_coroutine_for_closure");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::coroutine_for_closure != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.coroutine_for_closure.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "coroutine_for_closure"));
                    })
        }
    }
    fn coroutine_by_move_body_def_id<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::coroutine_by_move_body_def_id::Key<'tcx>)
        ->
            rustc_middle::queries::coroutine_by_move_body_def_id::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_coroutine_by_move_body_def_id");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::coroutine_by_move_body_def_id != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.coroutine_by_move_body_def_id.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "coroutine_by_move_body_def_id"));
                    })
        }
    }
    fn eval_static_initializer<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::eval_static_initializer::Key<'tcx>)
        ->
            rustc_middle::queries::eval_static_initializer::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_eval_static_initializer");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::eval_static_initializer != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            Ok(cdata.root.tables.eval_static_initializer.get(cdata,
                            def_id.index).map(|lazy|
                            lazy.decode((cdata,
                                    tcx))).unwrap_or_else(||
                        {
                            ::core::panicking::panic_fmt(format_args!("{0:?} does not have eval_static_initializer",
                                    def_id));
                        }))
        }
    }
    fn trait_def<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::trait_def::Key<'tcx>)
        -> rustc_middle::queries::trait_def::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_trait_def");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::trait_def != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.trait_def.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "trait_def"));
                    })
        }
    }
    fn deduced_param_attrs<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::deduced_param_attrs::Key<'tcx>)
        -> rustc_middle::queries::deduced_param_attrs::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_deduced_param_attrs");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::deduced_param_attrs != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.deduced_param_attrs.get(cdata,
                        def_id.index).map(|lazy|
                        {
                            &*tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
                        }).unwrap_or_default()
        }
    }
    fn opaque_ty_origin<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::opaque_ty_origin::Key<'tcx>)
        -> rustc_middle::queries::opaque_ty_origin::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_opaque_ty_origin");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::opaque_ty_origin != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.opaque_ty_origin.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "opaque_ty_origin"));
                    })
        }
    }
    fn assumed_wf_types_for_rpitit<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::assumed_wf_types_for_rpitit::Key<'tcx>)
        ->
            rustc_middle::queries::assumed_wf_types_for_rpitit::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_assumed_wf_types_for_rpitit");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::assumed_wf_types_for_rpitit != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.assumed_wf_types_for_rpitit.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "assumed_wf_types_for_rpitit"));
                    })
        }
    }
    fn collect_return_position_impl_trait_in_trait_tys<'tcx>(tcx:
            TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::collect_return_position_impl_trait_in_trait_tys::Key<'tcx>)
        ->
            rustc_middle::queries::collect_return_position_impl_trait_in_trait_tys::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_collect_return_position_impl_trait_in_trait_tys");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::collect_return_position_impl_trait_in_trait_tys !=
                    DepKind::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            Ok(cdata.root.tables.collect_return_position_impl_trait_in_trait_tys.get(cdata,
                            def_id.index).map(|lazy|
                            lazy.decode((cdata,
                                    tcx))).process_decoded(tcx,
                    ||
                        {
                            ::core::panicking::panic_fmt(format_args!("{0:?} does not have collect_return_position_impl_trait_in_trait_tys",
                                    def_id));
                        }))
        }
    }
    fn associated_types_for_impl_traits_in_trait_or_impl<'tcx>(tcx:
            TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::associated_types_for_impl_traits_in_trait_or_impl::Key<'tcx>)
        ->
            rustc_middle::queries::associated_types_for_impl_traits_in_trait_or_impl::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_associated_types_for_impl_traits_in_trait_or_impl");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::associated_types_for_impl_traits_in_trait_or_impl !=
                    DepKind::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.associated_types_for_impl_traits_in_trait_or_impl.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id,
                                "associated_types_for_impl_traits_in_trait_or_impl"));
                    })
        }
    }
    fn visibility<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::visibility::Key<'tcx>)
        -> rustc_middle::queries::visibility::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_visibility");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::visibility != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_visibility(tcx, def_id.index) }
    }
    fn adt_def<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::adt_def::Key<'tcx>)
        -> rustc_middle::queries::adt_def::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_adt_def");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::adt_def != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_adt_def(tcx, def_id.index) }
    }
    fn adt_destructor<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::adt_destructor::Key<'tcx>)
        -> rustc_middle::queries::adt_destructor::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_adt_destructor");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::adt_destructor != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.adt_destructor.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "adt_destructor"));
                    })
        }
    }
    fn adt_async_destructor<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::adt_async_destructor::Key<'tcx>)
        -> rustc_middle::queries::adt_async_destructor::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_adt_async_destructor");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::adt_async_destructor != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.adt_async_destructor.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "adt_async_destructor"));
                    })
        }
    }
    fn associated_item_def_ids<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::associated_item_def_ids::Key<'tcx>)
        ->
            rustc_middle::queries::associated_item_def_ids::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_associated_item_def_ids");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::associated_item_def_ids != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            tcx.arena.alloc_from_iter(cdata.get_associated_item_or_field_def_ids(tcx,
                    def_id.index))
        }
    }
    fn associated_item<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::associated_item::Key<'tcx>)
        -> rustc_middle::queries::associated_item::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_associated_item");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::associated_item != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_associated_item(tcx, def_id.index) }
    }
    fn inherent_impls<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::inherent_impls::Key<'tcx>)
        -> rustc_middle::queries::inherent_impls::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_inherent_impls");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::inherent_impls != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_inherent_implementations_for_type(tcx, def_id.index) }
    }
    fn attrs_for_def<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::attrs_for_def::Key<'tcx>)
        -> rustc_middle::queries::attrs_for_def::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_attrs_for_def");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::attrs_for_def != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { tcx.arena.alloc_from_iter(cdata.get_item_attrs(tcx, def_id.index)) }
    }
    fn is_mir_available<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_mir_available::Key<'tcx>)
        -> rustc_middle::queries::is_mir_available::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_mir_available");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_mir_available != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.is_item_mir_available(def_id.index) }
    }
    fn cross_crate_inlinable<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::cross_crate_inlinable::Key<'tcx>)
        -> rustc_middle::queries::cross_crate_inlinable::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_cross_crate_inlinable");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::cross_crate_inlinable != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.cross_crate_inlinable.get(cdata,
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "cross_crate_inlinable"));
                    })
        }
    }
    fn dylib_dependency_formats<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::dylib_dependency_formats::Key<'tcx>)
        ->
            rustc_middle::queries::dylib_dependency_formats::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_dylib_dependency_formats");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::dylib_dependency_formats != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_dylib_dependency_formats(tcx) }
    }
    fn is_private_dep<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_private_dep::Key<'tcx>)
        -> rustc_middle::queries::is_private_dep::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_private_dep");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_private_dep != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.private_dep }
    }
    fn is_panic_runtime<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_panic_runtime::Key<'tcx>)
        -> rustc_middle::queries::is_panic_runtime::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_panic_runtime");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_panic_runtime != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.panic_runtime }
    }
    fn is_compiler_builtins<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_compiler_builtins::Key<'tcx>)
        -> rustc_middle::queries::is_compiler_builtins::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_compiler_builtins");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_compiler_builtins != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.compiler_builtins }
    }
    fn has_global_allocator<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::has_global_allocator::Key<'tcx>)
        -> rustc_middle::queries::has_global_allocator::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_has_global_allocator");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::has_global_allocator != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.has_global_allocator }
    }
    fn has_alloc_error_handler<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::has_alloc_error_handler::Key<'tcx>)
        ->
            rustc_middle::queries::has_alloc_error_handler::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_has_alloc_error_handler");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::has_alloc_error_handler != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.has_alloc_error_handler }
    }
    fn has_panic_handler<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::has_panic_handler::Key<'tcx>)
        -> rustc_middle::queries::has_panic_handler::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_has_panic_handler");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::has_panic_handler != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.has_panic_handler }
    }
    fn externally_implementable_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::externally_implementable_items::Key<'tcx>)
        ->
            rustc_middle::queries::externally_implementable_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_externally_implementable_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::externally_implementable_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.get_externally_implementable_items(tcx).map(|(decl_did,
                            (decl, impls))|
                        (decl_did, (decl, impls.into_iter().collect()))).collect()
        }
    }
    fn is_profiler_runtime<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_profiler_runtime::Key<'tcx>)
        -> rustc_middle::queries::is_profiler_runtime::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_profiler_runtime");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_profiler_runtime != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.profiler_runtime }
    }
    fn required_panic_strategy<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::required_panic_strategy::Key<'tcx>)
        ->
            rustc_middle::queries::required_panic_strategy::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_required_panic_strategy");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::required_panic_strategy != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.required_panic_strategy }
    }
    fn panic_in_drop_strategy<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::panic_in_drop_strategy::Key<'tcx>)
        ->
            rustc_middle::queries::panic_in_drop_strategy::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_panic_in_drop_strategy");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::panic_in_drop_strategy != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.panic_in_drop_strategy }
    }
    fn extern_crate<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::extern_crate::Key<'tcx>)
        -> rustc_middle::queries::extern_crate::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_extern_crate");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::extern_crate != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.extern_crate.map(|c| &*tcx.arena.alloc(c)) }
    }
    fn is_no_builtins<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_no_builtins::Key<'tcx>)
        -> rustc_middle::queries::is_no_builtins::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_no_builtins");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_no_builtins != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.no_builtins }
    }
    fn symbol_mangling_version<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::symbol_mangling_version::Key<'tcx>)
        ->
            rustc_middle::queries::symbol_mangling_version::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_symbol_mangling_version");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::symbol_mangling_version != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.symbol_mangling_version }
    }
    fn specialization_enabled_in<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::specialization_enabled_in::Key<'tcx>)
        ->
            rustc_middle::queries::specialization_enabled_in::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_specialization_enabled_in");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::specialization_enabled_in != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.specialization_enabled_in }
    }
    fn reachable_non_generics<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::reachable_non_generics::Key<'tcx>)
        ->
            rustc_middle::queries::reachable_non_generics::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_reachable_non_generics");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::reachable_non_generics != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            let reachable_non_generics =
                tcx.exported_non_generic_symbols(cdata.cnum).iter().filter_map(|&(exported_symbol,
                                export_info)|
                            {
                                if let ExportedSymbol::NonGeneric(def_id) = exported_symbol
                                    {
                                    Some((def_id, export_info))
                                } else { None }
                            }).collect();
            reachable_non_generics
        }
    }
    fn native_libraries<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::native_libraries::Key<'tcx>)
        -> rustc_middle::queries::native_libraries::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_native_libraries");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::native_libraries != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_native_libraries(tcx).collect() }
    }
    fn foreign_modules<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::foreign_modules::Key<'tcx>)
        -> rustc_middle::queries::foreign_modules::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_foreign_modules");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::foreign_modules != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_foreign_modules(tcx).map(|m| (m.def_id, m)).collect() }
    }
    fn crate_hash<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_hash::Key<'tcx>)
        -> rustc_middle::queries::crate_hash::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_hash");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_hash != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.header.hash }
    }
    fn crate_host_hash<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_host_hash::Key<'tcx>)
        -> rustc_middle::queries::crate_host_hash::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_host_hash");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_host_hash != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.host_hash }
    }
    fn crate_name<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_name::Key<'tcx>)
        -> rustc_middle::queries::crate_name::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_name");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_name != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.header.name }
    }
    fn num_extern_def_ids<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::num_extern_def_ids::Key<'tcx>)
        -> rustc_middle::queries::num_extern_def_ids::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_num_extern_def_ids");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::num_extern_def_ids != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.num_def_ids() }
    }
    fn extra_filename<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::extra_filename::Key<'tcx>)
        -> rustc_middle::queries::extra_filename::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_extra_filename");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::extra_filename != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.root.extra_filename.clone() }
    }
    fn traits<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::traits::Key<'tcx>)
        -> rustc_middle::queries::traits::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_traits");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::traits != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { tcx.arena.alloc_from_iter(cdata.get_traits(tcx)) }
    }
    fn trait_impls_in_crate<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::trait_impls_in_crate::Key<'tcx>)
        -> rustc_middle::queries::trait_impls_in_crate::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_trait_impls_in_crate");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::trait_impls_in_crate != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { tcx.arena.alloc_from_iter(cdata.get_trait_impls(tcx)) }
    }
    fn implementations_of_trait<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::implementations_of_trait::Key<'tcx>)
        ->
            rustc_middle::queries::implementations_of_trait::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_implementations_of_trait");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::implementations_of_trait != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_implementations_of_trait(tcx, other) }
    }
    fn crate_incoherent_impls<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_incoherent_impls::Key<'tcx>)
        ->
            rustc_middle::queries::crate_incoherent_impls::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_incoherent_impls");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_incoherent_impls != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_incoherent_impls(tcx, other) }
    }
    fn crate_dep_kind<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_dep_kind::Key<'tcx>)
        -> rustc_middle::queries::crate_dep_kind::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_dep_kind");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_dep_kind != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.dep_kind }
    }
    fn module_children<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::module_children::Key<'tcx>)
        -> rustc_middle::queries::module_children::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_module_children");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::module_children != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            tcx.arena.alloc_from_iter(cdata.get_module_children(tcx,
                    def_id.index))
        }
    }
    fn lib_features<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::lib_features::Key<'tcx>)
        -> rustc_middle::queries::lib_features::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_lib_features");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::lib_features != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_lib_features(tcx) }
    }
    fn stability_implications<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::stability_implications::Key<'tcx>)
        ->
            rustc_middle::queries::stability_implications::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_stability_implications");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::stability_implications != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_stability_implications(tcx).iter().copied().collect() }
    }
    fn stripped_cfg_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::stripped_cfg_items::Key<'tcx>)
        -> rustc_middle::queries::stripped_cfg_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_stripped_cfg_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::stripped_cfg_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_stripped_cfg_items(tcx, cdata.cnum) }
    }
    fn intrinsic_raw<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::intrinsic_raw::Key<'tcx>)
        -> rustc_middle::queries::intrinsic_raw::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_intrinsic_raw");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::intrinsic_raw != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_intrinsic(tcx, def_id.index) }
    }
    fn defined_lang_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::defined_lang_items::Key<'tcx>)
        -> rustc_middle::queries::defined_lang_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_defined_lang_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::defined_lang_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_lang_items(tcx) }
    }
    fn diagnostic_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::diagnostic_items::Key<'tcx>)
        -> rustc_middle::queries::diagnostic_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_diagnostic_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::diagnostic_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_diagnostic_items(tcx) }
    }
    fn missing_lang_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::missing_lang_items::Key<'tcx>)
        -> rustc_middle::queries::missing_lang_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_missing_lang_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::missing_lang_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_missing_lang_items(tcx) }
    }
    fn missing_extern_crate_item<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::missing_extern_crate_item::Key<'tcx>)
        ->
            rustc_middle::queries::missing_extern_crate_item::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_missing_extern_crate_item");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::missing_extern_crate_item != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {

            #[allow(non_exhaustive_omitted_patterns)]
            match cdata.extern_crate {
                Some(extern_crate) if !extern_crate.is_direct() => true,
                _ => false,
            }
        }
    }
    fn used_crate_source<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::used_crate_source::Key<'tcx>)
        -> rustc_middle::queries::used_crate_source::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_used_crate_source");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::used_crate_source != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { Arc::clone(&cdata.source) }
    }
    fn debugger_visualizers<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::debugger_visualizers::Key<'tcx>)
        -> rustc_middle::queries::debugger_visualizers::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_debugger_visualizers");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::debugger_visualizers != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_debugger_visualizers(tcx) }
    }
    fn exportable_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::exportable_items::Key<'tcx>)
        -> rustc_middle::queries::exportable_items::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_exportable_items");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::exportable_items != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { tcx.arena.alloc_from_iter(cdata.get_exportable_items(tcx)) }
    }
    fn stable_order_of_exportable_impls<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::stable_order_of_exportable_impls::Key<'tcx>)
        ->
            rustc_middle::queries::stable_order_of_exportable_impls::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_stable_order_of_exportable_impls");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::stable_order_of_exportable_impls != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            tcx.arena.alloc(cdata.get_stable_order_of_exportable_impls(tcx).collect())
        }
    }
    fn exported_non_generic_symbols<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::exported_non_generic_symbols::Key<'tcx>)
        ->
            rustc_middle::queries::exported_non_generic_symbols::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_exported_non_generic_symbols");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::exported_non_generic_symbols != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.exported_non_generic_symbols(tcx) }
    }
    fn exported_generic_symbols<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::exported_generic_symbols::Key<'tcx>)
        ->
            rustc_middle::queries::exported_generic_symbols::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_exported_generic_symbols");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::exported_generic_symbols != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.exported_generic_symbols(tcx) }
    }
    fn crate_extern_paths<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::crate_extern_paths::Key<'tcx>)
        -> rustc_middle::queries::crate_extern_paths::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_crate_extern_paths");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::crate_extern_paths != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.source().paths().cloned().collect() }
    }
    fn expn_that_defined<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::expn_that_defined::Key<'tcx>)
        -> rustc_middle::queries::expn_that_defined::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_expn_that_defined");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::expn_that_defined != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_expn_that_defined(tcx, def_id.index) }
    }
    fn default_field<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::default_field::Key<'tcx>)
        -> rustc_middle::queries::default_field::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_default_field");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::default_field != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { cdata.get_default_field(tcx, def_id.index) }
    }
    fn is_doc_hidden<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::is_doc_hidden::Key<'tcx>)
        -> rustc_middle::queries::is_doc_hidden::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_doc_hidden");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::is_doc_hidden != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.get_attr_flags(def_id.index).contains(AttrFlags::IS_DOC_HIDDEN)
        }
    }
    fn doc_link_resolutions<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::doc_link_resolutions::Key<'tcx>)
        -> rustc_middle::queries::doc_link_resolutions::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_doc_link_resolutions");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::doc_link_resolutions != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        { tcx.arena.alloc(cdata.get_doc_link_resolutions(tcx, def_id.index)) }
    }
    fn doc_link_traits_in_scope<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::doc_link_traits_in_scope::Key<'tcx>)
        ->
            rustc_middle::queries::doc_link_traits_in_scope::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_doc_link_traits_in_scope");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::doc_link_traits_in_scope != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            tcx.arena.alloc_from_iter(cdata.get_doc_link_traits_in_scope(tcx,
                    def_id.index))
        }
    }
    fn anon_const_kind<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::anon_const_kind::Key<'tcx>)
        -> rustc_middle::queries::anon_const_kind::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_anon_const_kind");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::anon_const_kind != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.anon_const_kind.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "anon_const_kind"));
                    })
        }
    }
    fn const_of_item<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::queries::const_of_item::Key<'tcx>)
        -> rustc_middle::queries::const_of_item::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_const_of_item");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::const_of_item != DepKind::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.const_of_item.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "const_of_item"));
                    })
        }
    }
    fn args_known_to_outlive_alias_params<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::queries::args_known_to_outlive_alias_params::Key<'tcx>)
        ->
            rustc_middle::queries::args_known_to_outlive_alias_params::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_args_known_to_outlive_alias_params");
        #[allow(unused_variables)]
        let (def_id, other) = def_id_arg.into_args();
        if !!def_id.is_local() {
            ::core::panicking::panic("assertion failed: !def_id.is_local()")
        };
        use rustc_middle::dep_graph::DepKind;
        if DepKind::args_known_to_outlive_alias_params != DepKind::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cstore = CStore::from_tcx(tcx);
        let cdata = cstore.get_crate_data(def_id.krate);
        {
            cdata.root.tables.args_known_to_outlive_alias_params.get(cdata,
                        def_id.index).map(|lazy|
                        lazy.decode((cdata,
                                tcx))).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "args_known_to_outlive_alias_params"));
                    })
        }
    }
    *providers =
        ExternProviders {
            explicit_item_bounds,
            explicit_item_self_bounds,
            explicit_predicates_of,
            generics_of,
            inferred_outlives_of,
            explicit_super_predicates_of,
            explicit_implied_predicates_of,
            type_of,
            type_alias_is_checked,
            variances_of,
            fn_sig,
            codegen_fn_attrs,
            impl_trait_header,
            const_param_default,
            object_lifetime_default,
            thir_abstract_const,
            optimized_mir,
            mir_for_ctfe,
            trivial_const,
            closure_saved_names_of_captured_variables,
            mir_coroutine_witnesses,
            promoted_mir,
            def_span,
            def_ident_span,
            lookup_stability,
            lookup_const_stability,
            lookup_default_body_stability,
            lookup_deprecation_entry,
            params_in_repr,
            def_kind,
            impl_parent,
            defaultness,
            constness,
            const_conditions,
            explicit_implied_const_bounds,
            coerce_unsized_info,
            mir_const_qualif,
            rendered_const,
            rendered_precise_capturing_args,
            asyncness,
            fn_arg_idents,
            coroutine_kind,
            coroutine_for_closure,
            coroutine_by_move_body_def_id,
            eval_static_initializer,
            trait_def,
            deduced_param_attrs,
            opaque_ty_origin,
            assumed_wf_types_for_rpitit,
            collect_return_position_impl_trait_in_trait_tys,
            associated_types_for_impl_traits_in_trait_or_impl,
            visibility,
            adt_def,
            adt_destructor,
            adt_async_destructor,
            associated_item_def_ids,
            associated_item,
            inherent_impls,
            attrs_for_def,
            is_mir_available,
            cross_crate_inlinable,
            dylib_dependency_formats,
            is_private_dep,
            is_panic_runtime,
            is_compiler_builtins,
            has_global_allocator,
            has_alloc_error_handler,
            has_panic_handler,
            externally_implementable_items,
            is_profiler_runtime,
            required_panic_strategy,
            panic_in_drop_strategy,
            extern_crate,
            is_no_builtins,
            symbol_mangling_version,
            specialization_enabled_in,
            reachable_non_generics,
            native_libraries,
            foreign_modules,
            crate_hash,
            crate_host_hash,
            crate_name,
            num_extern_def_ids,
            extra_filename,
            traits,
            trait_impls_in_crate,
            implementations_of_trait,
            crate_incoherent_impls,
            crate_dep_kind,
            module_children,
            lib_features,
            stability_implications,
            stripped_cfg_items,
            intrinsic_raw,
            defined_lang_items,
            diagnostic_items,
            missing_lang_items,
            missing_extern_crate_item,
            used_crate_source,
            debugger_visualizers,
            exportable_items,
            stable_order_of_exportable_impls,
            exported_non_generic_symbols,
            exported_generic_symbols,
            crate_extern_paths,
            expn_that_defined,
            default_field,
            is_doc_hidden,
            doc_link_resolutions,
            doc_link_traits_in_scope,
            anon_const_kind,
            const_of_item,
            args_known_to_outlive_alias_params,
            ..*providers
        };
}provide! { tcx, def_id, other, cdata,
231    explicit_item_bounds => { table_defaulted_array }
232    explicit_item_self_bounds => { table_defaulted_array }
233    explicit_predicates_of => { table }
234    generics_of => { table }
235    inferred_outlives_of => { table_defaulted_array }
236    explicit_super_predicates_of => { table_defaulted_array }
237    explicit_implied_predicates_of => { table_defaulted_array }
238    type_of => { table }
239    type_alias_is_checked => { table_direct }
240    variances_of => { table }
241    fn_sig => { table }
242    codegen_fn_attrs => { table }
243    impl_trait_header => { table }
244    const_param_default => { table }
245    object_lifetime_default => { table }
246    thir_abstract_const => { table }
247    optimized_mir => { table }
248    mir_for_ctfe => { table }
249    trivial_const => { table }
250    closure_saved_names_of_captured_variables => { table }
251    mir_coroutine_witnesses => { table }
252    promoted_mir => { table }
253    def_span => { table }
254    def_ident_span => { table }
255    lookup_stability => { table }
256    lookup_const_stability => { table }
257    lookup_default_body_stability => { table }
258    lookup_deprecation_entry => { table }
259    params_in_repr => { table }
260    def_kind => { cdata.def_kind(def_id.index) }
261    impl_parent => { table }
262    defaultness => { table_direct }
263    constness => { table_direct }
264    const_conditions => { table }
265    explicit_implied_const_bounds => { table_defaulted_array }
266    coerce_unsized_info => {
267        Ok(cdata
268            .root
269            .tables
270            .coerce_unsized_info
271            .get(cdata, def_id.index)
272            .map(|lazy| lazy.decode((cdata, tcx)))
273            .process_decoded(tcx, || panic!("{def_id:?} does not have coerce_unsized_info")))
274    }
275    mir_const_qualif => { table }
276    rendered_const => { table }
277    rendered_precise_capturing_args => { table }
278    asyncness => { table_direct }
279    fn_arg_idents => { table }
280    coroutine_kind => { table_direct }
281    coroutine_for_closure => { table }
282    coroutine_by_move_body_def_id => { table }
283    eval_static_initializer => {
284        Ok(cdata
285            .root
286            .tables
287            .eval_static_initializer
288            .get(cdata, def_id.index)
289            .map(|lazy| lazy.decode((cdata, tcx)))
290            .unwrap_or_else(|| panic!("{def_id:?} does not have eval_static_initializer")))
291    }
292    trait_def => { table }
293    deduced_param_attrs => {
294        // FIXME: `deduced_param_attrs` has some sketchy encoding settings,
295        // where we don't encode unless we're optimizing, doing codegen,
296        // and not incremental (see `encoder.rs`). I don't think this is right!
297        cdata
298            .root
299            .tables
300            .deduced_param_attrs
301            .get(cdata, def_id.index)
302            .map(|lazy| {
303                &*tcx.arena.alloc_from_iter(lazy.decode((cdata, tcx)))
304            })
305            .unwrap_or_default()
306    }
307    opaque_ty_origin => { table }
308    assumed_wf_types_for_rpitit => { table }
309    collect_return_position_impl_trait_in_trait_tys => {
310        Ok(cdata
311            .root
312            .tables
313            .collect_return_position_impl_trait_in_trait_tys
314            .get(cdata, def_id.index)
315            .map(|lazy| lazy.decode((cdata, tcx)))
316            .process_decoded(tcx, || panic!("{def_id:?} does not have collect_return_position_impl_trait_in_trait_tys")))
317    }
318
319    associated_types_for_impl_traits_in_trait_or_impl => { table }
320
321    visibility => { cdata.get_visibility(tcx, def_id.index) }
322    adt_def => { cdata.get_adt_def(tcx, def_id.index) }
323    adt_destructor => { table }
324    adt_async_destructor => { table }
325    associated_item_def_ids => {
326        tcx.arena.alloc_from_iter(cdata.get_associated_item_or_field_def_ids(tcx, def_id.index))
327    }
328    associated_item => { cdata.get_associated_item(tcx, def_id.index) }
329    inherent_impls => { cdata.get_inherent_implementations_for_type(tcx, def_id.index) }
330    attrs_for_def => { tcx.arena.alloc_from_iter(cdata.get_item_attrs(tcx, def_id.index)) }
331    is_mir_available => { cdata.is_item_mir_available(def_id.index) }
332    cross_crate_inlinable => { table_direct }
333
334    dylib_dependency_formats => { cdata.get_dylib_dependency_formats(tcx) }
335    is_private_dep => { cdata.private_dep }
336    is_panic_runtime => { cdata.root.panic_runtime }
337    is_compiler_builtins => { cdata.root.compiler_builtins }
338
339    // FIXME: to be replaced with externally_implementable_items below
340    has_global_allocator => { cdata.root.has_global_allocator }
341    // FIXME: to be replaced with externally_implementable_items below
342    has_alloc_error_handler => { cdata.root.has_alloc_error_handler }
343    // FIXME: to be replaced with externally_implementable_items below
344    has_panic_handler => { cdata.root.has_panic_handler }
345
346    externally_implementable_items => {
347        cdata.get_externally_implementable_items(tcx)
348            .map(|(decl_did, (decl, impls))| (
349                decl_did,
350                (decl, impls.into_iter().collect())
351            )).collect()
352    }
353
354    is_profiler_runtime => { cdata.root.profiler_runtime }
355    required_panic_strategy => { cdata.root.required_panic_strategy }
356    panic_in_drop_strategy => { cdata.root.panic_in_drop_strategy }
357    extern_crate => { cdata.extern_crate.map(|c| &*tcx.arena.alloc(c)) }
358    is_no_builtins => { cdata.root.no_builtins }
359    symbol_mangling_version => { cdata.root.symbol_mangling_version }
360    specialization_enabled_in => { cdata.root.specialization_enabled_in }
361    reachable_non_generics => {
362        let reachable_non_generics = tcx
363            .exported_non_generic_symbols(cdata.cnum)
364            .iter()
365            .filter_map(|&(exported_symbol, export_info)| {
366                if let ExportedSymbol::NonGeneric(def_id) = exported_symbol {
367                    Some((def_id, export_info))
368                } else {
369                    None
370                }
371            })
372            .collect();
373
374        reachable_non_generics
375    }
376    native_libraries => { cdata.get_native_libraries(tcx).collect() }
377    foreign_modules => { cdata.get_foreign_modules(tcx).map(|m| (m.def_id, m)).collect() }
378    crate_hash => { cdata.root.header.hash }
379    crate_host_hash => { cdata.host_hash }
380    crate_name => { cdata.root.header.name }
381    num_extern_def_ids => { cdata.num_def_ids() }
382
383    extra_filename => { cdata.root.extra_filename.clone() }
384
385    traits => { tcx.arena.alloc_from_iter(cdata.get_traits(tcx)) }
386    trait_impls_in_crate => { tcx.arena.alloc_from_iter(cdata.get_trait_impls(tcx)) }
387    implementations_of_trait => { cdata.get_implementations_of_trait(tcx, other) }
388    crate_incoherent_impls => { cdata.get_incoherent_impls(tcx, other) }
389
390    crate_dep_kind => { cdata.dep_kind }
391    module_children => {
392        tcx.arena.alloc_from_iter(cdata.get_module_children(tcx, def_id.index))
393    }
394    lib_features => { cdata.get_lib_features(tcx) }
395    stability_implications => {
396        cdata.get_stability_implications(tcx).iter().copied().collect()
397    }
398    stripped_cfg_items => { cdata.get_stripped_cfg_items(tcx, cdata.cnum) }
399    intrinsic_raw => { cdata.get_intrinsic(tcx, def_id.index) }
400    defined_lang_items => { cdata.get_lang_items(tcx) }
401    diagnostic_items => { cdata.get_diagnostic_items(tcx) }
402    missing_lang_items => { cdata.get_missing_lang_items(tcx) }
403
404    missing_extern_crate_item => {
405        matches!(cdata.extern_crate, Some(extern_crate) if !extern_crate.is_direct())
406    }
407
408    used_crate_source => { Arc::clone(&cdata.source) }
409    debugger_visualizers => { cdata.get_debugger_visualizers(tcx) }
410
411    exportable_items => { tcx.arena.alloc_from_iter(cdata.get_exportable_items(tcx)) }
412    stable_order_of_exportable_impls => {
413        tcx.arena.alloc(cdata.get_stable_order_of_exportable_impls(tcx).collect())
414    }
415    exported_non_generic_symbols => { cdata.exported_non_generic_symbols(tcx) }
416    exported_generic_symbols => { cdata.exported_generic_symbols(tcx) }
417
418    crate_extern_paths => { cdata.source().paths().cloned().collect() }
419    expn_that_defined => { cdata.get_expn_that_defined(tcx, def_id.index) }
420    default_field => { cdata.get_default_field(tcx, def_id.index) }
421    is_doc_hidden => { cdata.get_attr_flags(def_id.index).contains(AttrFlags::IS_DOC_HIDDEN) }
422    doc_link_resolutions => { tcx.arena.alloc(cdata.get_doc_link_resolutions(tcx, def_id.index)) }
423    doc_link_traits_in_scope => {
424        tcx.arena.alloc_from_iter(cdata.get_doc_link_traits_in_scope(tcx, def_id.index))
425    }
426    anon_const_kind => { table }
427    const_of_item => { table }
428    args_known_to_outlive_alias_params => { table }
429}
430
431pub(in crate::rmeta) fn provide(providers: &mut Providers) {
432    provide_cstore_hooks(providers);
433    providers.queries = rustc_middle::query::Providers {
434        allocator_kind: |tcx, ()| CStore::from_tcx(tcx).allocator_kind(),
435        alloc_error_handler_kind: |tcx, ()| CStore::from_tcx(tcx).alloc_error_handler_kind(),
436        is_private_dep: |_tcx, LocalCrate| false,
437        native_library: |tcx, id| {
438            tcx.native_libraries(id.krate)
439                .iter()
440                .filter(|lib| native_libs::relevant_lib(tcx.sess, lib))
441                .find(|lib| {
442                    let Some(fm_id) = lib.foreign_module else {
443                        return false;
444                    };
445                    let map = tcx.foreign_modules(id.krate);
446                    map.get(&fm_id)
447                        .expect("failed to find foreign module")
448                        .foreign_items
449                        .contains(&id)
450                })
451        },
452        native_libraries: native_libs::collect,
453        foreign_modules: foreign_modules::collect,
454        externally_implementable_items: eii::collect,
455
456        // Returns a map from a sufficiently visible external item (i.e., an
457        // external item that is visible from at least one local module) to a
458        // sufficiently visible parent (considering modules that re-export the
459        // external item to be parents).
460        visible_parent_map: |tcx, ()| {
461            use std::collections::hash_map::Entry;
462            use std::collections::vec_deque::VecDeque;
463
464            let mut visible_parent_map: DefIdMap<DefId> = Default::default();
465            // This is a secondary visible_parent_map, storing the DefId of
466            // parents that re-export the child as `_`, module parents
467            // which are `#[doc(hidden)]`, or `use` items that are themselves
468            // `#[doc(hidden)]`. Since we prefer paths that don't do this,
469            // merge this map at the end, only if we're missing keys from
470            // the former.
471            // This is a rudimentary check that does not catch all cases,
472            // just the easiest.
473            let mut fallback_map: Vec<(DefId, DefId)> = Default::default();
474
475            // Issue 46112: We want the map to prefer the shortest
476            // paths when reporting the path to an item. Therefore we
477            // build up the map via a breadth-first search (BFS),
478            // which naturally yields minimal-length paths.
479            //
480            // Note that it needs to be a BFS over the whole forest of
481            // crates, not just each individual crate; otherwise you
482            // only get paths that are locally minimal with respect to
483            // whatever crate we happened to encounter first in this
484            // traversal, but not globally minimal across all crates.
485            let bfs_queue = &mut VecDeque::new();
486
487            for &cnum in tcx.crates(()) {
488                // Ignore crates without a corresponding local `extern crate` item.
489                if tcx.missing_extern_crate_item(cnum) {
490                    continue;
491                }
492
493                bfs_queue.push_back(cnum.as_def_id());
494            }
495
496            let mut add_child = |bfs_queue: &mut VecDeque<_>, child: &ModChild, parent: DefId| {
497                if !child.vis.is_public() {
498                    return;
499                }
500
501                if let Some(def_id) = child.res.opt_def_id() {
502                    if child.ident.name == kw::Underscore {
503                        fallback_map.push((def_id, parent));
504                        return;
505                    }
506
507                    if tcx.is_doc_hidden(parent) {
508                        fallback_map.push((def_id, parent));
509                        return;
510                    }
511
512                    // If the re-export itself is `#[doc(hidden)]`, deprioritize it.
513                    // See PR #99698 for the case where the *parent* is doc-hidden.
514                    if child
515                        .reexport_chain
516                        .first()
517                        .and_then(|r| r.id())
518                        .is_some_and(|id| tcx.is_doc_hidden(id))
519                    {
520                        fallback_map.push((def_id, parent));
521                        return;
522                    }
523
524                    match visible_parent_map.entry(def_id) {
525                        Entry::Occupied(mut entry) => {
526                            // If `child` is defined in crate `cnum`, ensure
527                            // that it is mapped to a parent in `cnum`.
528                            if def_id.is_local() && entry.get().is_local() {
529                                entry.insert(parent);
530                            }
531                        }
532                        Entry::Vacant(entry) => {
533                            entry.insert(parent);
534                            if child.res.module_like_def_id().is_some() {
535                                bfs_queue.push_back(def_id);
536                            }
537                        }
538                    }
539                }
540            };
541
542            while let Some(def) = bfs_queue.pop_front() {
543                for child in tcx.module_children(def).iter() {
544                    add_child(bfs_queue, child, def);
545                }
546            }
547
548            // Fill in any missing entries with the less preferable path.
549            // If this path re-exports the child as `_`, we still use this
550            // path in a diagnostic that suggests importing `::*`.
551
552            for (child, parent) in fallback_map {
553                visible_parent_map.entry(child).or_insert(parent);
554            }
555
556            visible_parent_map
557        },
558
559        dependency_formats: |tcx, ()| Arc::new(crate::dependency_format::calculate(tcx)),
560        has_global_allocator: |tcx, LocalCrate| CStore::from_tcx(tcx).has_global_allocator(),
561        has_alloc_error_handler: |tcx, LocalCrate| CStore::from_tcx(tcx).has_alloc_error_handler(),
562        postorder_cnums: |tcx, ()| {
563            tcx.arena.alloc_from_iter(
564                CStore::from_tcx(tcx).crate_dependencies_in_postorder(LOCAL_CRATE).into_iter(),
565            )
566        },
567        crates: |tcx, ()| {
568            // The loaded-crate list is now frozen in the query cache; stop
569            // mutating the cstore and stable crate id map from here on.
570            tcx.untracked().freeze_cstore();
571            tcx.arena.alloc_from_iter(CStore::from_tcx(tcx).iter_crate_data().map(|(cnum, _)| cnum))
572        },
573        used_crates: |tcx, ()| {
574            // The loaded-crate list is now frozen in the query cache; stop
575            // mutating the cstore and stable crate id map from here on.
576            tcx.untracked().freeze_cstore();
577            tcx.arena.alloc_from_iter(
578                CStore::from_tcx(tcx)
579                    .iter_crate_data()
580                    .filter_map(|(cnum, data)| data.used().then_some(cnum)),
581            )
582        },
583        duplicate_crate_names: |tcx, c: CrateNum| {
584            let name = tcx.crate_name(c);
585            tcx.arena.alloc_from_iter(
586                tcx.crates(())
587                    .into_iter()
588                    .filter(|k| tcx.crate_name(**k) == name && **k != c)
589                    .map(|c| *c),
590            )
591        },
592        ..providers.queries
593    };
594    provide_extern(&mut providers.extern_queries);
595}
596
597impl CStore {
598    pub fn ctor_untracked(&self, tcx: TyCtxt<'_>, def: DefId) -> Option<(CtorKind, DefId)> {
599        self.get_crate_data(def.krate).get_ctor(tcx, def.index)
600    }
601
602    pub fn load_macro_untracked(&self, tcx: TyCtxt<'_>, id: DefId) -> LoadedMacro {
603        let sess = tcx.sess;
604        let _prof_timer = sess.prof.generic_activity("metadata_load_macro");
605
606        let cdata = self.get_crate_data(id.krate);
607        if cdata.root.is_proc_macro_crate() {
608            LoadedMacro::ProcMacro(cdata.load_proc_macro(tcx, id.index))
609        } else {
610            LoadedMacro::MacroDef {
611                def: cdata.get_macro(tcx, id.index),
612                ident: cdata.item_ident(tcx, id.index),
613                attrs: cdata.get_item_attrs(tcx, id.index).collect(),
614                span: cdata.get_span(tcx, id.index),
615                edition: cdata.root.edition,
616            }
617        }
618    }
619
620    pub fn def_span_untracked(&self, tcx: TyCtxt<'_>, def_id: DefId) -> Span {
621        self.get_crate_data(def_id.krate).get_span(tcx, def_id.index)
622    }
623
624    pub fn def_kind_untracked(&self, def: DefId) -> DefKind {
625        self.get_crate_data(def.krate).def_kind(def.index)
626    }
627
628    pub fn expn_that_defined_untracked(&self, tcx: TyCtxt<'_>, def_id: DefId) -> ExpnId {
629        self.get_crate_data(def_id.krate).get_expn_that_defined(tcx, def_id.index)
630    }
631
632    pub fn ambig_module_children_untracked(
633        &self,
634        tcx: TyCtxt<'_>,
635        def_id: DefId,
636    ) -> impl Iterator<Item = AmbigModChild> {
637        self.get_crate_data(def_id.krate).get_ambig_module_children(tcx, def_id.index)
638    }
639
640    /// Only public-facing way to traverse all the definitions in a non-local crate.
641    /// Critically useful for this third-party project: <https://github.com/hacspec/hacspec>.
642    /// See <https://github.com/rust-lang/rust/pull/85889> for context.
643    pub fn num_def_ids_untracked(&self, cnum: CrateNum) -> usize {
644        self.get_crate_data(cnum).num_def_ids()
645    }
646
647    pub fn get_proc_macro_quoted_span_untracked(
648        &self,
649        tcx: TyCtxt<'_>,
650        cnum: CrateNum,
651        id: usize,
652    ) -> Span {
653        self.get_crate_data(cnum).get_proc_macro_quoted_span(tcx, id)
654    }
655
656    pub fn set_used_recursively(&mut self, cnum: CrateNum) {
657        let cdata = self.get_crate_data_mut(cnum);
658        if !cdata.used {
659            cdata.used = true;
660            let cnum_map = mem::take(&mut cdata.cnum_map);
661            for &dep_cnum in cnum_map.iter() {
662                self.set_used_recursively(dep_cnum);
663            }
664            self.get_crate_data_mut(cnum).cnum_map = cnum_map;
665        }
666    }
667
668    /// Track how an extern crate has been loaded. Called after resolving an import in the local crate.
669    ///
670    /// * the `name` is for [`Self::set_resolved_extern_crate_name`] saving `--extern name=`
671    /// * `extern_crate` is for diagnostics
672    pub(crate) fn update_extern_crate(
673        &mut self,
674        cnum: CrateNum,
675        name: Symbol,
676        extern_crate: ExternCrate,
677    ) {
678        if true {
    {
        match (&extern_crate.dependency_of, &LOCAL_CRATE) {
            (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::Some(format_args!("this function should not be called on transitive dependencies")));
                }
            }
        }
    };
};debug_assert_eq!(
679            extern_crate.dependency_of, LOCAL_CRATE,
680            "this function should not be called on transitive dependencies"
681        );
682        self.set_resolved_extern_crate_name(name, cnum);
683        self.update_transitive_extern_crate_diagnostics(cnum, extern_crate);
684    }
685
686    /// `CrateMetadata` uses `ExternCrate` only for diagnostics
687    fn update_transitive_extern_crate_diagnostics(
688        &mut self,
689        cnum: CrateNum,
690        extern_crate: ExternCrate,
691    ) {
692        let cdata = self.get_crate_data_mut(cnum);
693        if cdata.update_extern_crate_diagnostics(extern_crate) {
694            // Propagate the extern crate info to dependencies if it was updated.
695            let extern_crate = ExternCrate { dependency_of: cnum, ..extern_crate };
696            let cnum_map = mem::take(&mut cdata.cnum_map);
697            for &dep_cnum in cnum_map.iter() {
698                self.update_transitive_extern_crate_diagnostics(dep_cnum, extern_crate);
699            }
700            self.get_crate_data_mut(cnum).cnum_map = cnum_map;
701        }
702    }
703}
704
705impl CrateStore for CStore {
706    fn as_any(&self) -> &dyn Any {
707        self
708    }
709
710    fn untracked_as_any(&mut self) -> &mut dyn Any {
711        self
712    }
713
714    fn crate_name(&self, cnum: CrateNum) -> Symbol {
715        self.get_crate_data(cnum).root.header.name
716    }
717
718    fn stable_crate_id(&self, cnum: CrateNum) -> StableCrateId {
719        self.get_crate_data(cnum).root.stable_crate_id
720    }
721
722    /// Returns the `DefKey` for a given `DefId`. This indicates the
723    /// parent `DefId` as well as some idea of what kind of data the
724    /// `DefId` refers to.
725    fn def_key(&self, def: DefId) -> DefKey {
726        self.get_crate_data(def.krate).def_key(def.index)
727    }
728
729    fn def_path(&self, def: DefId) -> DefPath {
730        self.get_crate_data(def.krate).def_path(def.index)
731    }
732
733    fn def_path_hash(&self, def: DefId) -> DefPathHash {
734        self.get_crate_data(def.krate).def_path_hash(def.index)
735    }
736}
737
738fn provide_cstore_hooks(providers: &mut Providers) {
739    providers.hooks.def_path_hash_to_def_id_extern = |tcx, hash, stable_crate_id| {
740        // If this is a DefPathHash from an upstream crate, let the CrateStore map
741        // it to a DefId.
742        let cstore = CStore::from_tcx(tcx);
743        let cnum = *tcx
744            .untracked()
745            .stable_crate_ids
746            .read()
747            .get(&stable_crate_id)
748            .unwrap_or_else(|| ::rustc_middle::util::bug::bug_fmt(format_args!("uninterned StableCrateId: {0:?}",
        stable_crate_id))bug!("uninterned StableCrateId: {stable_crate_id:?}"));
749        {
    match (&cnum, &LOCAL_CRATE) {
        (left_val, right_val) => {
            if *left_val == *right_val {
                let kind = ::core::panicking::AssertKind::Ne;
                ::core::panicking::assert_failed(kind, &*left_val,
                    &*right_val, ::core::option::Option::None);
            }
        }
    }
};assert_ne!(cnum, LOCAL_CRATE);
750        let def_index = cstore.get_crate_data(cnum).def_path_hash_to_def_index(hash)?;
751        Some(DefId { krate: cnum, index: def_index })
752    };
753
754    providers.hooks.expn_hash_to_expn_id = |tcx, cnum, index_guess, hash| {
755        let cstore = CStore::from_tcx(tcx);
756        cstore.get_crate_data(cnum).expn_hash_to_expn_id(tcx, index_guess, hash)
757    };
758    providers.hooks.import_source_files = |tcx, cnum| {
759        let cstore = CStore::from_tcx(tcx);
760        let cdata = cstore.get_crate_data(cnum);
761        for file_index in 0..cdata.root.source_map.size() {
762            cdata.imported_source_file(tcx, file_index as u32);
763        }
764    };
765}