@@ -23,6 +23,8 @@ test_target() {
23
23
target=" ${2} "
24
24
no_std=" ${3} "
25
25
26
+ RUSTFLAGS=" ${RUSTFLAGS:- } "
27
+
26
28
# If there is a std component, fetch it:
27
29
if [ " ${no_std} " != " 1" ]; then
28
30
# FIXME: rustup often fails to download some artifacts due to network
@@ -36,15 +38,17 @@ test_target() {
36
38
n=$(( n+ 1 ))
37
39
sleep 1
38
40
done
41
+
42
+ # FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
43
+ RUSTFLAGS=" ${RUSTFLAGS:- } -Aimproper_ctypes_definitions"
44
+ export RUSTFLAGS
39
45
fi
40
46
41
47
# Test that libc builds without any default features (no std)
42
48
if [ " $no_std " != " 1" ]; then
43
49
cargo " +$rust " " $build_cmd " --no-default-features --target " $target "
44
50
else
45
- # FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
46
- RUSTFLAGS=" -A improper_ctypes_definitions" \
47
- cargo " +$rust " " $build_cmd " \
51
+ cargo " +$rust " " $build_cmd " \
48
52
-Z build-std=core,alloc \
49
53
--no-default-features \
50
54
--target " $target "
@@ -55,8 +59,7 @@ test_target() {
55
59
if [ " $no_std " != " 1" ]; then
56
60
cargo " +$rust " " $build_cmd " --target " $target "
57
61
else
58
- RUSTFLAGS=" -A improper_ctypes_definitions" \
59
- cargo " +$rust " " ${build_cmd} " \
62
+ cargo " +$rust " " ${build_cmd} " \
60
63
-Z build-std=core,alloc \
61
64
--target " $target "
62
65
fi
@@ -68,8 +71,7 @@ test_target() {
68
71
--features extra_traits \
69
72
--target " $target "
70
73
else
71
- RUSTFLAGS=" -A improper_ctypes_definitions" \
72
- cargo " +$rust " " $build_cmd " \
74
+ cargo " +$rust " " $build_cmd " \
73
75
-Z build-std=core,alloc \
74
76
--no-default-features \
75
77
--features extra_traits \
@@ -84,8 +86,7 @@ test_target() {
84
86
--features const-extern-fn \
85
87
--target " $target "
86
88
else
87
- RUSTFLAGS=" -A improper_ctypes_definitions" \
88
- cargo " +$rust " " $build_cmd " \
89
+ cargo " +$rust " " $build_cmd " \
89
90
-Z build-std=core,alloc \
90
91
--no-default-features \
91
92
--features const-extern-fn \
@@ -99,8 +100,7 @@ test_target() {
99
100
--target " $target " \
100
101
--features extra_traits
101
102
else
102
- RUSTFLAGS=" -A improper_ctypes_definitions" \
103
- cargo " +$rust " " $build_cmd " \
103
+ cargo " +$rust " " $build_cmd " \
104
104
-Z build-std=core,alloc \
105
105
--target " $target " \
106
106
--features extra_traits
0 commit comments