diff --git a/src/constant.rs b/src/constant.rs index 3ccd0f97dc54..a71a8d0bf2cd 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -202,7 +202,7 @@ fn data_id_for_static( if linkage == Linkage::Preemptible { if let ty::RawPtr(_) = tcx.type_of(def_id).sty { } else { - tcx.sess.span_fatal(tcx.def_span(def_id), "must have type `*const T` or `*mut T`") + tcx.sess.span_fatal(tcx.def_span(def_id), "must have type `*const T` or `*mut T` due to `#[linkage]` attribute") } let mut data_ctx = DataContext::new(); diff --git a/src/lib.rs b/src/lib.rs index 30a8ca02975e..b6ef7e39d148 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,6 +195,8 @@ impl CodegenBackend for CraneliftCodegenBackend { need_metadata_module: bool, _rx: mpsc::Receiver>, ) -> Box { + rustc_codegen_utils::check_for_rustc_errors_attr(tcx); + let res = driver::codegen_crate(tcx, metadata, need_metadata_module); rustc_incremental::assert_module_sources::assert_module_sources(tcx);