Skip to content

Commit 2cdde6a

Browse files
committed
Remove unstable cfg target(...) compact feature from RFC3239
1 parent a4cb3c8 commit 2cdde6a

13 files changed

+4
-211
lines changed

compiler/rustc_attr_parsing/messages.ftl

-3
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ attr_parsing_unknown_meta_item =
107107
attr_parsing_unknown_version_literal =
108108
unknown version literal format, assuming it refers to a future version
109109
110-
attr_parsing_unstable_cfg_target_compact =
111-
compact `cfg(target(..))` is experimental and subject to change
112-
113110
attr_parsing_unsupported_literal_cfg_boolean =
114111
literal in `cfg` predicate value must be a boolean
115112
attr_parsing_unsupported_literal_cfg_string =

compiler/rustc_attr_parsing/src/attributes/cfg.rs

+1-34
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_span::Span;
1313
use rustc_span::symbol::{Symbol, kw, sym};
1414

1515
use crate::util::UnsupportedLiteralReason;
16-
use crate::{fluent_generated, parse_version, session_diagnostics};
16+
use crate::{parse_version, session_diagnostics};
1717

1818
#[derive(Clone, Debug)]
1919
pub struct Condition {
@@ -185,39 +185,6 @@ pub fn eval_condition(
185185

186186
!eval_condition(mi, sess, features, eval)
187187
}
188-
sym::target => {
189-
if let Some(features) = features
190-
&& !features.cfg_target_compact()
191-
{
192-
feature_err(
193-
sess,
194-
sym::cfg_target_compact,
195-
cfg.span,
196-
fluent_generated::attr_parsing_unstable_cfg_target_compact,
197-
)
198-
.emit();
199-
}
200-
201-
mis.iter().fold(true, |res, mi| {
202-
let Some(mut mi) = mi.meta_item().cloned() else {
203-
dcx.emit_err(session_diagnostics::CfgPredicateIdentifier {
204-
span: mi.span(),
205-
});
206-
return false;
207-
};
208-
209-
if let [seg, ..] = &mut mi.path.segments[..] {
210-
seg.ident.name = Symbol::intern(&format!("target_{}", seg.ident.name));
211-
}
212-
213-
res & eval_condition(
214-
&ast::MetaItemInner::MetaItem(mi),
215-
sess,
216-
features,
217-
eval,
218-
)
219-
})
220-
}
221188
_ => {
222189
dcx.emit_err(session_diagnostics::InvalidPredicate {
223190
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
@@ -410,8 +410,6 @@ declare_features! (
410410
(unstable, cfg_sanitize, "1.41.0", Some(39699)),
411411
/// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
412412
(unstable, cfg_sanitizer_cfi, "1.77.0", Some(89653)),
413-
/// Allows `cfg(target(abi = "..."))`.
414-
(unstable, cfg_target_compact, "1.63.0", Some(96901)),
415413
/// Allows `cfg(target_has_atomic_load_store = "...")`.
416414
(unstable, cfg_target_has_atomic, "1.60.0", Some(94039)),
417415
/// 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

-13
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)