This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-23
lines changed
compiler/rustc_metadata/src Expand file tree Collapse file tree 5 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -1077,7 +1077,7 @@ impl CrateError {
10771077 crate_rejections,
10781078 } ) ;
10791079 } else {
1080- dcx . emit_err ( errors:: CannotFindCrate {
1080+ let error = errors:: CannotFindCrate {
10811081 span,
10821082 crate_name,
10831083 add_info,
@@ -1091,11 +1091,18 @@ impl CrateError {
10911091 profiler_runtime : Symbol :: intern ( & sess. opts . unstable_opts . profiler_runtime ) ,
10921092 locator_triple : locator. triple ,
10931093 is_ui_testing : sess. opts . unstable_opts . ui_testing ,
1094- } ) ;
1094+ } ;
1095+ // The diagnostic for missing core is very good, but it is followed by a lot of
1096+ // other diagnostics that do not add information.
1097+ if missing_core {
1098+ dcx. emit_fatal ( error) ;
1099+ } else {
1100+ dcx. emit_err ( error) ;
1101+ }
10951102 }
10961103 }
10971104 CrateError :: NotFound ( crate_name) => {
1098- dcx . emit_err ( errors:: CannotFindCrate {
1105+ let error = errors:: CannotFindCrate {
10991106 span,
11001107 crate_name,
11011108 add_info : String :: new ( ) ,
@@ -1105,7 +1112,14 @@ impl CrateError {
11051112 profiler_runtime : Symbol :: intern ( & sess. opts . unstable_opts . profiler_runtime ) ,
11061113 locator_triple : sess. opts . target_triple . clone ( ) ,
11071114 is_ui_testing : sess. opts . unstable_opts . ui_testing ,
1108- } ) ;
1115+ } ;
1116+ // The diagnostic for missing core is very good, but it is followed by a lot of
1117+ // other diagnostics that do not add information.
1118+ if missing_core {
1119+ dcx. emit_fatal ( error) ;
1120+ } else {
1121+ dcx. emit_err ( error) ;
1122+ }
11091123 }
11101124 }
11111125 }
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ LL | extern crate core;
88 = help: consider downloading the target with `rustup target add x86_64-unknown-uefi`
99 = help: consider building the standard library from source with `cargo build -Zbuild-std`
1010
11- error: requires `sized` lang_item
12-
13- error: aborting due to 2 previous errors
11+ error: aborting due to 1 previous error
1412
1513For more information about this error, try `rustc --explain E0463`.
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ error[E0463]: can't find crate for `std`
44 = help: consider downloading the target with `rustup target add thumbv6m-none-eabi`
55 = help: consider building the standard library from source with `cargo build -Zbuild-std`
66
7- error: requires `sized` lang_item
8-
9- error: aborting due to 2 previous errors
7+ error: aborting due to 1 previous error
108
119For more information about this error, try `rustc --explain E0463`.
Original file line number Diff line number Diff line change 11//~ ERROR can't find crate for `core`
2- //~^ ERROR can't find crate for `compiler_builtins`
32
43//@ compile-flags: --target thumbv7em-none-eabihf
54//@ needs-llvm-components: arm
87#![ no_std]
98
109extern crate cortex_m;
11- //~^ ERROR can't find crate for `cortex_m`
1210
1311fn main ( ) { }
Original file line number Diff line number Diff line change @@ -4,16 +4,6 @@ error[E0463]: can't find crate for `core`
44 = help: consider downloading the target with `rustup target add thumbv7em-none-eabihf`
55 = help: consider building the standard library from source with `cargo build -Zbuild-std`
66
7- error[E0463]: can't find crate for `compiler_builtins`
8-
9- error[E0463]: can't find crate for `cortex_m`
10- --> $DIR/compiler-builtins-error.rs:10:1
11- |
12- LL | extern crate cortex_m;
13- | ^^^^^^^^^^^^^^^^^^^^^^ can't find crate
14-
15- error: requires `sized` lang_item
16-
17- error: aborting due to 4 previous errors
7+ error: aborting due to 1 previous error
188
199For more information about this error, try `rustc --explain E0463`.
You can’t perform that action at this time.
0 commit comments