File tree 3 files changed +6
-14
lines changed
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(
49
49
50
50
cfg. extend ( codegen_backend. target_features ( sess) . into_iter ( ) . map ( |feat| ( tf, Some ( feat) ) ) ) ;
51
51
52
- if sess. crt_static_feature ( None ) {
52
+ if sess. crt_static ( None ) {
53
53
cfg. insert ( ( tf, Some ( Symbol :: intern ( "crt-static" ) ) ) ) ;
54
54
}
55
55
}
Original file line number Diff line number Diff line change @@ -598,16 +598,11 @@ impl Session {
598
598
599
599
/// Check whether this compile session and crate type use static crt.
600
600
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 ;
606
604
}
607
- }
608
605
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 {
611
606
let requested_features = self . opts . cg . target_feature . split ( ',' ) ;
612
607
let found_negative = requested_features. clone ( ) . any ( |r| r == "-crt-static" ) ;
613
608
let found_positive = requested_features. clone ( ) . any ( |r| r == "+crt-static" ) ;
Original file line number Diff line number Diff line change 1
1
// 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
7
4
8
5
#[ cfg( target_feature = "crt-static" ) ]
9
6
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments