X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_metadata%2Fsrc%2Flocator.rs;h=8570bf30f80787a7c2ac8bb0a3c13207438c8d40;hb=a81f55fb161a22e287220281d33542406a3a57f8;hp=b830c6b2481ccddecf055edee79b79f6658c4dfe;hpb=5ebc4d3697ee12a1484ebc28d0e18d69834b7154;p=rust.git diff --git a/compiler/rustc_metadata/src/locator.rs b/compiler/rustc_metadata/src/locator.rs index b830c6b2481..8570bf30f80 100644 --- a/compiler/rustc_metadata/src/locator.rs +++ b/compiler/rustc_metadata/src/locator.rs @@ -226,7 +226,7 @@ use rustc_session::filesearch::{FileDoesntMatch, FileMatches, FileSearch}; use rustc_session::search_paths::PathKind; use rustc_session::utils::CanonicalizedPath; -use rustc_session::{Session, StableCrateId}; +use rustc_session::{CrateDisambiguator, Session}; use rustc_span::symbol::{sym, Symbol}; use rustc_span::Span; use rustc_target::spec::{Target, TargetTriple}; @@ -787,7 +787,7 @@ pub fn find_plugin_registrar( metadata_loader: &dyn MetadataLoader, span: Span, name: Symbol, -) -> (PathBuf, StableCrateId) { +) -> (PathBuf, CrateDisambiguator) { match find_plugin_registrar_impl(sess, metadata_loader, name) { Ok(res) => res, // `core` is always available if we got as far as loading plugins. @@ -799,7 +799,7 @@ fn find_plugin_registrar_impl<'a>( sess: &'a Session, metadata_loader: &dyn MetadataLoader, name: Symbol, -) -> Result<(PathBuf, StableCrateId), CrateError> { +) -> Result<(PathBuf, CrateDisambiguator), CrateError> { info!("find plugin registrar `{}`", name); let mut locator = CrateLocator::new( sess, @@ -816,7 +816,7 @@ fn find_plugin_registrar_impl<'a>( match locator.maybe_load_library_crate()? { Some(library) => match library.source.dylib { - Some(dylib) => Ok((dylib.0, library.metadata.get_root().stable_crate_id())), + Some(dylib) => Ok((dylib.0, library.metadata.get_root().disambiguator())), None => Err(CrateError::NonDylibPlugin(name)), }, None => Err(locator.into_error()), @@ -1100,7 +1100,9 @@ impl CrateError { if sess.is_nightly_build() && std::env::var("CARGO").is_ok() { err.help("consider building the standard library from source with `cargo build -Zbuild-std`"); } - } else if crate_name == sym::profiler_builtins { + } else if Some(crate_name) + == sess.opts.debugging_opts.profiler_runtime.as_deref().map(Symbol::intern) + { err.note(&"the compiler may have been built without the profiler runtime"); } err.span_label(span, "can't find crate");