Remove host_hash from CrateLocator

This commit is contained in:
bjorn3 2021-08-31 15:22:21 +02:00
parent a3ada4e68a
commit 3a8c457916
2 changed files with 3 additions and 7 deletions

View file

@ -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,
@ -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)
@ -551,7 +552,6 @@ impl<'a> CrateLoader<'a> {
&*self.metadata_loader,
name,
hash,
host_hash,
extra_filename,
false, // is_host
path_kind,
@ -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()),
}

View file

@ -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,
@ -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,
@ -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 {
@ -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,