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