File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11#![ feature( crate_visibility_modifier) ]
22#![ feature( derive_default_enum) ]
3+ #![ feature( let_chains) ]
34#![ feature( let_else) ]
45#![ feature( min_specialization) ]
56#![ 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 {
183183
184184/// Checks if target supports crate_type as output
185185pub 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 ;
194189 }
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 ;
201192 }
202193 }
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 {
204198 return true ;
205199 }
206200
You can’t perform that action at this time.
0 commit comments