File tree 2 files changed +10
-15
lines changed
compiler/rustc_session/src
2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 1
1
#![ feature( crate_visibility_modifier) ]
2
2
#![ feature( derive_default_enum) ]
3
+ #![ feature( let_chains) ]
3
4
#![ feature( let_else) ]
4
5
#![ feature( min_specialization) ]
5
6
#![ feature( once_cell) ]
Original file line number Diff line number Diff line change @@ -183,24 +183,18 @@ pub fn default_output_for_target(sess: &Session) -> CrateType {
183
183
184
184
/// Checks if target supports crate_type as output
185
185
pub fn invalid_output_for_target ( sess : & Session , crate_type : CrateType ) -> bool {
186
- match crate_type {
187
- CrateType :: Cdylib | CrateType :: Dylib | CrateType :: ProcMacro => {
188
- if !sess. target . dynamic_linking {
189
- return true ;
190
- }
191
- if sess. crt_static ( Some ( crate_type) ) && !sess. target . crt_static_allows_dylibs {
192
- return true ;
193
- }
186
+ if let CrateType :: Cdylib | CrateType :: Dylib | CrateType :: ProcMacro = crate_type {
187
+ if !sess. target . dynamic_linking {
188
+ return true ;
194
189
}
195
- _ => { }
196
- }
197
- if sess. target . only_cdylib {
198
- match crate_type {
199
- CrateType :: ProcMacro | CrateType :: Dylib => return true ,
200
- _ => { }
190
+ if sess. crt_static ( Some ( crate_type) ) && !sess. target . crt_static_allows_dylibs {
191
+ return true ;
201
192
}
202
193
}
203
- if !sess. target . executables && crate_type == CrateType :: Executable {
194
+ if let CrateType :: ProcMacro | CrateType :: Dylib = crate_type && sess. target . only_cdylib {
195
+ return true ;
196
+ }
197
+ if let CrateType :: Executable = crate_type && !sess. target . executables {
204
198
return true ;
205
199
}
206
200
You can’t perform that action at this time.
0 commit comments