mirror of
https://github.com/openharmony/third_party_rust_rust.git
synced 2026-07-19 11:43:39 -04:00
Adjust dependency-resolution errors to be more consistent
This commit is contained in:
@@ -161,7 +161,8 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
if tcx.dep_kind(cnum).macros_only() { continue }
|
||||
let src = tcx.used_crate_source(cnum);
|
||||
if src.rlib.is_some() { continue }
|
||||
sess.err(&format!("dependency `{}` not found in rlib format",
|
||||
sess.err(&format!("crate `{}` required to be available in rlib format, \
|
||||
but was not found in this form",
|
||||
tcx.crate_name(cnum)));
|
||||
}
|
||||
return Vec::new();
|
||||
@@ -244,10 +245,9 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
Linkage::Static => "rlib",
|
||||
_ => "dylib",
|
||||
};
|
||||
let name = tcx.crate_name(cnum);
|
||||
sess.err(&format!("crate `{}` required to be available in {}, \
|
||||
but it was not available in this form",
|
||||
name, kind));
|
||||
sess.err(&format!("crate `{}` required to be available in {} format, \
|
||||
but was not found in this form",
|
||||
tcx.crate_name(cnum), kind));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern: dependency `cdylib_dep` not found in rlib format
|
||||
// error-pattern: crate `cdylib_dep` required to be available in rlib format, but was not found
|
||||
// aux-build:cdylib-dep.rs
|
||||
// ignore-musl
|
||||
// ignore-emscripten
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// aux-build:rmeta_meta.rs
|
||||
// no-prefer-dynamic
|
||||
// error-pattern: crate `rmeta_meta` required to be available in rlib, but it was not available
|
||||
// error-pattern: crate `rmeta_meta` required to be available in rlib format, but was not found
|
||||
|
||||
// Check that building a non-metadata crate fails if a dependent crate is
|
||||
// metadata-only.
|
||||
|
||||
Reference in New Issue
Block a user