Skip to content

Commit

Permalink
Remove host_hash from CrateLocator
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Sep 2, 2021
1 parent a3ada4e commit 3a8c457
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ impl<'a> CrateLoader<'a> {
&self,
locator: &mut CrateLocator<'b>,
path_kind: PathKind,
host_hash: Option<Svh>,
) -> Result<Option<(LoadResult, Option<Library>)>, CrateError>
where
'a: 'b,
Expand All @@ -471,7 +472,7 @@ impl<'a> CrateLoader<'a> {
Some(LoadResult::Loaded(library)) => Some(LoadResult::Loaded(library)),
None => return Ok(None),
};
locator.hash = locator.host_hash;
locator.hash = host_hash;
// Use the locator when looking for the host proc macro crate, as that is required
// so we want it to affect the error message
(locator, result)
Expand Down Expand Up @@ -551,7 +552,6 @@ impl<'a> CrateLoader<'a> {
&*self.metadata_loader,
name,
hash,
host_hash,
extra_filename,
false, // is_host
path_kind,
Expand All @@ -562,7 +562,7 @@ impl<'a> CrateLoader<'a> {
Some(res) => (res, None),
None => {
dep_kind = CrateDepKind::MacrosOnly;
match self.load_proc_macro(&mut locator, path_kind)? {
match self.load_proc_macro(&mut locator, path_kind, host_hash)? {
Some(res) => res,
None => return Err(locator.into_error()),
}
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_metadata/src/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ crate struct CrateLocator<'a> {
crate_name: Symbol,
exact_paths: Vec<CanonicalizedPath>,
pub hash: Option<Svh>,
pub host_hash: Option<Svh>,
extra_filename: Option<&'a str>,
pub target: &'a Target,
pub triple: TargetTriple,
Expand Down Expand Up @@ -299,7 +298,6 @@ impl<'a> CrateLocator<'a> {
metadata_loader: &'a dyn MetadataLoader,
crate_name: Symbol,
hash: Option<Svh>,
host_hash: Option<Svh>,
extra_filename: Option<&'a str>,
is_host: bool,
path_kind: PathKind,
Expand Down Expand Up @@ -334,7 +332,6 @@ impl<'a> CrateLocator<'a> {
Vec::new()
},
hash,
host_hash,
extra_filename,
target: if is_host { &sess.host } else { &sess.target },
triple: if is_host {
Expand Down Expand Up @@ -807,7 +804,6 @@ fn find_plugin_registrar_impl<'a>(
metadata_loader,
name,
None, // hash
None, // host_hash
None, // extra_filename
true, // is_host
PathKind::Crate,
Expand Down

0 comments on commit 3a8c457

Please sign in to comment.