Skip to content
Merged
Prev Previous commit
Next Next commit
rustc_metadata: Give a constructor to CratePaths
  • Loading branch information
petrochenkov committed Nov 17, 2019
commit 41ee980f9f4f313359e1e8e6b4a3a16f0b493ef2
2 changes: 1 addition & 1 deletion src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
10 changes: 8 additions & 2 deletions src/librustc_metadata/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down