Skip to content

Remove unstable cfg target(...) compact feature #130780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions compiler/rustc_attr_parsing/messages.ftl
Original file line number Diff line number Diff line change
@@ -115,9 +115,6 @@ attr_parsing_unrecognized_repr_hint =
unrecognized representation hint
.help = valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
attr_parsing_unstable_cfg_target_compact =
compact `cfg(target(..))` is experimental and subject to change
attr_parsing_unsupported_literal_cfg_boolean =
literal in `cfg` predicate value must be a boolean
attr_parsing_unsupported_literal_cfg_string =
30 changes: 1 addition & 29 deletions compiler/rustc_attr_parsing/src/attributes/cfg.rs
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ use rustc_session::lint::builtin::UNEXPECTED_CFGS;
use rustc_session::parse::feature_err;
use rustc_span::{Span, Symbol, sym};

use crate::parse_version;
use crate::session_diagnostics::{self, UnsupportedLiteralReason};
use crate::{fluent_generated, parse_version};

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

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

mis.iter().fold(true, |res, mi| {
let Some(mut mi) = mi.meta_item().cloned() else {
dcx.emit_err(session_diagnostics::CfgPredicateIdentifier {
span: mi.span(),
});
return false;
};

if let [seg, ..] = &mut mi.path.segments[..] {
seg.ident.name = Symbol::intern(&format!("target_{}", seg.ident.name));
}

res & eval_condition(&MetaItemInner::MetaItem(mi), sess, features, eval)
})
}
_ => {
dcx.emit_err(session_diagnostics::InvalidPredicate {
span: cfg.span,
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
@@ -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")),
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
@@ -401,8 +401,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 = "...")`.
21 changes: 0 additions & 21 deletions tests/ui/cfg/cfg-target-compact-errors.rs

This file was deleted.

28 changes: 0 additions & 28 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.

12 changes: 0 additions & 12 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.