Skip to content

Commit

Permalink
Remove unstable cfg target(...) compact feature from RFC3239
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Oct 7, 2024
1 parent 0b16baa commit 1de1d84
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 195 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_attr/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ attr_unknown_meta_item =
attr_unknown_version_literal =
unknown version literal format, assuming it refers to a future version
attr_unstable_cfg_target_compact =
compact `cfg(target(..))` is experimental and subject to change
attr_unsupported_literal_cfg_boolean =
literal in `cfg` predicate value must be a boolean
attr_unsupported_literal_cfg_string =
Expand Down
28 changes: 0 additions & 28 deletions compiler/rustc_attr/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use rustc_span::Span;
use rustc_span::hygiene::Transparency;
use rustc_span::symbol::{Symbol, kw, sym};

use crate::fluent_generated;
use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause};

/// The version placeholder that recently stabilized features contain inside the
Expand Down Expand Up @@ -709,33 +708,6 @@ pub fn eval_condition(

!eval_condition(mi, sess, features, eval)
}
sym::target => {
if let Some(features) = features
&& !features.cfg_target_compact
{
feature_err(
sess,
sym::cfg_target_compact,
cfg.span,
fluent_generated::attr_unstable_cfg_target_compact,
)
.emit();
}

mis.iter().fold(true, |res, mi| {
let mut mi = mi.meta_item().unwrap().clone();
if let [seg, ..] = &mut mi.path.segments[..] {
seg.ident.name = Symbol::intern(&format!("target_{}", seg.ident.name));
}

res & eval_condition(
&ast::MetaItemInner::MetaItem(mi),
sess,
features,
eval,
)
})
}
_ => {
dcx.emit_err(session_diagnostics::InvalidPredicate {
span: cfg.span,
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ declare_features! (
(removed, box_syntax, "1.70.0", Some(49733), Some("replaced with `#[rustc_box]`")),
/// Allows capturing disjoint fields in a closure/coroutine (RFC 2229).
(removed, capture_disjoint_fields, "1.49.0", Some(53488), Some("stabilized in Rust 2021")),
/// Allows `cfg(target(abi = "..."))`.
(removed, cfg_target_compact, "CURRENT_RUSTC_VERSION", Some(96901),
Some("removed due to lack of usefulness and users")),
/// Allows comparing raw pointers during const eval.
(removed, const_compare_raw_pointers, "1.46.0", Some(53020),
Some("cannot be allowed in const eval in any meaningful way")),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ declare_features! (
(unstable, cfg_sanitize, "1.41.0", Some(39699)),
/// Allows `cfg(sanitizer_cfi_generalize_pointers)` and `cfg(sanitizer_cfi_normalize_integers)`.
(unstable, cfg_sanitizer_cfi, "1.77.0", Some(89653)),
/// Allows `cfg(target(abi = "..."))`.
(unstable, cfg_target_compact, "1.63.0", Some(96901)),
/// Allows `cfg(target_has_atomic_load_store = "...")`.
(unstable, cfg_target_has_atomic, "1.60.0", Some(94039)),
/// Allows `cfg(target_has_atomic_equal_alignment = "...")`.
Expand Down
17 changes: 0 additions & 17 deletions tests/ui/cfg/cfg-target-compact-errors.rs

This file was deleted.

22 changes: 0 additions & 22 deletions tests/ui/cfg/cfg-target-compact-errors.stderr

This file was deleted.

10 changes: 0 additions & 10 deletions tests/ui/cfg/cfg-target-compact.rs

This file was deleted.

16 changes: 0 additions & 16 deletions tests/ui/check-cfg/compact-names.rs

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/check-cfg/compact-names.stderr

This file was deleted.

16 changes: 0 additions & 16 deletions tests/ui/check-cfg/compact-values.rs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/check-cfg/compact-values.stderr

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/feature-gates/feature-gate-cfg-target-compact.rs

This file was deleted.

43 changes: 0 additions & 43 deletions tests/ui/feature-gates/feature-gate-cfg-target-compact.stderr

This file was deleted.

0 comments on commit 1de1d84

Please sign in to comment.