rustc_metadata: Give a constructor to `CratePaths`

This commit is contained in:
Vadim Petrochenkov 2019-11-17 16:13:46 +03:00
parent 0aed810abf
commit 41ee980f9f
2 changed files with 9 additions and 3 deletions

View File

@ -207,7 +207,7 @@ impl<'a> CrateLoader<'a> {
let root = if let Some(root) = root {
root
} else {
crate_paths = CratePaths { name: crate_root.name, source: source.clone() };
crate_paths = CratePaths::new(crate_root.name, source.clone());
&crate_paths
};

View File

@ -281,8 +281,14 @@ crate struct CrateLocator<'a> {
}
crate struct CratePaths {
pub name: Symbol,
pub source: CrateSource,
name: Symbol,
source: CrateSource,
}
impl CratePaths {
crate fn new(name: Symbol, source: CrateSource) -> CratePaths {
CratePaths { name, source }
}
}
#[derive(Copy, Clone, PartialEq)]