Skip to content

Commit 92413c9

Browse files
committed
Move Library into creader.rs.
1 parent 0e99b83 commit 92413c9

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/librustc_metadata/creader.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ use syntax::parse::token::InternedString;
4040
use syntax_pos::{self, Span, mk_sp};
4141
use log;
4242

43+
pub struct Library {
44+
pub dylib: Option<(PathBuf, PathKind)>,
45+
pub rlib: Option<(PathBuf, PathKind)>,
46+
pub metadata: MetadataBlob,
47+
}
48+
4349
pub struct CrateLoader<'a> {
4450
pub sess: &'a Session,
4551
cstore: &'a CStore,
@@ -123,7 +129,7 @@ struct ExtensionCrate {
123129

124130
enum PMDSource {
125131
Registered(Rc<cstore::CrateMetadata>),
126-
Owned(loader::Library),
132+
Owned(Library),
127133
}
128134

129135
impl Deref for PMDSource {
@@ -139,7 +145,7 @@ impl Deref for PMDSource {
139145

140146
enum LoadResult {
141147
Previous(CrateNum),
142-
Loaded(loader::Library),
148+
Loaded(Library),
143149
}
144150

145151
pub struct Macros {
@@ -275,7 +281,7 @@ impl<'a> CrateLoader<'a> {
275281
ident: &str,
276282
name: &str,
277283
span: Span,
278-
lib: loader::Library,
284+
lib: Library,
279285
explicitly_linked: bool)
280286
-> (CrateNum, Rc<cstore::CrateMetadata>,
281287
cstore::CrateSource) {
@@ -300,7 +306,7 @@ impl<'a> CrateLoader<'a> {
300306
// Maintain a reference to the top most crate.
301307
let root = if root.is_some() { root } else { &crate_paths };
302308

303-
let loader::Library { dylib, rlib, metadata } = lib;
309+
let Library { dylib, rlib, metadata } = lib;
304310

305311
let cnum_map = self.resolve_crate_deps(root, &crate_root, &metadata, cnum, span);
306312

src/librustc_metadata/loader.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@
213213
//! metadata::loader or metadata::creader for all the juicy details!
214214
215215
use cstore::MetadataBlob;
216+
use creader::Library;
216217
use schema::{METADATA_HEADER, rustc_version};
217218

218219
use rustc::hir::svh::Svh;
@@ -263,12 +264,6 @@ pub struct Context<'a> {
263264
pub should_match_name: bool,
264265
}
265266

266-
pub struct Library {
267-
pub dylib: Option<(PathBuf, PathKind)>,
268-
pub rlib: Option<(PathBuf, PathKind)>,
269-
pub metadata: MetadataBlob,
270-
}
271-
272267
pub struct ArchiveMetadata {
273268
_archive: ArchiveRO,
274269
// points into self._archive

0 commit comments

Comments
 (0)