rustc_metadata: Privatize more entities
This commit is contained in:
parent
166d5f8b2f
commit
2b75147451
3 changed files with 14 additions and 15 deletions
|
@ -24,7 +24,6 @@ use std::marker::PhantomData;
|
|||
use std::num::NonZeroUsize;
|
||||
|
||||
pub use decoder::{provide, provide_extern};
|
||||
crate use encoder::encode_metadata;
|
||||
|
||||
mod decoder;
|
||||
mod encoder;
|
||||
|
@ -178,16 +177,16 @@ 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>,
|
||||
plugin_registrar_fn: Option<DefIndex>,
|
||||
proc_macro_decls_static: Option<DefIndex>,
|
||||
proc_macro_stability: Option<attr::Stability>,
|
||||
|
||||
pub crate_deps: Lazy<[CrateDep]>,
|
||||
|
@ -210,14 +209,14 @@ crate struct CrateRoot<'tcx> {
|
|||
/// 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)]
|
||||
|
@ -313,9 +312,9 @@ struct ModData {
|
|||
}
|
||||
|
||||
#[derive(RustcEncodable, RustcDecodable)]
|
||||
crate struct MacroDef {
|
||||
pub body: String,
|
||||
pub legacy: bool,
|
||||
struct MacroDef {
|
||||
body: String,
|
||||
legacy: bool,
|
||||
}
|
||||
|
||||
#[derive(RustcEncodable, RustcDecodable)]
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::cstore::{self, LoadedMacro};
|
|||
use crate::link_args;
|
||||
use crate::native_libs;
|
||||
use crate::foreign_modules;
|
||||
use crate::schema;
|
||||
use crate::schema::{self, encoder};
|
||||
|
||||
use rustc::ty::query::QueryConfig;
|
||||
use rustc::middle::cstore::{CrateSource, CrateStore, DepKind, EncodedMetadata, NativeLibraryKind};
|
||||
|
@ -523,7 +523,7 @@ impl CrateStore for cstore::CStore {
|
|||
}
|
||||
|
||||
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata {
|
||||
schema::encode_metadata(tcx)
|
||||
encoder::encode_metadata(tcx)
|
||||
}
|
||||
|
||||
fn metadata_encoding_version(&self) -> &[u8]
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue