Skip to content

Commit 2b75147

Browse files
committed
rustc_metadata: Privatize more entities
1 parent 166d5f8 commit 2b75147

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

src/librustc_metadata/schema.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use std::marker::PhantomData;
2424
use std::num::NonZeroUsize;
2525

2626
pub use decoder::{provide, provide_extern};
27-
crate use encoder::encode_metadata;
2827

2928
mod decoder;
3029
mod encoder;
@@ -178,16 +177,16 @@ macro_rules! Lazy {
178177
crate struct CrateRoot<'tcx> {
179178
pub name: Symbol,
180179
pub triple: TargetTriple,
181-
pub extra_filename: String,
180+
extra_filename: String,
182181
pub hash: Svh,
183182
pub disambiguator: CrateDisambiguator,
184183
pub panic_strategy: PanicStrategy,
185-
pub edition: Edition,
184+
edition: Edition,
186185
pub has_global_allocator: bool,
187-
pub has_panic_handler: bool,
186+
has_panic_handler: bool,
188187
pub has_default_lib_allocator: bool,
189-
pub plugin_registrar_fn: Option<DefIndex>,
190-
pub proc_macro_decls_static: Option<DefIndex>,
188+
plugin_registrar_fn: Option<DefIndex>,
189+
proc_macro_decls_static: Option<DefIndex>,
191190
proc_macro_stability: Option<attr::Stability>,
192191

193192
pub crate_deps: Lazy<[CrateDep]>,
@@ -210,14 +209,14 @@ crate struct CrateRoot<'tcx> {
210209
/// this crate
211210
pub proc_macro_data: Option<Lazy<[DefIndex]>>,
212211

213-
pub compiler_builtins: bool,
212+
compiler_builtins: bool,
214213
pub needs_allocator: bool,
215214
pub needs_panic_runtime: bool,
216-
pub no_builtins: bool,
215+
no_builtins: bool,
217216
pub panic_runtime: bool,
218217
pub profiler_runtime: bool,
219218
pub sanitizer_runtime: bool,
220-
pub symbol_mangling_version: SymbolManglingVersion,
219+
symbol_mangling_version: SymbolManglingVersion,
221220
}
222221

223222
#[derive(RustcEncodable, RustcDecodable)]
@@ -313,9 +312,9 @@ struct ModData {
313312
}
314313

315314
#[derive(RustcEncodable, RustcDecodable)]
316-
crate struct MacroDef {
317-
pub body: String,
318-
pub legacy: bool,
315+
struct MacroDef {
316+
body: String,
317+
legacy: bool,
319318
}
320319

321320
#[derive(RustcEncodable, RustcDecodable)]

src/librustc_metadata/schema/decoder/cstore_impl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::cstore::{self, LoadedMacro};
22
use crate::link_args;
33
use crate::native_libs;
44
use crate::foreign_modules;
5-
use crate::schema;
5+
use crate::schema::{self, encoder};
66

77
use rustc::ty::query::QueryConfig;
88
use rustc::middle::cstore::{CrateSource, CrateStore, DepKind, EncodedMetadata, NativeLibraryKind};
@@ -523,7 +523,7 @@ impl CrateStore for cstore::CStore {
523523
}
524524

525525
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata {
526-
schema::encode_metadata(tcx)
526+
encoder::encode_metadata(tcx)
527527
}
528528

529529
fn metadata_encoding_version(&self) -> &[u8]

src/librustc_metadata/schema/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ impl<'tcx, 'v> ItemLikeVisitor<'v> for ImplVisitor<'tcx> {
17811781
// will allow us to slice the metadata to the precise length that we just
17821782
// generated regardless of trailing bytes that end up in it.
17831783

1784-
crate fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
1784+
pub(super) fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
17851785
let mut encoder = opaque::Encoder::new(vec![]);
17861786
encoder.emit_raw_bytes(METADATA_HEADER);
17871787

0 commit comments

Comments
 (0)