diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs
index 483b1a40e44d6..05e3ee3322e59 100644
--- a/src/librustc_metadata/creader.rs
+++ b/src/librustc_metadata/creader.rs
@@ -2,7 +2,7 @@
 
 use crate::cstore::{self, CStore, MetadataBlob};
 use crate::locator::{self, CratePaths};
-use crate::schema::{CrateRoot, CrateDep};
+use crate::rmeta::{CrateRoot, CrateDep};
 use rustc_data_structures::sync::{Lock, Once, AtomicCell};
 
 use rustc::hir::def_id::CrateNum;
diff --git a/src/librustc_metadata/cstore.rs b/src/librustc_metadata/cstore.rs
index b7596d2018f7e..c6c8ee575a98a 100644
--- a/src/librustc_metadata/cstore.rs
+++ b/src/librustc_metadata/cstore.rs
@@ -1,7 +1,7 @@
 // The crate store - a central repo for information collected about external
 // crates and libraries
 
-use crate::schema;
+use crate::rmeta;
 use rustc::dep_graph::DepNodeIndex;
 use rustc::hir::def_id::{CrateNum, DefIndex};
 use rustc::hir::map::definitions::DefPathTable;
@@ -17,7 +17,7 @@ use syntax_expand::base::SyntaxExtension;
 use syntax_pos;
 use proc_macro::bridge::client::ProcMacro;
 
-pub use crate::cstore_impl::{provide, provide_extern};
+pub use crate::rmeta::{provide, provide_extern};
 
 // A map from external crate numbers (as decoded from some crate file) to
 // local crate numbers (as generated during this session). Each external
@@ -49,7 +49,7 @@ crate struct CrateMetadata {
     /// lifetime is only used behind `Lazy`, and therefore acts like an
     /// universal (`for<'tcx>`), that is paired up with whichever `TyCtxt`
     /// is being used to decode those values.
-    crate root: schema::CrateRoot<'static>,
+    crate root: rmeta::CrateRoot<'static>,
     /// For each definition in this crate, we encode a key. When the
     /// crate is loaded, we read all the keys and put them in this
     /// hashmap, which gives the reverse mapping. This allows us to
@@ -59,7 +59,7 @@ crate struct CrateMetadata {
     /// Trait impl data.
     /// FIXME: Used only from queries and can use query cache,
     /// so pre-decoding can probably be avoided.
-    crate trait_impls: FxHashMap<(u32, DefIndex), schema::Lazy<[DefIndex]>>,
+    crate trait_impls: FxHashMap<(u32, DefIndex), rmeta::Lazy<[DefIndex]>>,
     /// Proc macro descriptions for this crate, if it's a proc macro crate.
     crate raw_proc_macros: Option<&'static [ProcMacro]>,
     /// Source maps for code from the crate.
diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs
index 291ee23ff7262..ac9d78e9a515c 100644
--- a/src/librustc_metadata/lib.rs
+++ b/src/librustc_metadata/lib.rs
@@ -26,15 +26,11 @@ extern crate rustc_data_structures;
 
 pub mod error_codes;
 
-mod encoder;
-mod decoder;
 mod dependency_format;
-mod cstore_impl;
 mod foreign_modules;
 mod link_args;
 mod native_libs;
-mod schema;
-mod table;
+mod rmeta;
 
 pub mod creader;
 pub mod cstore;
diff --git a/src/librustc_metadata/locator.rs b/src/librustc_metadata/locator.rs
index 4a263250f9b0d..88d7595b063da 100644
--- a/src/librustc_metadata/locator.rs
+++ b/src/librustc_metadata/locator.rs
@@ -214,7 +214,7 @@
 
 use crate::cstore::MetadataBlob;
 use crate::creader::Library;
-use crate::schema::{METADATA_HEADER, rustc_version};
+use crate::rmeta::{METADATA_HEADER, rustc_version};
 
 use rustc_data_structures::fx::FxHashSet;
 use rustc_data_structures::svh::Svh;
diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/rmeta/decoder.rs
similarity index 92%
rename from src/librustc_metadata/decoder.rs
rename to src/librustc_metadata/rmeta/decoder.rs
index 771d01a4b6a1d..40ec04537b0e6 100644
--- a/src/librustc_metadata/decoder.rs
+++ b/src/librustc_metadata/rmeta/decoder.rs
@@ -1,8 +1,8 @@
 // Decoding metadata from a single crate's metadata
 
 use crate::cstore::{self, CrateMetadata, MetadataBlob};
-use crate::schema::*;
-use crate::table::{FixedSizeEncoding, PerDefTable};
+use crate::rmeta::*;
+use crate::rmeta::table::{FixedSizeEncoding, PerDefTable};
 
 use rustc_index::vec::IndexVec;
 use rustc_data_structures::sync::Lrc;
@@ -40,6 +40,10 @@ use syntax_pos::symbol::{Symbol, sym};
 use log::debug;
 use proc_macro::bridge::client::ProcMacro;
 
+pub use cstore_impl::{provide, provide_extern};
+
+mod cstore_impl;
+
 crate struct DecodeContext<'a, 'tcx> {
     opaque: opaque::Decoder<'a>,
     cdata: Option<&'a CrateMetadata>,
@@ -464,7 +468,7 @@ impl<'tcx> EntryKind<'tcx> {
 }
 
 impl<'a, 'tcx> CrateMetadata {
-    crate fn is_proc_macro_crate(&self) -> bool {
+    fn is_proc_macro_crate(&self) -> bool {
         self.root.proc_macro_decls_static.is_some()
     }
 
@@ -507,7 +511,7 @@ impl<'a, 'tcx> CrateMetadata {
         &self.raw_proc_macros.unwrap()[pos]
     }
 
-    crate fn item_name(&self, item_index: DefIndex) -> Symbol {
+    fn item_name(&self, item_index: DefIndex) -> Symbol {
         if !self.is_proc_macro(item_index) {
             self.def_key(item_index)
                 .disambiguated_data
@@ -519,7 +523,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn def_kind(&self, index: DefIndex) -> Option<DefKind> {
+    fn def_kind(&self, index: DefIndex) -> Option<DefKind> {
         if !self.is_proc_macro(index) {
             self.kind(index).def_kind()
         } else {
@@ -529,11 +533,11 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_span(&self, index: DefIndex, sess: &Session) -> Span {
+    fn get_span(&self, index: DefIndex, sess: &Session) -> Span {
         self.root.per_def.span.get(self, index).unwrap().decode((self, sess))
     }
 
-    crate fn load_proc_macro(&self, id: DefIndex, sess: &Session) -> SyntaxExtension {
+    fn load_proc_macro(&self, id: DefIndex, sess: &Session) -> SyntaxExtension {
         let (name, kind, helper_attrs) = match *self.raw_proc_macro(id) {
             ProcMacro::CustomDerive { trait_name, attributes, client } => {
                 let helper_attrs =
@@ -563,7 +567,7 @@ impl<'a, 'tcx> CrateMetadata {
         )
     }
 
-    crate fn get_trait_def(&self, item_id: DefIndex, sess: &Session) -> ty::TraitDef {
+    fn get_trait_def(&self, item_id: DefIndex, sess: &Session) -> ty::TraitDef {
         match self.kind(item_id) {
             EntryKind::Trait(data) => {
                 let data = data.decode((self, sess));
@@ -633,7 +637,7 @@ impl<'a, 'tcx> CrateMetadata {
         )
     }
 
-    crate fn get_adt_def(&self, item_id: DefIndex, tcx: TyCtxt<'tcx>) -> &'tcx ty::AdtDef {
+    fn get_adt_def(&self, item_id: DefIndex, tcx: TyCtxt<'tcx>) -> &'tcx ty::AdtDef {
         let kind = self.kind(item_id);
         let did = self.local_def_id(item_id);
 
@@ -658,7 +662,7 @@ impl<'a, 'tcx> CrateMetadata {
         tcx.alloc_adt_def(did, adt_kind, variants, repr)
     }
 
-    crate fn get_explicit_predicates(
+    fn get_explicit_predicates(
         &self,
         item_id: DefIndex,
         tcx: TyCtxt<'tcx>,
@@ -666,7 +670,7 @@ impl<'a, 'tcx> CrateMetadata {
         self.root.per_def.explicit_predicates.get(self, item_id).unwrap().decode((self, tcx))
     }
 
-    crate fn get_inferred_outlives(
+    fn get_inferred_outlives(
         &self,
         item_id: DefIndex,
         tcx: TyCtxt<'tcx>,
@@ -676,7 +680,7 @@ impl<'a, 'tcx> CrateMetadata {
         }).unwrap_or_default()
     }
 
-    crate fn get_super_predicates(
+    fn get_super_predicates(
         &self,
         item_id: DefIndex,
         tcx: TyCtxt<'tcx>,
@@ -684,28 +688,28 @@ impl<'a, 'tcx> CrateMetadata {
         self.root.per_def.super_predicates.get(self, item_id).unwrap().decode((self, tcx))
     }
 
-    crate fn get_generics(&self, item_id: DefIndex, sess: &Session) -> ty::Generics {
+    fn get_generics(&self, item_id: DefIndex, sess: &Session) -> ty::Generics {
         self.root.per_def.generics.get(self, item_id).unwrap().decode((self, sess))
     }
 
-    crate fn get_type(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
+    fn get_type(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
         self.root.per_def.ty.get(self, id).unwrap().decode((self, tcx))
     }
 
-    crate fn get_stability(&self, id: DefIndex) -> Option<attr::Stability> {
+    fn get_stability(&self, id: DefIndex) -> Option<attr::Stability> {
         match self.is_proc_macro(id) {
             true => self.root.proc_macro_stability.clone(),
             false => self.root.per_def.stability.get(self, id).map(|stab| stab.decode(self)),
         }
     }
 
-    crate fn get_deprecation(&self, id: DefIndex) -> Option<attr::Deprecation> {
+    fn get_deprecation(&self, id: DefIndex) -> Option<attr::Deprecation> {
         self.root.per_def.deprecation.get(self, id)
             .filter(|_| !self.is_proc_macro(id))
             .map(|depr| depr.decode(self))
     }
 
-    crate fn get_visibility(&self, id: DefIndex) -> ty::Visibility {
+    fn get_visibility(&self, id: DefIndex) -> ty::Visibility {
         match self.is_proc_macro(id) {
             true => ty::Visibility::Public,
             false => self.root.per_def.visibility.get(self, id).unwrap().decode(self),
@@ -719,31 +723,31 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_parent_impl(&self, id: DefIndex) -> Option<DefId> {
+    fn get_parent_impl(&self, id: DefIndex) -> Option<DefId> {
         self.get_impl_data(id).parent_impl
     }
 
-    crate fn get_impl_polarity(&self, id: DefIndex) -> ty::ImplPolarity {
+    fn get_impl_polarity(&self, id: DefIndex) -> ty::ImplPolarity {
         self.get_impl_data(id).polarity
     }
 
-    crate fn get_impl_defaultness(&self, id: DefIndex) -> hir::Defaultness {
+    fn get_impl_defaultness(&self, id: DefIndex) -> hir::Defaultness {
         self.get_impl_data(id).defaultness
     }
 
-    crate fn get_coerce_unsized_info(
+    fn get_coerce_unsized_info(
         &self,
         id: DefIndex,
     ) -> Option<ty::adjustment::CoerceUnsizedInfo> {
         self.get_impl_data(id).coerce_unsized_info
     }
 
-    crate fn get_impl_trait(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Option<ty::TraitRef<'tcx>> {
+    fn get_impl_trait(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> Option<ty::TraitRef<'tcx>> {
         self.root.per_def.impl_trait_ref.get(self, id).map(|tr| tr.decode((self, tcx)))
     }
 
     /// Iterates over all the stability attributes in the given crate.
-    crate fn get_lib_features(&self, tcx: TyCtxt<'tcx>) -> &'tcx [(ast::Name, Option<ast::Name>)] {
+    fn get_lib_features(&self, tcx: TyCtxt<'tcx>) -> &'tcx [(ast::Name, Option<ast::Name>)] {
         // FIXME: For a proc macro crate, not sure whether we should return the "host"
         // features or an empty Vec. Both don't cause ICEs.
         tcx.arena.alloc_from_iter(self.root
@@ -752,7 +756,7 @@ impl<'a, 'tcx> CrateMetadata {
     }
 
     /// Iterates over the language items in the given crate.
-    crate fn get_lang_items(&self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, usize)] {
+    fn get_lang_items(&self, tcx: TyCtxt<'tcx>) -> &'tcx [(DefId, usize)] {
         if self.is_proc_macro_crate() {
             // Proc macro crates do not export any lang-items to the target.
             &[]
@@ -765,7 +769,7 @@ impl<'a, 'tcx> CrateMetadata {
     }
 
     /// Iterates over the diagnostic items in the given crate.
-    crate fn get_diagnostic_items(
+    fn get_diagnostic_items(
         &self,
         tcx: TyCtxt<'tcx>,
     ) -> &'tcx FxHashMap<Symbol, DefId> {
@@ -782,7 +786,7 @@ impl<'a, 'tcx> CrateMetadata {
     }
 
     /// Iterates over each child of the given item.
-    crate fn each_child_of_item<F>(&self, id: DefIndex, mut callback: F, sess: &Session)
+    fn each_child_of_item<F>(&self, id: DefIndex, mut callback: F, sess: &Session)
         where F: FnMut(def::Export<hir::HirId>)
     {
         if let Some(proc_macros_ids) = self.root.proc_macro_data.map(|d| d.decode(self)) {
@@ -921,12 +925,12 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn is_item_mir_available(&self, id: DefIndex) -> bool {
+    fn is_item_mir_available(&self, id: DefIndex) -> bool {
         !self.is_proc_macro(id) &&
             self.root.per_def.mir.get(self, id).is_some()
     }
 
-    crate fn get_optimized_mir(&self, tcx: TyCtxt<'tcx>, id: DefIndex) -> Body<'tcx> {
+    fn get_optimized_mir(&self, tcx: TyCtxt<'tcx>, id: DefIndex) -> Body<'tcx> {
         self.root.per_def.mir.get(self, id)
             .filter(|_| !self.is_proc_macro(id))
             .unwrap_or_else(|| {
@@ -935,7 +939,7 @@ impl<'a, 'tcx> CrateMetadata {
             .decode((self, tcx))
     }
 
-    crate fn get_promoted_mir(
+    fn get_promoted_mir(
         &self,
         tcx: TyCtxt<'tcx>,
         id: DefIndex,
@@ -948,7 +952,7 @@ impl<'a, 'tcx> CrateMetadata {
             .decode((self, tcx))
     }
 
-    crate fn mir_const_qualif(&self, id: DefIndex) -> u8 {
+    fn mir_const_qualif(&self, id: DefIndex) -> u8 {
         match self.kind(id) {
             EntryKind::Const(qualif, _) |
             EntryKind::AssocConst(AssocContainer::ImplDefault, qualif, _) |
@@ -959,7 +963,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_associated_item(&self, id: DefIndex) -> ty::AssocItem {
+    fn get_associated_item(&self, id: DefIndex) -> ty::AssocItem {
         let def_key = self.def_key(id);
         let parent = self.local_def_id(def_key.parent.unwrap());
         let name = def_key.disambiguated_data.data.get_opt_name().unwrap();
@@ -992,12 +996,12 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_item_variances(&self, id: DefIndex) -> Vec<ty::Variance> {
+    fn get_item_variances(&self, id: DefIndex) -> Vec<ty::Variance> {
         self.root.per_def.variances.get(self, id).unwrap_or(Lazy::empty())
             .decode(self).collect()
     }
 
-    crate fn get_ctor_kind(&self, node_id: DefIndex) -> CtorKind {
+    fn get_ctor_kind(&self, node_id: DefIndex) -> CtorKind {
         match self.kind(node_id) {
             EntryKind::Struct(data, _) |
             EntryKind::Union(data, _) |
@@ -1006,7 +1010,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_ctor_def_id(&self, node_id: DefIndex) -> Option<DefId> {
+    fn get_ctor_def_id(&self, node_id: DefIndex) -> Option<DefId> {
         match self.kind(node_id) {
             EntryKind::Struct(data, _) => {
                 data.decode(self).ctor.map(|index| self.local_def_id(index))
@@ -1018,7 +1022,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_item_attrs(&self, node_id: DefIndex, sess: &Session) -> Lrc<[ast::Attribute]> {
+    fn get_item_attrs(&self, node_id: DefIndex, sess: &Session) -> Lrc<[ast::Attribute]> {
         // The attributes for a tuple struct/variant are attached to the definition, not the ctor;
         // we assume that someone passing in a tuple struct ctor is actually wanting to
         // look at the definition
@@ -1034,7 +1038,7 @@ impl<'a, 'tcx> CrateMetadata {
             .collect::<Vec<_>>())
     }
 
-    crate fn get_struct_field_names(
+    fn get_struct_field_names(
         &self,
         id: DefIndex,
         sess: &Session,
@@ -1060,7 +1064,7 @@ impl<'a, 'tcx> CrateMetadata {
         None
     }
 
-    crate fn get_inherent_implementations_for_type(
+    fn get_inherent_implementations_for_type(
         &self,
         tcx: TyCtxt<'tcx>,
         id: DefIndex,
@@ -1072,7 +1076,7 @@ impl<'a, 'tcx> CrateMetadata {
         )
     }
 
-    crate fn get_implementations_for_trait(
+    fn get_implementations_for_trait(
         &self,
         tcx: TyCtxt<'tcx>,
         filter: Option<DefId>,
@@ -1103,7 +1107,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_trait_of_item(&self, id: DefIndex) -> Option<DefId> {
+    fn get_trait_of_item(&self, id: DefIndex) -> Option<DefId> {
         let def_key = self.def_key(id);
         match def_key.disambiguated_data.data {
             DefPathData::TypeNs(..) | DefPathData::ValueNs(..) => (),
@@ -1120,7 +1124,7 @@ impl<'a, 'tcx> CrateMetadata {
     }
 
 
-    crate fn get_native_libraries(&self, sess: &Session) -> Vec<NativeLibrary> {
+    fn get_native_libraries(&self, sess: &Session) -> Vec<NativeLibrary> {
         if self.is_proc_macro_crate() {
             // Proc macro crates do not have any *target* native libraries.
             vec![]
@@ -1129,7 +1133,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_foreign_modules(&self, tcx: TyCtxt<'tcx>) -> &'tcx [ForeignModule] {
+    fn get_foreign_modules(&self, tcx: TyCtxt<'tcx>) -> &'tcx [ForeignModule] {
         if self.is_proc_macro_crate() {
             // Proc macro crates do not have any *target* foreign modules.
             &[]
@@ -1138,7 +1142,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_dylib_dependency_formats(
+    fn get_dylib_dependency_formats(
         &self,
         tcx: TyCtxt<'tcx>,
     ) -> &'tcx [(CrateNum, LinkagePreference)] {
@@ -1152,7 +1156,7 @@ impl<'a, 'tcx> CrateMetadata {
             }))
     }
 
-    crate fn get_missing_lang_items(&self, tcx: TyCtxt<'tcx>) -> &'tcx [lang_items::LangItem] {
+    fn get_missing_lang_items(&self, tcx: TyCtxt<'tcx>) -> &'tcx [lang_items::LangItem] {
         if self.is_proc_macro_crate() {
             // Proc macro crates do not depend on any target weak lang-items.
             &[]
@@ -1163,7 +1167,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_fn_param_names(&self, id: DefIndex) -> Vec<ast::Name> {
+    fn get_fn_param_names(&self, id: DefIndex) -> Vec<ast::Name> {
         let param_names = match self.kind(id) {
             EntryKind::Fn(data) |
             EntryKind::ForeignFn(data) => data.decode(self).param_names,
@@ -1173,7 +1177,7 @@ impl<'a, 'tcx> CrateMetadata {
         param_names.decode(self).collect()
     }
 
-    crate fn exported_symbols(
+    fn exported_symbols(
         &self,
         tcx: TyCtxt<'tcx>,
     ) -> Vec<(ExportedSymbol<'tcx>, SymbolExportLevel)> {
@@ -1186,7 +1190,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_rendered_const(&self, id: DefIndex) -> String {
+    fn get_rendered_const(&self, id: DefIndex) -> String {
         match self.kind(id) {
             EntryKind::Const(_, data) |
             EntryKind::AssocConst(_, _, data) => data.decode(self).0,
@@ -1194,14 +1198,14 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn get_macro(&self, id: DefIndex) -> MacroDef {
+    fn get_macro(&self, id: DefIndex) -> MacroDef {
         match self.kind(id) {
             EntryKind::MacroDef(macro_def) => macro_def.decode(self),
             _ => bug!(),
         }
     }
 
-    crate fn is_const_fn_raw(&self, id: DefIndex) -> bool {
+    fn is_const_fn_raw(&self, id: DefIndex) -> bool {
         let constness = match self.kind(id) {
             EntryKind::Method(data) => data.decode(self).fn_data.constness,
             EntryKind::Fn(data) => data.decode(self).constness,
@@ -1211,7 +1215,7 @@ impl<'a, 'tcx> CrateMetadata {
         constness == hir::Constness::Const
     }
 
-    crate fn asyncness(&self, id: DefIndex) -> hir::IsAsync {
+    fn asyncness(&self, id: DefIndex) -> hir::IsAsync {
          match self.kind(id) {
             EntryKind::Fn(data) => data.decode(self).asyncness,
             EntryKind::Method(data) => data.decode(self).fn_data.asyncness,
@@ -1220,7 +1224,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn is_foreign_item(&self, id: DefIndex) -> bool {
+    fn is_foreign_item(&self, id: DefIndex) -> bool {
         match self.kind(id) {
             EntryKind::ForeignImmStatic |
             EntryKind::ForeignMutStatic |
@@ -1229,7 +1233,7 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn static_mutability(&self, id: DefIndex) -> Option<hir::Mutability> {
+    fn static_mutability(&self, id: DefIndex) -> Option<hir::Mutability> {
         match self.kind(id) {
             EntryKind::ImmStatic |
             EntryKind::ForeignImmStatic => Some(hir::MutImmutable),
@@ -1239,12 +1243,12 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    crate fn fn_sig(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> ty::PolyFnSig<'tcx> {
+    fn fn_sig(&self, id: DefIndex, tcx: TyCtxt<'tcx>) -> ty::PolyFnSig<'tcx> {
         self.root.per_def.fn_sig.get(self, id).unwrap().decode((self, tcx))
     }
 
     #[inline]
-    crate fn def_key(&self, index: DefIndex) -> DefKey {
+    fn def_key(&self, index: DefIndex) -> DefKey {
         let mut key = self.def_path_table.def_key(index);
         if self.is_proc_macro(index) {
             let name = self.raw_proc_macro(index).name();
@@ -1254,13 +1258,13 @@ impl<'a, 'tcx> CrateMetadata {
     }
 
     // Returns the path leading to the thing with this `id`.
-    crate fn def_path(&self, id: DefIndex) -> DefPath {
+    fn def_path(&self, id: DefIndex) -> DefPath {
         debug!("def_path(cnum={:?}, id={:?})", self.cnum, id);
         DefPath::make(self.cnum, id, |parent| self.def_key(parent))
     }
 
     #[inline]
-    crate fn def_path_hash(&self, index: DefIndex) -> DefPathHash {
+    fn def_path_hash(&self, index: DefIndex) -> DefPathHash {
         self.def_path_table.def_path_hash(index)
     }
 
@@ -1358,7 +1362,7 @@ impl<'a, 'tcx> CrateMetadata {
 
     /// Get the `DepNodeIndex` corresponding this crate. The result of this
     /// method is cached in the `dep_node_index` field.
-    pub(super) fn get_crate_dep_node_index(&self, tcx: TyCtxt<'tcx>) -> DepNodeIndex {
+    fn get_crate_dep_node_index(&self, tcx: TyCtxt<'tcx>) -> DepNodeIndex {
         let mut dep_node_index = self.dep_node_index.load();
 
         if unlikely!(dep_node_index == DepNodeIndex::INVALID) {
diff --git a/src/librustc_metadata/cstore_impl.rs b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs
similarity index 99%
rename from src/librustc_metadata/cstore_impl.rs
rename to src/librustc_metadata/rmeta/decoder/cstore_impl.rs
index b01b99ffcfb09..6eacfc28de2db 100644
--- a/src/librustc_metadata/cstore_impl.rs
+++ b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs
@@ -1,9 +1,8 @@
 use crate::cstore::{self, LoadedMacro};
-use crate::encoder;
 use crate::link_args;
 use crate::native_libs;
 use crate::foreign_modules;
-use crate::schema;
+use crate::rmeta::{self, encoder};
 
 use rustc::ty::query::QueryConfig;
 use rustc::middle::cstore::{CrateSource, CrateStore, DepKind, EncodedMetadata, NativeLibraryKind};
@@ -529,6 +528,6 @@ impl CrateStore for cstore::CStore {
 
     fn metadata_encoding_version(&self) -> &[u8]
     {
-        schema::METADATA_HEADER
+        rmeta::METADATA_HEADER
     }
 }
diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs
similarity index 99%
rename from src/librustc_metadata/encoder.rs
rename to src/librustc_metadata/rmeta/encoder.rs
index 618d342f6fe75..afc81649e3719 100644
--- a/src/librustc_metadata/encoder.rs
+++ b/src/librustc_metadata/rmeta/encoder.rs
@@ -1,5 +1,5 @@
-use crate::schema::*;
-use crate::table::{FixedSizeEncoding, PerDefTable};
+use crate::rmeta::*;
+use crate::rmeta::table::{FixedSizeEncoding, PerDefTable};
 
 use rustc::middle::cstore::{LinkagePreference, NativeLibrary,
                             EncodedMetadata, ForeignModule};
@@ -1781,7 +1781,7 @@ impl<'tcx, 'v> ItemLikeVisitor<'v> for ImplVisitor<'tcx> {
 // will allow us to slice the metadata to the precise length that we just
 // generated regardless of trailing bytes that end up in it.
 
-crate fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
+pub(super) fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
     let mut encoder = opaque::Encoder::new(vec![]);
     encoder.emit_raw_bytes(METADATA_HEADER);
 
diff --git a/src/librustc_metadata/schema.rs b/src/librustc_metadata/rmeta/mod.rs
similarity index 72%
rename from src/librustc_metadata/schema.rs
rename to src/librustc_metadata/rmeta/mod.rs
index f644b7264320b..4eabeac6d9869 100644
--- a/src/librustc_metadata/schema.rs
+++ b/src/librustc_metadata/rmeta/mod.rs
@@ -1,4 +1,5 @@
-use crate::table::PerDefTable;
+use decoder::Metadata;
+use table::PerDefTable;
 
 use rustc::hir;
 use rustc::hir::def::{self, CtorKind};
@@ -13,7 +14,6 @@ use rustc::ty::{self, Ty, ReprOptions};
 use rustc_target::spec::{PanicStrategy, TargetTriple};
 use rustc_index::vec::IndexVec;
 use rustc_data_structures::svh::Svh;
-
 use rustc_serialize::Encodable;
 use syntax::{ast, attr};
 use syntax::edition::Edition;
@@ -23,6 +23,12 @@ use syntax_pos::{self, Span};
 use std::marker::PhantomData;
 use std::num::NonZeroUsize;
 
+pub use decoder::{provide, provide_extern};
+
+mod decoder;
+mod encoder;
+mod table;
+
 crate fn rustc_version() -> String {
     format!("rustc {}",
             option_env!("CFG_VERSION").unwrap_or("unknown version"))
@@ -104,13 +110,13 @@ crate struct Lazy<T, Meta = <T as LazyMeta>::Meta>
     where T: ?Sized + LazyMeta<Meta = Meta>,
           Meta: 'static + Copy,
 {
-    pub position: NonZeroUsize,
-    pub meta: Meta,
+    position: NonZeroUsize,
+    meta: Meta,
     _marker: PhantomData<T>,
 }
 
 impl<T: ?Sized + LazyMeta> Lazy<T> {
-     crate fn from_position_and_meta(position: NonZeroUsize, meta: T::Meta) -> Lazy<T> {
+     fn from_position_and_meta(position: NonZeroUsize, meta: T::Meta) -> Lazy<T> {
         Lazy {
             position,
             meta,
@@ -120,13 +126,13 @@ impl<T: ?Sized + LazyMeta> Lazy<T> {
 }
 
 impl<T: Encodable> Lazy<T> {
-    crate fn from_position(position: NonZeroUsize) -> Lazy<T> {
+    fn from_position(position: NonZeroUsize) -> Lazy<T> {
         Lazy::from_position_and_meta(position, ())
     }
 }
 
 impl<T: Encodable> Lazy<[T]> {
-    crate fn empty() -> Lazy<[T]> {
+    fn empty() -> Lazy<[T]> {
         Lazy::from_position_and_meta(NonZeroUsize::new(1).unwrap(), 0)
     }
 }
@@ -143,7 +149,7 @@ impl<T: ?Sized + LazyMeta> rustc_serialize::UseSpecializedDecodable for Lazy<T>
 
 /// Encoding / decoding state for `Lazy`.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
-crate enum LazyState {
+enum LazyState {
     /// Outside of a metadata node.
     NoNode,
 
@@ -171,46 +177,46 @@ macro_rules! Lazy {
 crate struct CrateRoot<'tcx> {
     pub name: Symbol,
     pub triple: TargetTriple,
-    pub extra_filename: String,
+    extra_filename: String,
     pub hash: Svh,
     pub disambiguator: CrateDisambiguator,
     pub panic_strategy: PanicStrategy,
-    pub edition: Edition,
+    edition: Edition,
     pub has_global_allocator: bool,
-    pub has_panic_handler: bool,
+    has_panic_handler: bool,
     pub has_default_lib_allocator: bool,
-    pub plugin_registrar_fn: Option<DefIndex>,
-    pub proc_macro_decls_static: Option<DefIndex>,
-    pub proc_macro_stability: Option<attr::Stability>,
+    plugin_registrar_fn: Option<DefIndex>,
+    proc_macro_decls_static: Option<DefIndex>,
+    proc_macro_stability: Option<attr::Stability>,
 
     pub crate_deps: Lazy<[CrateDep]>,
-    pub dylib_dependency_formats: Lazy<[Option<LinkagePreference>]>,
-    pub lib_features: Lazy<[(Symbol, Option<Symbol>)]>,
-    pub lang_items: Lazy<[(DefIndex, usize)]>,
-    pub lang_items_missing: Lazy<[lang_items::LangItem]>,
-    pub diagnostic_items: Lazy<[(Symbol, DefIndex)]>,
-    pub native_libraries: Lazy<[NativeLibrary]>,
-    pub foreign_modules: Lazy<[ForeignModule]>,
-    pub source_map: Lazy<[syntax_pos::SourceFile]>,
+    dylib_dependency_formats: Lazy<[Option<LinkagePreference>]>,
+    lib_features: Lazy<[(Symbol, Option<Symbol>)]>,
+    lang_items: Lazy<[(DefIndex, usize)]>,
+    lang_items_missing: Lazy<[lang_items::LangItem]>,
+    diagnostic_items: Lazy<[(Symbol, DefIndex)]>,
+    native_libraries: Lazy<[NativeLibrary]>,
+    foreign_modules: Lazy<[ForeignModule]>,
+    source_map: Lazy<[syntax_pos::SourceFile]>,
     pub def_path_table: Lazy<hir::map::definitions::DefPathTable>,
     pub impls: Lazy<[TraitImpls]>,
-    pub exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
+    exported_symbols: Lazy!([(ExportedSymbol<'tcx>, SymbolExportLevel)]),
     pub interpret_alloc_index: Lazy<[u32]>,
 
-    pub per_def: LazyPerDefTables<'tcx>,
+    per_def: LazyPerDefTables<'tcx>,
 
     /// The DefIndex's of any proc macros delcared by
     /// this crate
     pub proc_macro_data: Option<Lazy<[DefIndex]>>,
 
-    pub compiler_builtins: bool,
+    compiler_builtins: bool,
     pub needs_allocator: bool,
     pub needs_panic_runtime: bool,
-    pub no_builtins: bool,
+    no_builtins: bool,
     pub panic_runtime: bool,
     pub profiler_runtime: bool,
     pub sanitizer_runtime: bool,
-    pub symbol_mangling_version: SymbolManglingVersion,
+    symbol_mangling_version: SymbolManglingVersion,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
@@ -230,35 +236,33 @@ crate struct TraitImpls {
 
 #[derive(RustcEncodable, RustcDecodable)]
 crate struct LazyPerDefTables<'tcx> {
-    pub kind: Lazy!(PerDefTable<Lazy!(EntryKind<'tcx>)>),
-    pub visibility: Lazy!(PerDefTable<Lazy<ty::Visibility>>),
-    pub span: Lazy!(PerDefTable<Lazy<Span>>),
-    pub attributes: Lazy!(PerDefTable<Lazy<[ast::Attribute]>>),
-    pub children: Lazy!(PerDefTable<Lazy<[DefIndex]>>),
-    pub stability: Lazy!(PerDefTable<Lazy<attr::Stability>>),
-    pub deprecation: Lazy!(PerDefTable<Lazy<attr::Deprecation>>),
-
-    pub ty: Lazy!(PerDefTable<Lazy!(Ty<'tcx>)>),
-    pub fn_sig: Lazy!(PerDefTable<Lazy!(ty::PolyFnSig<'tcx>)>),
-    pub impl_trait_ref: Lazy!(PerDefTable<Lazy!(ty::TraitRef<'tcx>)>),
-    pub inherent_impls: Lazy!(PerDefTable<Lazy<[DefIndex]>>),
-    pub variances: Lazy!(PerDefTable<Lazy<[ty::Variance]>>),
-    pub generics: Lazy!(PerDefTable<Lazy<ty::Generics>>),
-    pub explicit_predicates: Lazy!(PerDefTable<Lazy!(ty::GenericPredicates<'tcx>)>),
+    kind: Lazy!(PerDefTable<Lazy!(EntryKind<'tcx>)>),
+    visibility: Lazy!(PerDefTable<Lazy<ty::Visibility>>),
+    span: Lazy!(PerDefTable<Lazy<Span>>),
+    attributes: Lazy!(PerDefTable<Lazy<[ast::Attribute]>>),
+    children: Lazy!(PerDefTable<Lazy<[DefIndex]>>),
+    stability: Lazy!(PerDefTable<Lazy<attr::Stability>>),
+    deprecation: Lazy!(PerDefTable<Lazy<attr::Deprecation>>),
+    ty: Lazy!(PerDefTable<Lazy!(Ty<'tcx>)>),
+    fn_sig: Lazy!(PerDefTable<Lazy!(ty::PolyFnSig<'tcx>)>),
+    impl_trait_ref: Lazy!(PerDefTable<Lazy!(ty::TraitRef<'tcx>)>),
+    inherent_impls: Lazy!(PerDefTable<Lazy<[DefIndex]>>),
+    variances: Lazy!(PerDefTable<Lazy<[ty::Variance]>>),
+    generics: Lazy!(PerDefTable<Lazy<ty::Generics>>),
+    explicit_predicates: Lazy!(PerDefTable<Lazy!(ty::GenericPredicates<'tcx>)>),
     // FIXME(eddyb) this would ideally be `Lazy<[...]>` but `ty::Predicate`
     // doesn't handle shorthands in its own (de)serialization impls,
     // as it's an `enum` for which we want to derive (de)serialization,
     // so the `ty::codec` APIs handle the whole `&'tcx [...]` at once.
     // Also, as an optimization, a missing entry indicates an empty `&[]`.
-    pub inferred_outlives: Lazy!(PerDefTable<Lazy!(&'tcx [(ty::Predicate<'tcx>, Span)])>),
-    pub super_predicates: Lazy!(PerDefTable<Lazy!(ty::GenericPredicates<'tcx>)>),
-
-    pub mir: Lazy!(PerDefTable<Lazy!(mir::Body<'tcx>)>),
-    pub promoted_mir: Lazy!(PerDefTable<Lazy!(IndexVec<mir::Promoted, mir::Body<'tcx>>)>),
+    inferred_outlives: Lazy!(PerDefTable<Lazy!(&'tcx [(ty::Predicate<'tcx>, Span)])>),
+    super_predicates: Lazy!(PerDefTable<Lazy!(ty::GenericPredicates<'tcx>)>),
+    mir: Lazy!(PerDefTable<Lazy!(mir::Body<'tcx>)>),
+    promoted_mir: Lazy!(PerDefTable<Lazy!(IndexVec<mir::Promoted, mir::Body<'tcx>>)>),
 }
 
 #[derive(Copy, Clone, RustcEncodable, RustcDecodable)]
-crate enum EntryKind<'tcx> {
+enum EntryKind<'tcx> {
     Const(ConstQualif, Lazy<RenderedConst>),
     ImmStatic,
     MutStatic,
@@ -293,58 +297,58 @@ crate enum EntryKind<'tcx> {
 
 /// Additional data for EntryKind::Const and EntryKind::AssocConst
 #[derive(Clone, Copy, RustcEncodable, RustcDecodable)]
-crate struct ConstQualif {
-    pub mir: u8,
+struct ConstQualif {
+    mir: u8,
 }
 
 /// Contains a constant which has been rendered to a String.
 /// Used by rustdoc.
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct RenderedConst(pub String);
+struct RenderedConst(String);
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct ModData {
-    pub reexports: Lazy<[def::Export<hir::HirId>]>,
+struct ModData {
+    reexports: Lazy<[def::Export<hir::HirId>]>,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct MacroDef {
-    pub body: String,
-    pub legacy: bool,
+struct MacroDef {
+    body: String,
+    legacy: bool,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct FnData {
-    pub asyncness: hir::IsAsync,
-    pub constness: hir::Constness,
-    pub param_names: Lazy<[ast::Name]>,
+struct FnData {
+    asyncness: hir::IsAsync,
+    constness: hir::Constness,
+    param_names: Lazy<[ast::Name]>,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct VariantData {
-    pub ctor_kind: CtorKind,
-    pub discr: ty::VariantDiscr,
+struct VariantData {
+    ctor_kind: CtorKind,
+    discr: ty::VariantDiscr,
     /// If this is unit or tuple-variant/struct, then this is the index of the ctor id.
-    pub ctor: Option<DefIndex>,
+    ctor: Option<DefIndex>,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct TraitData {
-    pub unsafety: hir::Unsafety,
-    pub paren_sugar: bool,
-    pub has_auto_impl: bool,
-    pub is_marker: bool,
+struct TraitData {
+    unsafety: hir::Unsafety,
+    paren_sugar: bool,
+    has_auto_impl: bool,
+    is_marker: bool,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct ImplData {
-    pub polarity: ty::ImplPolarity,
-    pub defaultness: hir::Defaultness,
-    pub parent_impl: Option<DefId>,
+struct ImplData {
+    polarity: ty::ImplPolarity,
+    defaultness: hir::Defaultness,
+    parent_impl: Option<DefId>,
 
     /// This is `Some` only for impls of `CoerceUnsized`.
     // FIXME(eddyb) perhaps compute this on the fly if cheap enough?
-    pub coerce_unsized_info: Option<ty::adjustment::CoerceUnsizedInfo>,
+    coerce_unsized_info: Option<ty::adjustment::CoerceUnsizedInfo>,
 }
 
 
@@ -352,7 +356,7 @@ crate struct ImplData {
 /// is a trait or an impl and whether, in a trait, it has
 /// a default, or an in impl, whether it's marked "default".
 #[derive(Copy, Clone, RustcEncodable, RustcDecodable)]
-crate enum AssocContainer {
+enum AssocContainer {
     TraitRequired,
     TraitWithDefault,
     ImplDefault,
@@ -360,7 +364,7 @@ crate enum AssocContainer {
 }
 
 impl AssocContainer {
-    crate fn with_def_id(&self, def_id: DefId) -> ty::AssocItemContainer {
+    fn with_def_id(&self, def_id: DefId) -> ty::AssocItemContainer {
         match *self {
             AssocContainer::TraitRequired |
             AssocContainer::TraitWithDefault => ty::TraitContainer(def_id),
@@ -370,7 +374,7 @@ impl AssocContainer {
         }
     }
 
-    crate fn defaultness(&self) -> hir::Defaultness {
+    fn defaultness(&self) -> hir::Defaultness {
         match *self {
             AssocContainer::TraitRequired => hir::Defaultness::Default {
                 has_value: false,
@@ -387,17 +391,17 @@ impl AssocContainer {
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct MethodData {
-    pub fn_data: FnData,
-    pub container: AssocContainer,
-    pub has_self: bool,
+struct MethodData {
+    fn_data: FnData,
+    container: AssocContainer,
+    has_self: bool,
 }
 
 #[derive(RustcEncodable, RustcDecodable)]
-crate struct GeneratorData<'tcx> {
-    pub layout: mir::GeneratorLayout<'tcx>,
+struct GeneratorData<'tcx> {
+    layout: mir::GeneratorLayout<'tcx>,
 }
 
 // Tags used for encoding Spans:
-crate const TAG_VALID_SPAN: u8 = 0;
-crate const TAG_INVALID_SPAN: u8 = 1;
+const TAG_VALID_SPAN: u8 = 0;
+const TAG_INVALID_SPAN: u8 = 1;
diff --git a/src/librustc_metadata/table.rs b/src/librustc_metadata/rmeta/table.rs
similarity index 93%
rename from src/librustc_metadata/table.rs
rename to src/librustc_metadata/rmeta/table.rs
index e164c28c953bc..613d92c6d7b0b 100644
--- a/src/librustc_metadata/table.rs
+++ b/src/librustc_metadata/rmeta/table.rs
@@ -1,5 +1,4 @@
-use crate::decoder::Metadata;
-use crate::schema::*;
+use crate::rmeta::*;
 
 use rustc::hir::def_id::{DefId, DefIndex};
 use rustc_serialize::{Encodable, opaque::Encoder};
@@ -12,7 +11,7 @@ use log::debug;
 /// Used mainly for Lazy positions and lengths.
 /// Unchecked invariant: `Self::default()` should encode as `[0; BYTE_LEN]`,
 /// but this has no impact on safety.
-crate trait FixedSizeEncoding: Default {
+pub(super) trait FixedSizeEncoding: Default {
     const BYTE_LEN: usize;
 
     // FIXME(eddyb) convert to and from `[u8; Self::BYTE_LEN]` instead,
@@ -126,7 +125,7 @@ impl<T: Encodable> FixedSizeEncoding for Option<Lazy<[T]>> {
 // FIXME(eddyb) replace `Vec` with `[_]` here, such that `Box<Table<T>>` would be used
 // when building it, and `Lazy<Table<T>>` or `&Table<T>` when reading it.
 // (not sure if that is possible given that the `Vec` is being resized now)
-crate struct Table<T> where Option<T>: FixedSizeEncoding {
+pub(super) struct Table<T> where Option<T>: FixedSizeEncoding {
     // FIXME(eddyb) store `[u8; <Option<T>>::BYTE_LEN]` instead of `u8` in `Vec`,
     // once that starts being allowed by the compiler (i.e. lazy normalization).
     bytes: Vec<u8>,
@@ -143,7 +142,7 @@ impl<T> Default for Table<T> where Option<T>: FixedSizeEncoding {
 }
 
 impl<T> Table<T> where Option<T>: FixedSizeEncoding {
-    crate fn set(&mut self, i: usize, value: T) {
+    fn set(&mut self, i: usize, value: T) {
         // FIXME(eddyb) investigate more compact encodings for sparse tables.
         // On the PR @michaelwoerister mentioned:
         // > Space requirements could perhaps be optimized by using the HAMT `popcnt`
@@ -157,7 +156,7 @@ impl<T> Table<T> where Option<T>: FixedSizeEncoding {
         Some(value).write_to_bytes_at(&mut self.bytes, i);
     }
 
-    crate fn encode(&self, buf: &mut Encoder) -> Lazy<Self> {
+    fn encode(&self, buf: &mut Encoder) -> Lazy<Self> {
         let pos = buf.position();
         buf.emit_raw_bytes(&self.bytes);
         Lazy::from_position_and_meta(
@@ -178,7 +177,7 @@ impl<T> LazyMeta for Table<T> where Option<T>: FixedSizeEncoding {
 impl<T> Lazy<Table<T>> where Option<T>: FixedSizeEncoding {
     /// Given the metadata, extract out the value at a particular index (if any).
     #[inline(never)]
-    crate fn get<'a, 'tcx, M: Metadata<'a, 'tcx>>(
+    fn get<'a, 'tcx, M: Metadata<'a, 'tcx>>(
         &self,
         metadata: M,
         i: usize,
@@ -194,7 +193,7 @@ impl<T> Lazy<Table<T>> where Option<T>: FixedSizeEncoding {
 /// Like a `Table` but using `DefIndex` instead of `usize` as keys.
 // FIXME(eddyb) replace by making `Table` behave like `IndexVec`,
 // and by using `newtype_index!` to define `DefIndex`.
-crate struct PerDefTable<T>(Table<T>) where Option<T>: FixedSizeEncoding;
+pub(super) struct PerDefTable<T>(Table<T>) where Option<T>: FixedSizeEncoding;
 
 impl<T> Default for PerDefTable<T> where Option<T>: FixedSizeEncoding {
     fn default() -> Self {
@@ -203,12 +202,12 @@ impl<T> Default for PerDefTable<T> where Option<T>: FixedSizeEncoding {
 }
 
 impl<T> PerDefTable<T> where Option<T>: FixedSizeEncoding {
-    crate fn set(&mut self, def_id: DefId, value: T) {
+    pub(super) fn set(&mut self, def_id: DefId, value: T) {
         assert!(def_id.is_local());
         self.0.set(def_id.index.index(), value);
     }
 
-    crate fn encode(&self, buf: &mut Encoder) -> Lazy<Self> {
+    pub(super) fn encode(&self, buf: &mut Encoder) -> Lazy<Self> {
         let lazy = self.0.encode(buf);
         Lazy::from_position_and_meta(lazy.position, lazy.meta)
     }
@@ -229,7 +228,7 @@ impl<T> Lazy<PerDefTable<T>> where Option<T>: FixedSizeEncoding {
 
     /// Given the metadata, extract out the value at a particular DefIndex (if any).
     #[inline(never)]
-    crate fn get<'a, 'tcx, M: Metadata<'a, 'tcx>>(
+    pub(super) fn get<'a, 'tcx, M: Metadata<'a, 'tcx>>(
         &self,
         metadata: M,
         def_index: DefIndex,