mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
ignore compiler injected crate loading failure
This commit is contained in:
@@ -731,7 +731,11 @@ fn resolve_crate<'tcx>(
|
||||
}
|
||||
Err(err) => {
|
||||
debug!("failed to resolve crate {} {:?}", name, dep_kind);
|
||||
if !tcx.sess.dcx().has_errors().is_some() {
|
||||
// crate maybe injrected with `standard_library_imports::inject`, their span is dummy.
|
||||
// we ignore compiler-injected prelude/sysroot loads here so they don't suppress
|
||||
// unrelated diagnostics, such as `unsupported targets for std library` etc,
|
||||
// these maybe helpful for users to resolve crate loading failure.
|
||||
if !tcx.sess.dcx().has_errors().is_some() && !span.is_dummy() {
|
||||
self.has_crate_resolve_with_fail = true;
|
||||
}
|
||||
let missing_core = self
|
||||
|
||||
@@ -5,3 +5,6 @@
|
||||
//@ ignore-emscripten missing eh_catch_typeinfo lang item
|
||||
|
||||
fn main() {}
|
||||
|
||||
//~? ERROR `#[panic_handler]` function required, but not found
|
||||
//~? ERROR unwinding panics are not supported without std
|
||||
|
||||
@@ -2,5 +2,12 @@ error: extern location for std does not exist:
|
||||
|
||||
error: cannot resolve a prelude import
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
error: `#[panic_handler]` function required, but not found
|
||||
|
||||
error: unwinding panics are not supported without std
|
||||
|
|
||||
= help: using nightly cargo, use -Zbuild-std with panic="abort" to avoid unwinding
|
||||
= note: since the core library is usually precompiled with panic="unwind", rebuilding your crate with panic="abort" may not be enough to fix the problem
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user