@@ -11,12 +11,17 @@ fn main() {
11
11
// the rustc version.
12
12
println ! ( "cargo:rerun-if-changed=build.rs" ) ;
13
13
14
- use_feature_or_nothing ( "vec_into_raw_parts" ) ;
15
- use_feature_or_nothing ( "toowned_clone_into" ) ;
16
14
use_feature_or_nothing ( "rustc_attrs" ) ;
17
- use_feature_or_nothing ( "specialization" ) ;
18
- use_feature_or_nothing ( "slice_internals" ) ;
19
- use_feature_or_nothing ( "const_raw_ptr_deref" ) ;
15
+
16
+ // Features only used in no-std configurations.
17
+ #[ cfg( not( feature = "std" ) ) ]
18
+ {
19
+ use_feature_or_nothing ( "vec_into_raw_parts" ) ;
20
+ use_feature_or_nothing ( "toowned_clone_into" ) ;
21
+ use_feature_or_nothing ( "specialization" ) ;
22
+ use_feature_or_nothing ( "slice_internals" ) ;
23
+ use_feature_or_nothing ( "const_raw_ptr_deref" ) ;
24
+ }
20
25
21
26
let arch = var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) ;
22
27
let asm_name = format ! ( "{}/{}.s" , OUTLINE_PATH , arch) ;
@@ -34,10 +39,7 @@ fn main() {
34
39
use_feature ( "libc" ) ;
35
40
} else {
36
41
use_feature ( "linux_raw" ) ;
37
-
38
42
use_feature_or_nothing ( "core_intrinsics" ) ;
39
- use_feature_or_nothing ( "doc_cfg" ) ;
40
-
41
43
use_feature_or_else ( "asm" , || {
42
44
link_in_librustix_outline ( & arch, & asm_name) ;
43
45
} ) ;
0 commit comments