Skip to content

Commit 309d867

Browse files
committed
Stabilize cfg_target_abi
1 parent 090d5ea commit 309d867

13 files changed

+32
-93
lines changed

compiler/rustc_feature/src/accepted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ declare_features! (
8484
(accepted, cfg_doctest, "1.40.0", Some(62210)),
8585
/// Enables `#[cfg(panic = "...")]` config key.
8686
(accepted, cfg_panic, "1.60.0", Some(77443)),
87+
/// Allows `cfg(target_abi = "...")`.
88+
(accepted, cfg_target_abi, "CURRENT_RUSTC_VERSION", Some(80970)),
8789
/// Allows `cfg(target_feature = "...")`.
8890
(accepted, cfg_target_feature, "1.27.0", Some(29717)),
8991
/// Allows `cfg(target_vendor = "...")`.

compiler/rustc_feature/src/builtin_attrs.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub type GatedCfg = (Symbol, Symbol, GateFn);
2525
const GATED_CFGS: &[GatedCfg] = &[
2626
// (name in cfg, feature, function to check if the feature is enabled)
2727
(sym::overflow_checks, sym::cfg_overflow_checks, cfg_fn!(cfg_overflow_checks)),
28-
(sym::target_abi, sym::cfg_target_abi, cfg_fn!(cfg_target_abi)),
2928
(sym::target_thread_local, sym::cfg_target_thread_local, cfg_fn!(cfg_target_thread_local)),
3029
(
3130
sym::target_has_atomic_equal_alignment,

compiler/rustc_feature/src/unstable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ declare_features! (
373373
(unstable, cfg_sanitize, "1.41.0", Some(39699)),
374374
/// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
375375
(unstable, cfg_sanitizer_cfi, "CURRENT_RUSTC_VERSION", Some(89653)),
376-
/// Allows `cfg(target_abi = "...")`.
377-
(unstable, cfg_target_abi, "1.55.0", Some(80970)),
378376
/// Allows `cfg(target(abi = "..."))`.
379377
(unstable, cfg_target_compact, "1.63.0", Some(96901)),
380378
/// Allows `cfg(target_has_atomic_load_store = "...")`.

compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ pub fn target() -> Target {
88
arch: "arm".into(),
99
options: TargetOptions {
1010
abi: "eabihf".into(),
11-
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
12-
env: "gnueabihf".into(),
11+
env: "gnu".into(),
1312
features: "+v6,+vfp2,-d32".into(),
1413
max_atomic_width: Some(64),
1514
mcount: "\u{1}__gnu_mcount_nc".into(),

compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub fn target() -> Target {
88
arch: "arm".into(),
99
options: TargetOptions {
1010
abi: "eabihf".into(),
11-
// FIXME: remove env when cfg_target_abi becomes stable
12-
env: "eabihf".into(),
1311
features: "+v6,+vfp2,-d32".into(),
1412
max_atomic_width: Some(64),
1513
mcount: "__mcount".into(),

compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ pub fn target() -> Target {
88
arch: "arm".into(),
99
options: TargetOptions {
1010
abi: "eabihf".into(),
11-
// FIXME: change env to "gnu" when cfg_target_abi becomes stable
12-
env: "gnueabihf".into(),
11+
env: "gnu".into(),
1312
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
1413
max_atomic_width: Some(64),
1514
mcount: "\u{1}__gnu_mcount_nc".into(),

compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pub fn target() -> Target {
88
arch: "arm".into(),
99
options: TargetOptions {
1010
abi: "eabihf".into(),
11-
// FIXME: remove env when cfg_target_abi becomes stable
12-
env: "eabihf".into(),
1311
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
1412
max_atomic_width: Some(64),
1513
mcount: "__mcount".into(),

library/unwind/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(link_cfg)]
44
#![feature(staged_api)]
55
#![feature(c_unwind)]
6-
#![feature(cfg_target_abi)]
6+
#![cfg_attr(bootstrap, feature(cfg_target_abi))]
77
#![feature(strict_provenance)]
88
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
99
#![allow(internal_features)]

tests/ui/cfg/cfg-target-abi.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
#![feature(cfg_target_abi)]
32

43
#[cfg(target_abi = "eabihf")]
54
pub fn main() {

tests/ui/check-cfg/well-known-values.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(cfg_overflow_checks)]
1111
#![feature(cfg_relocation_model)]
1212
#![feature(cfg_sanitize)]
13-
#![feature(cfg_target_abi)]
1413
#![feature(cfg_target_has_atomic)]
1514
#![feature(cfg_target_has_atomic_equal_alignment)]
1615
#![feature(cfg_target_thread_local)]

tests/ui/check-cfg/well-known-values.stderr

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
2-
--> $DIR/well-known-values.rs:26:5
2+
--> $DIR/well-known-values.rs:25:5
33
|
44
LL | debug_assertions = "_UNEXPECTED_VALUE",
55
| ^^^^^^^^^^^^^^^^----------------------
@@ -12,7 +12,7 @@ LL | debug_assertions = "_UNEXPECTED_VALUE",
1212
= note: `#[warn(unexpected_cfgs)]` on by default
1313

1414
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
15-
--> $DIR/well-known-values.rs:28:5
15+
--> $DIR/well-known-values.rs:27:5
1616
|
1717
LL | doc = "_UNEXPECTED_VALUE",
1818
| ^^^----------------------
@@ -24,7 +24,7 @@ LL | doc = "_UNEXPECTED_VALUE",
2424
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
2525

2626
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
27-
--> $DIR/well-known-values.rs:30:5
27+
--> $DIR/well-known-values.rs:29:5
2828
|
2929
LL | doctest = "_UNEXPECTED_VALUE",
3030
| ^^^^^^^----------------------
@@ -36,7 +36,7 @@ LL | doctest = "_UNEXPECTED_VALUE",
3636
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
3737

3838
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
39-
--> $DIR/well-known-values.rs:32:5
39+
--> $DIR/well-known-values.rs:31:5
4040
|
4141
LL | miri = "_UNEXPECTED_VALUE",
4242
| ^^^^----------------------
@@ -48,7 +48,7 @@ LL | miri = "_UNEXPECTED_VALUE",
4848
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
4949

5050
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
51-
--> $DIR/well-known-values.rs:34:5
51+
--> $DIR/well-known-values.rs:33:5
5252
|
5353
LL | overflow_checks = "_UNEXPECTED_VALUE",
5454
| ^^^^^^^^^^^^^^^----------------------
@@ -60,7 +60,7 @@ LL | overflow_checks = "_UNEXPECTED_VALUE",
6060
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
6161

6262
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
63-
--> $DIR/well-known-values.rs:36:5
63+
--> $DIR/well-known-values.rs:35:5
6464
|
6565
LL | panic = "_UNEXPECTED_VALUE",
6666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -70,7 +70,7 @@ LL | panic = "_UNEXPECTED_VALUE",
7070
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
7171

7272
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
73-
--> $DIR/well-known-values.rs:38:5
73+
--> $DIR/well-known-values.rs:37:5
7474
|
7575
LL | proc_macro = "_UNEXPECTED_VALUE",
7676
| ^^^^^^^^^^----------------------
@@ -82,7 +82,7 @@ LL | proc_macro = "_UNEXPECTED_VALUE",
8282
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
8383

8484
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
85-
--> $DIR/well-known-values.rs:40:5
85+
--> $DIR/well-known-values.rs:39:5
8686
|
8787
LL | relocation_model = "_UNEXPECTED_VALUE",
8888
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -92,7 +92,7 @@ LL | relocation_model = "_UNEXPECTED_VALUE",
9292
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9393

9494
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
95-
--> $DIR/well-known-values.rs:42:5
95+
--> $DIR/well-known-values.rs:41:5
9696
|
9797
LL | sanitize = "_UNEXPECTED_VALUE",
9898
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -102,7 +102,7 @@ LL | sanitize = "_UNEXPECTED_VALUE",
102102
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
103103

104104
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
105-
--> $DIR/well-known-values.rs:44:5
105+
--> $DIR/well-known-values.rs:43:5
106106
|
107107
LL | target_abi = "_UNEXPECTED_VALUE",
108108
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +112,7 @@ LL | target_abi = "_UNEXPECTED_VALUE",
112112
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
113113

114114
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
115-
--> $DIR/well-known-values.rs:46:5
115+
--> $DIR/well-known-values.rs:45:5
116116
|
117117
LL | target_arch = "_UNEXPECTED_VALUE",
118118
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -122,7 +122,7 @@ LL | target_arch = "_UNEXPECTED_VALUE",
122122
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
123123

124124
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
125-
--> $DIR/well-known-values.rs:48:5
125+
--> $DIR/well-known-values.rs:47:5
126126
|
127127
LL | target_endian = "_UNEXPECTED_VALUE",
128128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -132,17 +132,17 @@ LL | target_endian = "_UNEXPECTED_VALUE",
132132
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
133133

134134
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
135-
--> $DIR/well-known-values.rs:50:5
135+
--> $DIR/well-known-values.rs:49:5
136136
|
137137
LL | target_env = "_UNEXPECTED_VALUE",
138138
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139139
|
140-
= note: expected values for `target_env` are: ``, `eabihf`, `gnu`, `gnueabihf`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc`
140+
= note: expected values for `target_env` are: ``, `gnu`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc`
141141
= help: to expect this configuration use `--check-cfg=cfg(target_env, values("_UNEXPECTED_VALUE"))`
142142
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
143143

144144
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
145-
--> $DIR/well-known-values.rs:52:5
145+
--> $DIR/well-known-values.rs:51:5
146146
|
147147
LL | target_family = "_UNEXPECTED_VALUE",
148148
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -152,7 +152,7 @@ LL | target_family = "_UNEXPECTED_VALUE",
152152
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
153153

154154
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
155-
--> $DIR/well-known-values.rs:54:5
155+
--> $DIR/well-known-values.rs:53:5
156156
|
157157
LL | target_feature = "_UNEXPECTED_VALUE",
158158
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -162,7 +162,7 @@ LL | target_feature = "_UNEXPECTED_VALUE",
162162
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
163163

164164
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
165-
--> $DIR/well-known-values.rs:56:5
165+
--> $DIR/well-known-values.rs:55:5
166166
|
167167
LL | target_has_atomic = "_UNEXPECTED_VALUE",
168168
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -172,7 +172,7 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE",
172172
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
173173

174174
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
175-
--> $DIR/well-known-values.rs:58:5
175+
--> $DIR/well-known-values.rs:57:5
176176
|
177177
LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
178178
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -182,7 +182,7 @@ LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
182182
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
183183

184184
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
185-
--> $DIR/well-known-values.rs:60:5
185+
--> $DIR/well-known-values.rs:59:5
186186
|
187187
LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
188188
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -192,7 +192,7 @@ LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
192192
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
193193

194194
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
195-
--> $DIR/well-known-values.rs:62:5
195+
--> $DIR/well-known-values.rs:61:5
196196
|
197197
LL | target_os = "_UNEXPECTED_VALUE",
198198
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -202,7 +202,7 @@ LL | target_os = "_UNEXPECTED_VALUE",
202202
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
203203

204204
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
205-
--> $DIR/well-known-values.rs:64:5
205+
--> $DIR/well-known-values.rs:63:5
206206
|
207207
LL | target_pointer_width = "_UNEXPECTED_VALUE",
208208
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -212,7 +212,7 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE",
212212
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
213213

214214
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
215-
--> $DIR/well-known-values.rs:66:5
215+
--> $DIR/well-known-values.rs:65:5
216216
|
217217
LL | target_thread_local = "_UNEXPECTED_VALUE",
218218
| ^^^^^^^^^^^^^^^^^^^----------------------
@@ -224,7 +224,7 @@ LL | target_thread_local = "_UNEXPECTED_VALUE",
224224
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
225225

226226
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
227-
--> $DIR/well-known-values.rs:68:5
227+
--> $DIR/well-known-values.rs:67:5
228228
|
229229
LL | target_vendor = "_UNEXPECTED_VALUE",
230230
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -234,7 +234,7 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
234234
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
235235

236236
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
237-
--> $DIR/well-known-values.rs:70:5
237+
--> $DIR/well-known-values.rs:69:5
238238
|
239239
LL | test = "_UNEXPECTED_VALUE",
240240
| ^^^^----------------------
@@ -246,7 +246,7 @@ LL | test = "_UNEXPECTED_VALUE",
246246
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
247247

248248
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
249-
--> $DIR/well-known-values.rs:72:5
249+
--> $DIR/well-known-values.rs:71:5
250250
|
251251
LL | unix = "_UNEXPECTED_VALUE",
252252
| ^^^^----------------------
@@ -258,7 +258,7 @@ LL | unix = "_UNEXPECTED_VALUE",
258258
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
259259

260260
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
261-
--> $DIR/well-known-values.rs:74:5
261+
--> $DIR/well-known-values.rs:73:5
262262
|
263263
LL | windows = "_UNEXPECTED_VALUE",
264264
| ^^^^^^^----------------------
@@ -270,7 +270,7 @@ LL | windows = "_UNEXPECTED_VALUE",
270270
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
271271

272272
warning: unexpected `cfg` condition value: `linuz`
273-
--> $DIR/well-known-values.rs:80:7
273+
--> $DIR/well-known-values.rs:79:7
274274
|
275275
LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
276276
| ^^^^^^^^^^^^-------

tests/ui/feature-gates/feature-gate-cfg-target-abi.rs

-13
This file was deleted.

tests/ui/feature-gates/feature-gate-cfg-target-abi.stderr

-39
This file was deleted.

0 commit comments

Comments
 (0)