File tree 5 files changed +21
-23
lines changed
compiler/rustc_metadata/src
5 files changed +21
-23
lines changed Original file line number Diff line number Diff line change @@ -1077,7 +1077,7 @@ impl CrateError {
1077
1077
crate_rejections,
1078
1078
} ) ;
1079
1079
} else {
1080
- dcx . emit_err ( errors:: CannotFindCrate {
1080
+ let error = errors:: CannotFindCrate {
1081
1081
span,
1082
1082
crate_name,
1083
1083
add_info,
@@ -1091,11 +1091,18 @@ impl CrateError {
1091
1091
profiler_runtime : Symbol :: intern ( & sess. opts . unstable_opts . profiler_runtime ) ,
1092
1092
locator_triple : locator. triple ,
1093
1093
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
+ }
1095
1102
}
1096
1103
}
1097
1104
CrateError :: NotFound ( crate_name) => {
1098
- dcx . emit_err ( errors:: CannotFindCrate {
1105
+ let error = errors:: CannotFindCrate {
1099
1106
span,
1100
1107
crate_name,
1101
1108
add_info : String :: new ( ) ,
@@ -1105,7 +1112,14 @@ impl CrateError {
1105
1112
profiler_runtime : Symbol :: intern ( & sess. opts . unstable_opts . profiler_runtime ) ,
1106
1113
locator_triple : sess. opts . target_triple . clone ( ) ,
1107
1114
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
+ }
1109
1123
}
1110
1124
}
1111
1125
}
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ LL | extern crate core;
8
8
= help: consider downloading the target with `rustup target add x86_64-unknown-uefi`
9
9
= help: consider building the standard library from source with `cargo build -Zbuild-std`
10
10
11
- error: requires `sized` lang_item
12
-
13
- error: aborting due to 2 previous errors
11
+ error: aborting due to 1 previous error
14
12
15
13
For 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`
4
4
= help: consider downloading the target with `rustup target add thumbv6m-none-eabi`
5
5
= help: consider building the standard library from source with `cargo build -Zbuild-std`
6
6
7
- error: requires `sized` lang_item
8
-
9
- error: aborting due to 2 previous errors
7
+ error: aborting due to 1 previous error
10
8
11
9
For more information about this error, try `rustc --explain E0463`.
Original file line number Diff line number Diff line change 1
1
//~ ERROR can't find crate for `core`
2
- //~^ ERROR can't find crate for `compiler_builtins`
3
2
4
3
//@ compile-flags: --target thumbv7em-none-eabihf
5
4
//@ needs-llvm-components: arm
8
7
#![ no_std]
9
8
10
9
extern crate cortex_m;
11
- //~^ ERROR can't find crate for `cortex_m`
12
10
13
11
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -4,16 +4,6 @@ error[E0463]: can't find crate for `core`
4
4
= help: consider downloading the target with `rustup target add thumbv7em-none-eabihf`
5
5
= help: consider building the standard library from source with `cargo build -Zbuild-std`
6
6
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
18
8
19
9
For more information about this error, try `rustc --explain E0463`.
You can’t perform that action at this time.
0 commit comments