Skip to content

rustc_metadata: Some reorganization of the module structure #66056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_metadata/cstore.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
6 changes: 1 addition & 5 deletions src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading