Skip to content

Commit 59e5920

Browse files
committed
Reject test executables when not supported by target
Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables.
1 parent 4510e86 commit 59e5920

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler/rustc_session/src/output.rs

+7
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<C
177177
// If we're generating a test executable, then ignore all other output
178178
// styles at all other locations
179179
if session.opts.test {
180+
if !session.target.executables {
181+
session.dcx().emit_warn(errors::UnsupportedCrateTypeForTarget {
182+
crate_type: CrateType::Executable,
183+
target_triple: &session.opts.target_triple,
184+
});
185+
return Vec::new();
186+
}
180187
return vec![CrateType::Executable];
181188
}
182189

0 commit comments

Comments
 (0)