Skip to content

Commit 70fadcd

Browse files
committed
Remove unstable cfg target(...) compact feature from RFC3239
1 parent 191df20 commit 70fadcd

13 files changed

+4
-205
lines changed

compiler/rustc_attr_parsing/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ attr_parsing_unrecognized_repr_hint =
115115
unrecognized representation hint
116116
.help = valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
117117
118-
attr_parsing_unstable_cfg_target_compact =
119-
compact `cfg(target(..))` is experimental and subject to change
120-
121118
attr_parsing_unsupported_literal_cfg_boolean =
122119
literal in `cfg` predicate value must be a boolean
123120
attr_parsing_unsupported_literal_cfg_string =

compiler/rustc_attr_parsing/src/attributes/cfg.rs

+1-29
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use rustc_session::lint::builtin::UNEXPECTED_CFGS;
99
use rustc_session::parse::feature_err;
1010
use rustc_span::{Span, Symbol, sym};
1111

12+
use crate::parse_version;
1213
use crate::session_diagnostics::{self, UnsupportedLiteralReason};
13-
use crate::{fluent_generated, parse_version};
1414

1515
#[derive(Clone, Debug)]
1616
pub struct Condition {
@@ -168,34 +168,6 @@ pub fn eval_condition(
168168

169169
!eval_condition(mi, sess, features, eval)
170170
}
171-
Some(sym::target) => {
172-
if let Some(features) = features
173-
&& !features.cfg_target_compact()
174-
{
175-
feature_err(
176-
sess,
177-
sym::cfg_target_compact,
178-
cfg.span,
179-
fluent_generated::attr_parsing_unstable_cfg_target_compact,
180-
)
181-
.emit();
182-
}
183-
184-
mis.iter().fold(true, |res, mi| {
185-
let Some(mut mi) = mi.meta_item().cloned() else {
186-
dcx.emit_err(session_diagnostics::CfgPredicateIdentifier {
187-
span: mi.span(),
188-
});
189-
return false;
190-
};
191-
192-
if let [seg, ..] = &mut mi.path.segments[..] {
193-
seg.ident.name = Symbol::intern(&format!("target_{}", seg.ident.name));
194-
}
195-
196-
res & eval_condition(&MetaItemInner::MetaItem(mi), sess, features, eval)
197-
})
198-
}
199171
_ => {
200172
dcx.emit_err(session_diagnostics::InvalidPredicate {
201173
span: cfg.span,

compiler/rustc_feature/src/removed.rs

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ declare_features! (
5252
(removed, box_syntax, "1.70.0", Some(49733), Some("replaced with `#[rustc_box]`")),
5353
/// Allows capturing disjoint fields in a closure/coroutine (RFC 2229).
5454
(removed, capture_disjoint_fields, "1.49.0", Some(53488), Some("stabilized in Rust 2021")),
55+
/// Allows `cfg(target(abi = "..."))`.
56+
(removed, cfg_target_compact, "CURRENT_RUSTC_VERSION", Some(96901),
57+
Some("removed due to lack of usefulness and users")),
5558
/// Allows comparing raw pointers during const eval.
5659
(removed, const_compare_raw_pointers, "1.46.0", Some(53020),
5760
Some("cannot be allowed in const eval in any meaningful way")),

compiler/rustc_feature/src/unstable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,6 @@ declare_features! (
401401
(unstable, cfg_sanitize, "1.41.0", Some(39699)),
402402
/// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
403403
(unstable, cfg_sanitizer_cfi, "1.77.0", Some(89653)),
404-
/// Allows `cfg(target(abi = "..."))`.
405-
(unstable, cfg_target_compact, "1.63.0", Some(96901)),
406404
/// Allows `cfg(target_has_atomic_load_store = "...")`.
407405
(unstable, cfg_target_has_atomic, "1.60.0", Some(94039)),
408406
/// Allows `cfg(target_has_atomic_equal_alignment = "...")`.

tests/ui/cfg/cfg-target-compact-errors.rs

-21
This file was deleted.

tests/ui/cfg/cfg-target-compact-errors.stderr

-28
This file was deleted.

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

-10
This file was deleted.

tests/ui/check-cfg/compact-names.rs

-16
This file was deleted.

tests/ui/check-cfg/compact-names.stderr

-12
This file was deleted.

tests/ui/check-cfg/compact-values.rs

-16
This file was deleted.

tests/ui/check-cfg/compact-values.stderr

-12
This file was deleted.

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

-13
This file was deleted.

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

-43
This file was deleted.

0 commit comments

Comments
 (0)