This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Expand file tree Collapse file tree 3 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ pub fn add_configuration(
4949
5050 cfg. extend ( codegen_backend. target_features ( sess) . into_iter ( ) . map ( |feat| ( tf, Some ( feat) ) ) ) ;
5151
52- if sess. crt_static_feature ( None ) {
52+ if sess. crt_static ( None ) {
5353 cfg. insert ( ( tf, Some ( Symbol :: intern ( "crt-static" ) ) ) ) ;
5454 }
5555}
Original file line number Diff line number Diff line change @@ -598,16 +598,11 @@ impl Session {
598598
599599 /// Check whether this compile session and crate type use static crt.
600600 pub fn crt_static ( & self , crate_type : Option < CrateType > ) -> bool {
601- // If the target does not opt in to crt-static support, use its default.
602- if self . target . target . options . crt_static_respected {
603- self . crt_static_feature ( crate_type)
604- } else {
605- self . target . target . options . crt_static_default
601+ if !self . target . target . options . crt_static_respected {
602+ // If the target does not opt in to crt-static support, use its default.
603+ return self . target . target . options . crt_static_default ;
606604 }
607- }
608605
609- /// Check whether this compile session and crate type use `crt-static` feature.
610- pub fn crt_static_feature ( & self , crate_type : Option < CrateType > ) -> bool {
611606 let requested_features = self . opts . cg . target_feature . split ( ',' ) ;
612607 let found_negative = requested_features. clone ( ) . any ( |r| r == "-crt-static" ) ;
613608 let found_positive = requested_features. clone ( ) . any ( |r| r == "+crt-static" ) ;
Original file line number Diff line number Diff line change 11// run-pass
2-
3- #![ allow( stable_features) ]
4- // compile-flags:-C target-feature=+crt-static -Z unstable-options
5-
6- #![ feature( cfg_target_feature) ]
2+ // compile-flags:-C target-feature=+crt-static
3+ // only-msvc
74
85#[ cfg( target_feature = "crt-static" ) ]
96fn main ( ) { }
You can’t perform that action at this time.
0 commit comments