File tree 1 file changed +18
-4
lines changed
compiler/rustc_metadata/src
1 file changed +18
-4
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
}
You can’t perform that action at this time.
0 commit comments