Skip to content

Commit 11b2b86

Browse files
committed
Fix some rustc tests
* Check for `#[rustc_error]` attribute. * Use the same weak static type error message as cg_llvm
1 parent 6f23a05 commit 11b2b86

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn data_id_for_static(
202202
if linkage == Linkage::Preemptible {
203203
if let ty::RawPtr(_) = tcx.type_of(def_id).sty {
204204
} else {
205-
tcx.sess.span_fatal(tcx.def_span(def_id), "must have type `*const T` or `*mut T`")
205+
tcx.sess.span_fatal(tcx.def_span(def_id), "must have type `*const T` or `*mut T` due to `#[linkage]` attribute")
206206
}
207207

208208
let mut data_ctx = DataContext::new();

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ impl CodegenBackend for CraneliftCodegenBackend {
195195
need_metadata_module: bool,
196196
_rx: mpsc::Receiver<Box<dyn Any + Send>>,
197197
) -> Box<dyn Any> {
198+
rustc_codegen_utils::check_for_rustc_errors_attr(tcx);
199+
198200
let res = driver::codegen_crate(tcx, metadata, need_metadata_module);
199201

200202
rustc_incremental::assert_module_sources::assert_module_sources(tcx);

0 commit comments

Comments
 (0)