Skip to content

Commit 93ec0e6

Browse files
committed
Stabilize cfg_target_abi
1 parent 8f359be commit 93ec0e6

13 files changed

+33
-98
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, "1.77.0", 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

+28-28
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 | clippy = "_UNEXPECTED_VALUE",
55
| ^^^^^^----------------------
@@ -11,7 +11,7 @@ LL | clippy = "_UNEXPECTED_VALUE",
1111
= note: `#[warn(unexpected_cfgs)]` on by default
1212

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

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

3535
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
36-
--> $DIR/well-known-values.rs:32:5
36+
--> $DIR/well-known-values.rs:31:5
3737
|
3838
LL | doctest = "_UNEXPECTED_VALUE",
3939
| ^^^^^^^----------------------
@@ -44,7 +44,7 @@ LL | doctest = "_UNEXPECTED_VALUE",
4444
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
4545

4646
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
47-
--> $DIR/well-known-values.rs:34:5
47+
--> $DIR/well-known-values.rs:33:5
4848
|
4949
LL | miri = "_UNEXPECTED_VALUE",
5050
| ^^^^----------------------
@@ -55,7 +55,7 @@ LL | miri = "_UNEXPECTED_VALUE",
5555
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
5656

5757
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
58-
--> $DIR/well-known-values.rs:36:5
58+
--> $DIR/well-known-values.rs:35:5
5959
|
6060
LL | overflow_checks = "_UNEXPECTED_VALUE",
6161
| ^^^^^^^^^^^^^^^----------------------
@@ -66,7 +66,7 @@ LL | overflow_checks = "_UNEXPECTED_VALUE",
6666
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
6767

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

7777
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
78-
--> $DIR/well-known-values.rs:40:5
78+
--> $DIR/well-known-values.rs:39:5
7979
|
8080
LL | proc_macro = "_UNEXPECTED_VALUE",
8181
| ^^^^^^^^^^----------------------
@@ -86,7 +86,7 @@ LL | proc_macro = "_UNEXPECTED_VALUE",
8686
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
8787

8888
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
89-
--> $DIR/well-known-values.rs:42:5
89+
--> $DIR/well-known-values.rs:41:5
9090
|
9191
LL | relocation_model = "_UNEXPECTED_VALUE",
9292
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -95,7 +95,7 @@ LL | relocation_model = "_UNEXPECTED_VALUE",
9595
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
9696

9797
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
98-
--> $DIR/well-known-values.rs:44:5
98+
--> $DIR/well-known-values.rs:43:5
9999
|
100100
LL | sanitize = "_UNEXPECTED_VALUE",
101101
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -104,7 +104,7 @@ LL | sanitize = "_UNEXPECTED_VALUE",
104104
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
105105

106106
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
107-
--> $DIR/well-known-values.rs:46:5
107+
--> $DIR/well-known-values.rs:45:5
108108
|
109109
LL | target_abi = "_UNEXPECTED_VALUE",
110110
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -113,7 +113,7 @@ LL | target_abi = "_UNEXPECTED_VALUE",
113113
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
114114

115115
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
116-
--> $DIR/well-known-values.rs:48:5
116+
--> $DIR/well-known-values.rs:47:5
117117
|
118118
LL | target_arch = "_UNEXPECTED_VALUE",
119119
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -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:50:5
125+
--> $DIR/well-known-values.rs:49:5
126126
|
127127
LL | target_endian = "_UNEXPECTED_VALUE",
128128
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -131,16 +131,16 @@ LL | target_endian = "_UNEXPECTED_VALUE",
131131
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
132132

133133
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
134-
--> $DIR/well-known-values.rs:52:5
134+
--> $DIR/well-known-values.rs:51:5
135135
|
136136
LL | target_env = "_UNEXPECTED_VALUE",
137137
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138138
|
139-
= note: expected values for `target_env` are: ``, `eabihf`, `gnu`, `gnueabihf`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc`
139+
= note: expected values for `target_env` are: ``, `gnu`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `ohos`, `psx`, `relibc`, `sgx`, `uclibc`
140140
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
141141

142142
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
143-
--> $DIR/well-known-values.rs:54:5
143+
--> $DIR/well-known-values.rs:53:5
144144
|
145145
LL | target_family = "_UNEXPECTED_VALUE",
146146
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -149,7 +149,7 @@ LL | target_family = "_UNEXPECTED_VALUE",
149149
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
150150

151151
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
152-
--> $DIR/well-known-values.rs:56:5
152+
--> $DIR/well-known-values.rs:55:5
153153
|
154154
LL | target_feature = "_UNEXPECTED_VALUE",
155155
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -158,7 +158,7 @@ LL | target_feature = "_UNEXPECTED_VALUE",
158158
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
159159

160160
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
161-
--> $DIR/well-known-values.rs:58:5
161+
--> $DIR/well-known-values.rs:57:5
162162
|
163163
LL | target_has_atomic = "_UNEXPECTED_VALUE",
164164
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -167,7 +167,7 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE",
167167
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
168168

169169
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
170-
--> $DIR/well-known-values.rs:60:5
170+
--> $DIR/well-known-values.rs:59:5
171171
|
172172
LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
173173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -176,7 +176,7 @@ LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
176176
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
177177

178178
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
179-
--> $DIR/well-known-values.rs:62:5
179+
--> $DIR/well-known-values.rs:61:5
180180
|
181181
LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
182182
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -185,7 +185,7 @@ LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
185185
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
186186

187187
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
188-
--> $DIR/well-known-values.rs:64:5
188+
--> $DIR/well-known-values.rs:63:5
189189
|
190190
LL | target_os = "_UNEXPECTED_VALUE",
191191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -194,7 +194,7 @@ LL | target_os = "_UNEXPECTED_VALUE",
194194
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
195195

196196
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
197-
--> $DIR/well-known-values.rs:66:5
197+
--> $DIR/well-known-values.rs:65:5
198198
|
199199
LL | target_pointer_width = "_UNEXPECTED_VALUE",
200200
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -203,7 +203,7 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE",
203203
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
204204

205205
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
206-
--> $DIR/well-known-values.rs:68:5
206+
--> $DIR/well-known-values.rs:67:5
207207
|
208208
LL | target_thread_local = "_UNEXPECTED_VALUE",
209209
| ^^^^^^^^^^^^^^^^^^^----------------------
@@ -214,7 +214,7 @@ LL | target_thread_local = "_UNEXPECTED_VALUE",
214214
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
215215

216216
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
217-
--> $DIR/well-known-values.rs:70:5
217+
--> $DIR/well-known-values.rs:69:5
218218
|
219219
LL | target_vendor = "_UNEXPECTED_VALUE",
220220
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -223,7 +223,7 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
223223
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
224224

225225
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
226-
--> $DIR/well-known-values.rs:72:5
226+
--> $DIR/well-known-values.rs:71:5
227227
|
228228
LL | test = "_UNEXPECTED_VALUE",
229229
| ^^^^----------------------
@@ -234,7 +234,7 @@ LL | test = "_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:74:5
237+
--> $DIR/well-known-values.rs:73:5
238238
|
239239
LL | unix = "_UNEXPECTED_VALUE",
240240
| ^^^^----------------------
@@ -245,7 +245,7 @@ LL | unix = "_UNEXPECTED_VALUE",
245245
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
246246

247247
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
248-
--> $DIR/well-known-values.rs:76:5
248+
--> $DIR/well-known-values.rs:75:5
249249
|
250250
LL | windows = "_UNEXPECTED_VALUE",
251251
| ^^^^^^^----------------------
@@ -256,7 +256,7 @@ LL | windows = "_UNEXPECTED_VALUE",
256256
= note: see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration
257257

258258
warning: unexpected `cfg` condition value: `linuz`
259-
--> $DIR/well-known-values.rs:82:7
259+
--> $DIR/well-known-values.rs:81:7
260260
|
261261
LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
262262
| ^^^^^^^^^^^^-------

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

-43
This file was deleted.

0 commit comments

Comments
 (0)