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::query::{ExternProviders, LocalCrate};
15use rustc_middle::ty::fast_reject::SimplifiedType;
16use rustc_middle::ty::{self, TyCtxt};
17use rustc_middle::util::Providers;
18use rustc_serialize::Decoder;
19use rustc_session::StableCrateId;
20use rustc_session::cstore::{CrateStore, ExternCrate};
21use rustc_span::hygiene::ExpnId;
22use rustc_span::{Span, Symbol, kw};
23
24use super::{Decodable, DecodeIterator};
25use crate::creader::{CStore, LoadedMacro};
26use crate::rmeta::AttrFlags;
27use crate::rmeta::table::IsDefault;
28use crate::{eii, foreign_modules, native_libs};
29
30trait ProcessQueryValue<'tcx, T> {
31    fn process_decoded(self, _tcx: TyCtxt<'tcx>, _err: impl Fn() -> !) -> T;
32}
33
34impl<T> ProcessQueryValue<'_, T> for T {
35    #[inline(always)]
36    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> T {
37        self
38    }
39}
40
41impl<'tcx, T> ProcessQueryValue<'tcx, ty::EarlyBinder<'tcx, T>> for T {
42    #[inline(always)]
43    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> ty::EarlyBinder<'tcx, T> {
44        ty::EarlyBinder::bind(self)
45    }
46}
47
48impl<T> ProcessQueryValue<'_, T> for Option<T> {
49    #[inline(always)]
50    fn process_decoded(self, _tcx: TyCtxt<'_>, err: impl Fn() -> !) -> T {
51        if let Some(value) = self { value } else { err() }
52    }
53}
54
55impl<'tcx, T: ArenaAllocatable<'tcx>> ProcessQueryValue<'tcx, &'tcx T> for Option<T> {
56    #[inline(always)]
57    fn process_decoded(self, tcx: TyCtxt<'tcx>, err: impl Fn() -> !) -> &'tcx T {
58        if let Some(value) = self { tcx.arena.alloc(value) } else { err() }
59    }
60}
61
62impl<T, E> ProcessQueryValue<'_, Result<Option<T>, E>> for Option<T> {
63    #[inline(always)]
64    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> Result<Option<T>, E> {
65        Ok(self)
66    }
67}
68
69impl<'tcx, D: Decoder, T: Copy + Decodable<D>> ProcessQueryValue<'tcx, &'tcx [T]>
70    for Option<DecodeIterator<T, D>>
71{
72    #[inline(always)]
73    fn process_decoded(self, tcx: TyCtxt<'tcx>, err: impl Fn() -> !) -> &'tcx [T] {
74        if let Some(iter) = self { tcx.arena.alloc_from_iter(iter) } else { err() }
75    }
76}
77
78impl<'tcx, D: Decoder, T: Copy + Decodable<D>> ProcessQueryValue<'tcx, Option<&'tcx [T]>>
79    for Option<DecodeIterator<T, D>>
80{
81    #[inline(always)]
82    fn process_decoded(self, tcx: TyCtxt<'tcx>, _err: impl Fn() -> !) -> Option<&'tcx [T]> {
83        if let Some(iter) = self { Some(&*tcx.arena.alloc_from_iter(iter)) } else { None }
84    }
85}
86
87impl ProcessQueryValue<'_, Option<DeprecationEntry>> for Option<Deprecation> {
88    #[inline(always)]
89    fn process_decoded(self, _tcx: TyCtxt<'_>, _err: impl Fn() -> !) -> Option<DeprecationEntry> {
90        self.map(DeprecationEntry::external)
91    }
92}
93
94macro_rules! provide_one {
95    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table }) => {
96        provide_one! {
97            $tcx, $def_id, $other, $cdata, $name => {
98                $cdata
99                    .root
100                    .tables
101                    .$name
102                    .get(($cdata, $tcx), $def_id.index)
103                    .map(|lazy| lazy.decode(($cdata, $tcx)))
104                    .process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
105            }
106        }
107    };
108    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table_defaulted_array }) => {
109        provide_one! {
110            $tcx, $def_id, $other, $cdata, $name => {
111                let lazy = $cdata.root.tables.$name.get(($cdata, $tcx), $def_id.index);
112                let value = if lazy.is_default() {
113                    &[] as &[_]
114                } else {
115                    $tcx.arena.alloc_from_iter(lazy.decode(($cdata, $tcx)))
116                };
117                value.process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
118            }
119        }
120    };
121    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => { table_direct }) => {
122        provide_one! {
123            $tcx, $def_id, $other, $cdata, $name => {
124                // We don't decode `table_direct`, since it's not a Lazy, but an actual value
125                $cdata
126                    .root
127                    .tables
128                    .$name
129                    .get(($cdata, $tcx), $def_id.index)
130                    .process_decoded($tcx, || panic!("{:?} does not have a {:?}", $def_id, stringify!($name)))
131            }
132        }
133    };
134    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident, $name:ident => $compute:block) => {
135        fn $name<'tcx>(
136            $tcx: TyCtxt<'tcx>,
137            def_id_arg: rustc_middle::query::queries::$name::Key<'tcx>,
138        ) -> rustc_middle::query::queries::$name::ProvidedValue<'tcx> {
139            let _prof_timer =
140                $tcx.prof.generic_activity(concat!("metadata_decode_entry_", stringify!($name)));
141
142            #[allow(unused_variables)]
143            let ($def_id, $other) = def_id_arg.into_args();
144            assert!(!$def_id.is_local());
145
146            // External query providers call `crate_hash` in order to register a dependency
147            // on the crate metadata. The exception is `crate_hash` itself, which obviously
148            // doesn't need to do this (and can't, as it would cause a query cycle).
149            use rustc_middle::dep_graph::dep_kinds;
150            if dep_kinds::$name != dep_kinds::crate_hash && $tcx.dep_graph.is_fully_enabled() {
151                $tcx.ensure_ok().crate_hash($def_id.krate);
152            }
153
154            let cdata = rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx($tcx), |c| {
155                c.get_crate_data($def_id.krate).cdata
156            });
157            let $cdata = crate::creader::CrateMetadataRef {
158                cdata: &cdata,
159                cstore: &CStore::from_tcx($tcx),
160            };
161
162            $compute
163        }
164    };
165}
166
167macro_rules! provide {
168    ($tcx:ident, $def_id:ident, $other:ident, $cdata:ident,
169      $($name:ident => { $($compute:tt)* })*) => {
170        fn provide_extern(providers: &mut ExternProviders) {
171            $(provide_one! {
172                $tcx, $def_id, $other, $cdata, $name => { $($compute)* }
173            })*
174
175            *providers = ExternProviders {
176                $($name,)*
177                ..*providers
178            };
179        }
180    }
181}
182
183// small trait to work around different signature queries all being defined via
184// the macro above.
185trait IntoArgs {
186    type Other;
187    fn into_args(self) -> (DefId, Self::Other);
188}
189
190impl IntoArgs for DefId {
191    type Other = ();
192    fn into_args(self) -> (DefId, ()) {
193        (self, ())
194    }
195}
196
197impl IntoArgs for CrateNum {
198    type Other = ();
199    fn into_args(self) -> (DefId, ()) {
200        (self.as_def_id(), ())
201    }
202}
203
204impl IntoArgs for (CrateNum, DefId) {
205    type Other = DefId;
206    fn into_args(self) -> (DefId, DefId) {
207        (self.0.as_def_id(), self.1)
208    }
209}
210
211impl<'tcx> IntoArgs for ty::InstanceKind<'tcx> {
212    type Other = ();
213    fn into_args(self) -> (DefId, ()) {
214        (self.def_id(), ())
215    }
216}
217
218impl IntoArgs for (CrateNum, SimplifiedType) {
219    type Other = SimplifiedType;
220    fn into_args(self) -> (DefId, SimplifiedType) {
221        (self.0.as_def_id(), self.1)
222    }
223}
224
225fn provide_extern(providers: &mut ExternProviders) {
    fn explicit_item_bounds<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::explicit_item_bounds::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_item_bounds != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.explicit_item_bounds.get((cdata, tcx),
                    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::query::queries::explicit_item_self_bounds::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_item_self_bounds != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.explicit_item_self_bounds.get((cdata, tcx),
                    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::query::queries::explicit_predicates_of::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_predicates_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.explicit_predicates_of.get((cdata, tcx),
                        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::query::queries::generics_of::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::generics_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.generics_of.get((cdata, tcx),
                        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::query::queries::inferred_outlives_of::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::inferred_outlives_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.inferred_outlives_of.get((cdata, tcx),
                    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::query::queries::explicit_super_predicates_of::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_super_predicates_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.explicit_super_predicates_of.get((cdata,
                        tcx), 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::query::queries::explicit_implied_predicates_of::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_implied_predicates_of != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.explicit_implied_predicates_of.get((cdata,
                        tcx), 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::query::queries::type_of::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::type_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.type_of.get((cdata, tcx),
                        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_lazy<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::type_alias_is_lazy::Key<'tcx>)
        ->
            rustc_middle::query::queries::type_alias_is_lazy::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_type_alias_is_lazy");
        #[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::dep_kinds;
        if dep_kinds::type_alias_is_lazy != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.type_alias_is_lazy.get((cdata, tcx),
                    def_id.index).process_decoded(tcx,
                ||
                    {
                        ::core::panicking::panic_fmt(format_args!("{0:?} does not have a {1:?}",
                                def_id, "type_alias_is_lazy"));
                    })
        }
    }
    fn variances_of<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::variances_of::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::variances_of != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.variances_of.get((cdata, tcx),
                        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::query::queries::fn_sig::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::fn_sig != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.fn_sig.get((cdata, tcx),
                        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::query::queries::codegen_fn_attrs::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::codegen_fn_attrs != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.codegen_fn_attrs.get((cdata, tcx),
                        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::query::queries::impl_trait_header::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::impl_trait_header != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.impl_trait_header.get((cdata, tcx),
                        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::query::queries::const_param_default::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::const_param_default != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.const_param_default.get((cdata, tcx),
                        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::query::queries::object_lifetime_default::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::object_lifetime_default != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.object_lifetime_default.get((cdata, tcx),
                        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::query::queries::thir_abstract_const::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::thir_abstract_const != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.thir_abstract_const.get((cdata, tcx),
                        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::query::queries::optimized_mir::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::optimized_mir != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.optimized_mir.get((cdata, tcx),
                        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::query::queries::mir_for_ctfe::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::mir_for_ctfe != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.mir_for_ctfe.get((cdata, tcx),
                        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::query::queries::trivial_const::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::trivial_const != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.trivial_const.get((cdata, tcx),
                        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::query::queries::closure_saved_names_of_captured_variables::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::closure_saved_names_of_captured_variables !=
                    dep_kinds::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.closure_saved_names_of_captured_variables.get((cdata,
                            tcx),
                        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::query::queries::mir_coroutine_witnesses::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::mir_coroutine_witnesses != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.mir_coroutine_witnesses.get((cdata, tcx),
                        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::query::queries::promoted_mir::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::promoted_mir != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.promoted_mir.get((cdata, tcx),
                        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::query::queries::def_span::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::def_span != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.def_span.get((cdata, tcx),
                        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::query::queries::def_ident_span::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::def_ident_span != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.def_ident_span.get((cdata, tcx),
                        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::query::queries::lookup_stability::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::lookup_stability != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.lookup_stability.get((cdata, tcx),
                        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::query::queries::lookup_const_stability::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::lookup_const_stability != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.lookup_const_stability.get((cdata, tcx),
                        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::query::queries::lookup_default_body_stability::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::lookup_default_body_stability != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.lookup_default_body_stability.get((cdata, tcx),
                        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::query::queries::lookup_deprecation_entry::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::lookup_deprecation_entry != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.lookup_deprecation_entry.get((cdata, tcx),
                        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::query::queries::params_in_repr::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::params_in_repr != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.params_in_repr.get((cdata, tcx),
                        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::query::queries::def_kind::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::def_kind != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.def_kind(tcx, def_id.index) }
    }
    fn impl_parent<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::impl_parent::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::impl_parent != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.impl_parent.get((cdata, tcx),
                        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::query::queries::defaultness::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::defaultness != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.defaultness.get((cdata, tcx),
                    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::query::queries::constness::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::constness != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.constness.get((cdata, tcx),
                    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::query::queries::const_conditions::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::const_conditions != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.const_conditions.get((cdata, tcx),
                        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::query::queries::explicit_implied_const_bounds::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::explicit_implied_const_bounds != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            let lazy =
                cdata.root.tables.explicit_implied_const_bounds.get((cdata,
                        tcx), 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::query::queries::coerce_unsized_info::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::coerce_unsized_info != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            Ok(cdata.root.tables.coerce_unsized_info.get((cdata, tcx),
                            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::query::queries::mir_const_qualif::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::mir_const_qualif != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.mir_const_qualif.get((cdata, tcx),
                        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::query::queries::rendered_const::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::rendered_const != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.rendered_const.get((cdata, tcx),
                        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::query::queries::rendered_precise_capturing_args::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::rendered_precise_capturing_args != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.rendered_precise_capturing_args.get((cdata,
                            tcx),
                        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::query::queries::asyncness::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::asyncness != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.asyncness.get((cdata, tcx),
                    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::query::queries::fn_arg_idents::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::fn_arg_idents != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.fn_arg_idents.get((cdata, tcx),
                        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::query::queries::coroutine_kind::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::coroutine_kind != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.coroutine_kind.get((cdata, tcx),
                    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::query::queries::coroutine_for_closure::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::coroutine_for_closure != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.coroutine_for_closure.get((cdata, tcx),
                        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::query::queries::coroutine_by_move_body_def_id::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::coroutine_by_move_body_def_id != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.coroutine_by_move_body_def_id.get((cdata, tcx),
                        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::query::queries::eval_static_initializer::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::eval_static_initializer != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            Ok(cdata.root.tables.eval_static_initializer.get((cdata, tcx),
                            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::query::queries::trait_def::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::trait_def != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.trait_def.get((cdata, tcx),
                        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::query::queries::deduced_param_attrs::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::deduced_param_attrs != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.deduced_param_attrs.get((cdata, tcx),
                        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::query::queries::opaque_ty_origin::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::opaque_ty_origin != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.opaque_ty_origin.get((cdata, tcx),
                        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::query::queries::assumed_wf_types_for_rpitit::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::assumed_wf_types_for_rpitit != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.assumed_wf_types_for_rpitit.get((cdata, tcx),
                        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::query::queries::collect_return_position_impl_trait_in_trait_tys::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::collect_return_position_impl_trait_in_trait_tys !=
                    dep_kinds::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            Ok(cdata.root.tables.trait_impl_trait_tys.get((cdata, tcx),
                            def_id.index).map(|lazy|
                            lazy.decode((cdata,
                                    tcx))).process_decoded(tcx,
                    ||
                        {
                            ::core::panicking::panic_fmt(format_args!("{0:?} does not have trait_impl_trait_tys",
                                    def_id));
                        }))
        }
    }
    fn associated_types_for_impl_traits_in_trait_or_impl<'tcx>(tcx:
            TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::associated_types_for_impl_traits_in_trait_or_impl::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::associated_types_for_impl_traits_in_trait_or_impl !=
                    dep_kinds::crate_hash && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.associated_types_for_impl_traits_in_trait_or_impl.get((cdata,
                            tcx),
                        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::query::queries::visibility::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::visibility != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_visibility(tcx, def_id.index) }
    }
    fn adt_def<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::adt_def::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::adt_def != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_adt_def(tcx, def_id.index) }
    }
    fn adt_destructor<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::adt_destructor::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::adt_destructor != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.adt_destructor.get((cdata, tcx),
                        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::query::queries::adt_async_destructor::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::adt_async_destructor != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.adt_async_destructor.get((cdata, tcx),
                        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::query::queries::associated_item_def_ids::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::associated_item_def_ids != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            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::query::queries::associated_item::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::associated_item != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_associated_item(tcx, def_id.index) }
    }
    fn inherent_impls<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::inherent_impls::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::inherent_impls != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_inherent_implementations_for_type(tcx, def_id.index) }
    }
    fn attrs_for_def<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::attrs_for_def::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::attrs_for_def != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { 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::query::queries::is_mir_available::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_mir_available != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.is_item_mir_available(tcx, def_id.index) }
    }
    fn is_ctfe_mir_available<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::is_ctfe_mir_available::Key<'tcx>)
        ->
            rustc_middle::query::queries::is_ctfe_mir_available::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_is_ctfe_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::dep_kinds;
        if dep_kinds::is_ctfe_mir_available != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.is_ctfe_mir_available(tcx, def_id.index) }
    }
    fn cross_crate_inlinable<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::cross_crate_inlinable::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::cross_crate_inlinable != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            cdata.root.tables.cross_crate_inlinable.get((cdata, tcx),
                    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::query::queries::dylib_dependency_formats::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::dylib_dependency_formats != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_dylib_dependency_formats(tcx) }
    }
    fn is_private_dep<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::is_private_dep::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_private_dep != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.private_dep }
    }
    fn is_panic_runtime<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::is_panic_runtime::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_panic_runtime != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.panic_runtime }
    }
    fn is_compiler_builtins<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::is_compiler_builtins::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_compiler_builtins != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.compiler_builtins }
    }
    fn has_global_allocator<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::has_global_allocator::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::has_global_allocator != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.has_global_allocator }
    }
    fn has_alloc_error_handler<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::has_alloc_error_handler::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::has_alloc_error_handler != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.has_alloc_error_handler }
    }
    fn has_panic_handler<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::has_panic_handler::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::has_panic_handler != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.has_panic_handler }
    }
    fn externally_implementable_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::externally_implementable_items::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::externally_implementable_items != dep_kinds::crate_hash
                && tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            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::query::queries::is_profiler_runtime::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_profiler_runtime != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.profiler_runtime }
    }
    fn required_panic_strategy<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::required_panic_strategy::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::required_panic_strategy != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.required_panic_strategy }
    }
    fn panic_in_drop_strategy<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::panic_in_drop_strategy::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::panic_in_drop_strategy != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.panic_in_drop_strategy }
    }
    fn extern_crate<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::extern_crate::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::extern_crate != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.extern_crate.map(|c| &*tcx.arena.alloc(c)) }
    }
    fn is_no_builtins<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::is_no_builtins::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::is_no_builtins != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.no_builtins }
    }
    fn symbol_mangling_version<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::symbol_mangling_version::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::symbol_mangling_version != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.symbol_mangling_version }
    }
    fn specialization_enabled_in<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::specialization_enabled_in::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::specialization_enabled_in != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.specialization_enabled_in }
    }
    fn reachable_non_generics<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::reachable_non_generics::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::reachable_non_generics != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            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::query::queries::native_libraries::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::native_libraries != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_native_libraries(tcx).collect() }
    }
    fn foreign_modules<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::foreign_modules::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::foreign_modules != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_foreign_modules(tcx).map(|m| (m.def_id, m)).collect() }
    }
    fn crate_hash<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::crate_hash::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::crate_hash != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.header.hash }
    }
    fn crate_host_hash<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::crate_host_hash::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::crate_host_hash != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.host_hash }
    }
    fn crate_name<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::crate_name::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::crate_name != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.header.name }
    }
    fn num_extern_def_ids<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::num_extern_def_ids::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::num_extern_def_ids != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.num_def_ids() }
    }
    fn extra_filename<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::extra_filename::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::extra_filename != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.root.extra_filename.clone() }
    }
    fn traits<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::traits::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::traits != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { tcx.arena.alloc_from_iter(cdata.get_traits(tcx)) }
    }
    fn trait_impls_in_crate<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::trait_impls_in_crate::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::trait_impls_in_crate != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { tcx.arena.alloc_from_iter(cdata.get_trait_impls(tcx)) }
    }
    fn implementations_of_trait<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::implementations_of_trait::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::implementations_of_trait != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_implementations_of_trait(tcx, other) }
    }
    fn crate_incoherent_impls<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::crate_incoherent_impls::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::crate_incoherent_impls != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_incoherent_impls(tcx, other) }
    }
    fn dep_kind<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::dep_kind::Key<'tcx>)
        -> rustc_middle::query::queries::dep_kind::ProvidedValue<'tcx> {
        let _prof_timer =
            tcx.prof.generic_activity("metadata_decode_entry_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::dep_kinds;
        if dep_kinds::dep_kind != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.dep_kind }
    }
    fn module_children<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::module_children::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::module_children != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {
            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::query::queries::lib_features::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::lib_features != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_lib_features(tcx) }
    }
    fn stability_implications<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::stability_implications::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::stability_implications != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_stability_implications(tcx).iter().copied().collect() }
    }
    fn stripped_cfg_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::stripped_cfg_items::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::stripped_cfg_items != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_stripped_cfg_items(tcx, cdata.cnum) }
    }
    fn intrinsic_raw<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::intrinsic_raw::Key<'tcx>)
        -> rustc_middle::query::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::dep_kinds;
        if dep_kinds::intrinsic_raw != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_intrinsic(tcx, def_id.index) }
    }
    fn defined_lang_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::defined_lang_items::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::defined_lang_items != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_lang_items(tcx) }
    }
    fn diagnostic_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg: rustc_middle::query::queries::diagnostic_items::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::diagnostic_items != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_diagnostic_items(tcx) }
    }
    fn missing_lang_items<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::missing_lang_items::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::missing_lang_items != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        { cdata.get_missing_lang_items(tcx) }
    }
    fn missing_extern_crate_item<'tcx>(tcx: TyCtxt<'tcx>,
        def_id_arg:
            rustc_middle::query::queries::missing_extern_crate_item::Key<'tcx>)
        ->
            rustc_middle::query::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::dep_kinds;
        if dep_kinds::missing_extern_crate_item != dep_kinds::crate_hash &&
                tcx.dep_graph.is_fully_enabled() {
            tcx.ensure_ok().crate_hash(def_id.krate);
        }
        let cdata =
            rustc_data_structures::sync::FreezeReadGuard::map(CStore::from_tcx(tcx),
                |c| { c.get_crate_data(def_id.krate).cdata });
        let cdata =
            crate::creader::CrateMetadataRef {
                cdata: &cdata,
                cstore: &CStore::from_tcx(tcx),
            };
        {

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