Skip to content

Commit b3f850a

Browse files
committed
Remove root field from CrateLocator
1 parent 3a8c457 commit b3f850a

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

compiler/rustc_metadata/src/creader.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ impl<'a> CrateLoader<'a> {
555555
extra_filename,
556556
false, // is_host
557557
path_kind,
558-
root,
559558
);
560559

561560
match self.load(&mut locator)? {
@@ -564,7 +563,7 @@ impl<'a> CrateLoader<'a> {
564563
dep_kind = CrateDepKind::MacrosOnly;
565564
match self.load_proc_macro(&mut locator, path_kind, host_hash)? {
566565
Some(res) => res,
567-
None => return Err(locator.into_error()),
566+
None => return Err(locator.into_error(root.cloned())),
568567
}
569568
}
570569
}

compiler/rustc_metadata/src/locator.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ crate struct CrateLocator<'a> {
252252
pub target: &'a Target,
253253
pub triple: TargetTriple,
254254
pub filesearch: FileSearch<'a>,
255-
root: Option<&'a CratePaths>,
256255
pub is_proc_macro: bool,
257256

258257
// Mutable in-progress state or output.
@@ -301,7 +300,6 @@ impl<'a> CrateLocator<'a> {
301300
extra_filename: Option<&'a str>,
302301
is_host: bool,
303302
path_kind: PathKind,
304-
root: Option<&'a CratePaths>,
305303
) -> CrateLocator<'a> {
306304
// The all loop is because `--crate-type=rlib --crate-type=rlib` is
307305
// legal and produces both inside this type.
@@ -344,7 +342,6 @@ impl<'a> CrateLocator<'a> {
344342
} else {
345343
sess.target_filesearch(path_kind)
346344
},
347-
root,
348345
is_proc_macro: false,
349346
rejected_via_hash: Vec::new(),
350347
rejected_via_triple: Vec::new(),
@@ -709,10 +706,10 @@ impl<'a> CrateLocator<'a> {
709706
Ok(self.extract_lib(rlibs, rmetas, dylibs)?.map(|(_, lib)| lib))
710707
}
711708

712-
crate fn into_error(self) -> CrateError {
709+
crate fn into_error(self, root: Option<CratePaths>) -> CrateError {
713710
CrateError::LocatorCombined(CombinedLocatorError {
714711
crate_name: self.crate_name,
715-
root: self.root.cloned(),
712+
root,
716713
triple: self.triple,
717714
dll_prefix: self.target.dll_prefix.clone(),
718715
dll_suffix: self.target.dll_suffix.clone(),
@@ -807,15 +804,14 @@ fn find_plugin_registrar_impl<'a>(
807804
None, // extra_filename
808805
true, // is_host
809806
PathKind::Crate,
810-
None, // root
811807
);
812808

813809
match locator.maybe_load_library_crate()? {
814810
Some(library) => match library.source.dylib {
815811
Some(dylib) => Ok(dylib.0),
816812
None => Err(CrateError::NonDylibPlugin(name)),
817813
},
818-
None => Err(locator.into_error()),
814+
None => Err(locator.into_error(None)),
819815
}
820816
}
821817

0 commit comments

Comments
 (0)