Auto merge of #138906 - thaliaarchi:unsupported-test-exe, r=bjorn3
Reject test executables when not supported by target Currently, compiling tests for SOLID produces an ICE, because SOLID does not support executables. See https://github.com/rust-lang/rust/issues/138047
This commit is contained in:
commit
414da5b63d
1 changed files with 7 additions and 0 deletions
|
@ -177,6 +177,13 @@ pub fn collect_crate_types(session: &Session, attrs: &[ast::Attribute]) -> Vec<C
|
|||
// If we're generating a test executable, then ignore all other output
|
||||
// styles at all other locations
|
||||
if session.opts.test {
|
||||
if !session.target.executables {
|
||||
session.dcx().emit_warn(errors::UnsupportedCrateTypeForTarget {
|
||||
crate_type: CrateType::Executable,
|
||||
target_triple: &session.opts.target_triple,
|
||||
});
|
||||
return Vec::new();
|
||||
}
|
||||
return vec![CrateType::Executable];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue