Skip to content

Commit eb449c1

Browse files
committed
Move error on -Cinstrument-coverage earlier and elaborate that it is LLVM specific
cc #1494
1 parent 8f1d41e commit eb449c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,19 @@ impl CodegenBackend for CraneliftCodegenBackend {
172172
}
173173

174174
fn init(&self, sess: &Session) {
175-
use rustc_session::config::Lto;
175+
use rustc_session::config::{InstrumentCoverage, Lto};
176176
match sess.lto() {
177177
Lto::No | Lto::ThinLocal => {}
178178
Lto::Thin | Lto::Fat => {
179179
sess.dcx().warn("LTO is not supported. You may get a linker error.")
180180
}
181181
}
182182

183+
if sess.opts.cg.instrument_coverage() != InstrumentCoverage::No {
184+
sess.dcx()
185+
.fatal("`-Cinstrument-coverage` is LLVM specific and not supported by Cranelift");
186+
}
187+
183188
let mut config = self.config.borrow_mut();
184189
if config.is_none() {
185190
let new_config = BackendConfig::from_opts(&sess.opts.cg.llvm_args)

0 commit comments

Comments
 (0)