Use a let-chain in _session::output (nfc)
This commit is contained in:
parent
d3ca9ba123
commit
fd2448b5fc
@ -1,5 +1,6 @@
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(derive_default_enum)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(let_else)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(once_cell)]
|
||||
|
@ -183,8 +183,7 @@ pub fn default_output_for_target(sess: &Session) -> CrateType {
|
||||
|
||||
/// Checks if target supports crate_type as output
|
||||
pub fn invalid_output_for_target(sess: &Session, crate_type: CrateType) -> bool {
|
||||
match crate_type {
|
||||
CrateType::Cdylib | CrateType::Dylib | CrateType::ProcMacro => {
|
||||
if let CrateType::Cdylib | CrateType::Dylib | CrateType::ProcMacro = crate_type {
|
||||
if !sess.target.dynamic_linking {
|
||||
return true;
|
||||
}
|
||||
@ -192,15 +191,10 @@ pub fn invalid_output_for_target(sess: &Session, crate_type: CrateType) -> bool
|
||||
return true;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
if let CrateType::ProcMacro | CrateType::Dylib = crate_type && sess.target.only_cdylib {
|
||||
return true;
|
||||
}
|
||||
if sess.target.only_cdylib {
|
||||
match crate_type {
|
||||
CrateType::ProcMacro | CrateType::Dylib => return true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
if !sess.target.executables && crate_type == CrateType::Executable {
|
||||
if let CrateType::Executable = crate_type && !sess.target.executables {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user