@@ -129,6 +129,23 @@ impl Config {
129129 }
130130 }
131131
132+ fn cargo_features ( & self ) -> CargoFeatures {
133+ // '*' is to be considered deprecated but still kept in for backward compatibility
134+ if self . cargo_features . is_empty ( ) || self . cargo_features . iter ( ) . any ( |f| f == "*" ) {
135+ CargoFeatures :: All
136+ } else {
137+ CargoFeatures :: Selected {
138+ features : self
139+ . cargo_features
140+ . iter ( )
141+ . filter ( |f| * f != "default" )
142+ . cloned ( )
143+ . collect ( ) ,
144+ no_default_features : !self . cargo_features . iter ( ) . any ( |f| f == "default" ) ,
145+ }
146+ }
147+ }
148+
132149 pub fn to_cargo_config ( & self , dir : & AbsPath ) -> ( CargoConfig , LoadCargoConfig ) {
133150 let sysroot = self . sysroot ( dir) ;
134151 (
@@ -159,16 +176,7 @@ impl Config {
159176 . unwrap_or_else ( || self . scratch_dir . join ( "target" ) ) ,
160177 )
161178 . ok ( ) ,
162- features : if self . cargo_features . is_empty ( ) {
163- Default :: default ( )
164- } else if self . cargo_features . contains ( & "*" . to_string ( ) ) {
165- CargoFeatures :: All
166- } else {
167- CargoFeatures :: Selected {
168- features : self . cargo_features . clone ( ) ,
169- no_default_features : false ,
170- }
171- } ,
179+ features : self . cargo_features ( ) ,
172180 target : self . cargo_target . clone ( ) ,
173181 cfg_overrides : to_cfg_overrides ( & self . cargo_cfg_overrides ) ,
174182 wrap_rustc_in_build_scripts : false ,
0 commit comments