Rollup merge of #136191 - klensy:const_a, r=compiler-errors
compiler: replace few consts arrays with statics to remove const dupes Locally on `x86_64-pc-windows-msvc` -100kb for `rustc_driver.dll`
This commit is contained in:
commit
3ce7d9c638
7 changed files with 15 additions and 15 deletions
|
@ -9,7 +9,7 @@ macro_rules! declare_features {
|
||||||
$(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr),
|
$(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr),
|
||||||
)+) => {
|
)+) => {
|
||||||
/// Formerly unstable features that have now been accepted (stabilized).
|
/// Formerly unstable features that have now been accepted (stabilized).
|
||||||
pub const ACCEPTED_LANG_FEATURES: &[Feature] = &[
|
pub static ACCEPTED_LANG_FEATURES: &[Feature] = &[
|
||||||
$(Feature {
|
$(Feature {
|
||||||
name: sym::$feature,
|
name: sym::$feature,
|
||||||
since: $ver,
|
since: $ver,
|
||||||
|
|
|
@ -318,7 +318,7 @@ pub struct BuiltinAttribute {
|
||||||
|
|
||||||
/// Attributes that have a special meaning to rustc or rustdoc.
|
/// Attributes that have a special meaning to rustc or rustdoc.
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Stable attributes:
|
// Stable attributes:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
|
@ -14,7 +14,7 @@ macro_rules! declare_features {
|
||||||
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr),
|
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr),
|
||||||
)+) => {
|
)+) => {
|
||||||
/// Formerly unstable features that have now been removed.
|
/// Formerly unstable features that have now been removed.
|
||||||
pub const REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
|
pub static REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
|
||||||
$(RemovedFeature {
|
$(RemovedFeature {
|
||||||
feature: Feature {
|
feature: Feature {
|
||||||
name: sym::$feature,
|
name: sym::$feature,
|
||||||
|
|
|
@ -104,7 +104,7 @@ macro_rules! declare_features {
|
||||||
)+) => {
|
)+) => {
|
||||||
/// Unstable language features that are being implemented or being
|
/// Unstable language features that are being implemented or being
|
||||||
/// considered for acceptance (stabilization) or removal.
|
/// considered for acceptance (stabilization) or removal.
|
||||||
pub const UNSTABLE_LANG_FEATURES: &[Feature] = &[
|
pub static UNSTABLE_LANG_FEATURES: &[Feature] = &[
|
||||||
$(Feature {
|
$(Feature {
|
||||||
name: sym::$feature,
|
name: sym::$feature,
|
||||||
since: $ver,
|
since: $ver,
|
||||||
|
|
|
@ -8,7 +8,7 @@ use crate::errors::TokenSubstitution;
|
||||||
use crate::token::{self, Delimiter};
|
use crate::token::{self, Delimiter};
|
||||||
|
|
||||||
#[rustfmt::skip] // for line breaks
|
#[rustfmt::skip] // for line breaks
|
||||||
pub(super) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
|
pub(super) static UNICODE_ARRAY: &[(char, &str, &str)] = &[
|
||||||
('
', "Line Separator", " "),
|
('
', "Line Separator", " "),
|
||||||
('
', "Paragraph Separator", " "),
|
('
', "Paragraph Separator", " "),
|
||||||
(' ', "Ogham Space mark", " "),
|
(' ', "Ogham Space mark", " "),
|
||||||
|
|
|
@ -1651,7 +1651,7 @@ macro_rules! supported_targets {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List of supported targets
|
/// List of supported targets
|
||||||
pub const TARGETS: &[&str] = &[$($tuple),+];
|
pub static TARGETS: &[&str] = &[$($tuple),+];
|
||||||
|
|
||||||
fn load_builtin(target: &str) -> Option<Target> {
|
fn load_builtin(target: &str) -> Option<Target> {
|
||||||
let t = match target {
|
let t = match target {
|
||||||
|
|
|
@ -131,7 +131,7 @@ impl Stability {
|
||||||
// Both of these are also applied transitively.
|
// Both of these are also applied transitively.
|
||||||
type ImpliedFeatures = &'static [&'static str];
|
type ImpliedFeatures = &'static [&'static str];
|
||||||
|
|
||||||
const ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("aclass", Unstable(sym::arm_target_feature), &[]),
|
("aclass", Unstable(sym::arm_target_feature), &[]),
|
||||||
("aes", Unstable(sym::arm_target_feature), &["neon"]),
|
("aes", Unstable(sym::arm_target_feature), &["neon"]),
|
||||||
|
@ -175,7 +175,7 @@ const ARM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static AARCH64_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
// FEAT_AES & FEAT_PMULL
|
// FEAT_AES & FEAT_PMULL
|
||||||
("aes", Stable, &["neon"]),
|
("aes", Stable, &["neon"]),
|
||||||
|
@ -371,7 +371,7 @@ const AARCH64_TIED_FEATURES: &[&[&str]] = &[
|
||||||
&["paca", "pacg"], // Together these represent `pauth` in LLVM
|
&["paca", "pacg"], // Together these represent `pauth` in LLVM
|
||||||
];
|
];
|
||||||
|
|
||||||
const X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("adx", Stable, &[]),
|
("adx", Stable, &[]),
|
||||||
("aes", Stable, &["sse2"]),
|
("aes", Stable, &["sse2"]),
|
||||||
|
@ -453,7 +453,7 @@ const HEXAGON_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static POWERPC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("altivec", Unstable(sym::powerpc_target_feature), &[]),
|
("altivec", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
("partword-atomics", Unstable(sym::powerpc_target_feature), &[]),
|
||||||
|
@ -476,7 +476,7 @@ const MIPS_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("a", Stable, &["zaamo", "zalrsc"]),
|
("a", Stable, &["zaamo", "zalrsc"]),
|
||||||
("c", Stable, &[]),
|
("c", Stable, &[]),
|
||||||
|
@ -521,7 +521,7 @@ const RISCV_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("atomics", Unstable(sym::wasm_target_feature), &[]),
|
("atomics", Unstable(sym::wasm_target_feature), &[]),
|
||||||
("bulk-memory", Stable, &[]),
|
("bulk-memory", Stable, &[]),
|
||||||
|
@ -542,7 +542,7 @@ const WASM_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
const BPF_FEATURES: &[(&str, Stability, ImpliedFeatures)] =
|
const BPF_FEATURES: &[(&str, Stability, ImpliedFeatures)] =
|
||||||
&[("alu32", Unstable(sym::bpf_target_feature), &[])];
|
&[("alu32", Unstable(sym::bpf_target_feature), &[])];
|
||||||
|
|
||||||
const CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("10e60", Unstable(sym::csky_target_feature), &["7e10"]),
|
("10e60", Unstable(sym::csky_target_feature), &["7e10"]),
|
||||||
("2e3", Unstable(sym::csky_target_feature), &["e2"]),
|
("2e3", Unstable(sym::csky_target_feature), &["e2"]),
|
||||||
|
@ -589,7 +589,7 @@ const CSKY_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static LOONGARCH_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("d", Unstable(sym::loongarch_target_feature), &["f"]),
|
("d", Unstable(sym::loongarch_target_feature), &["f"]),
|
||||||
("f", Unstable(sym::loongarch_target_feature), &[]),
|
("f", Unstable(sym::loongarch_target_feature), &[]),
|
||||||
|
@ -618,7 +618,7 @@ const SPARC_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-end
|
// tidy-alphabetical-end
|
||||||
];
|
];
|
||||||
|
|
||||||
const M68K_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
static M68K_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("isa-68000", Unstable(sym::m68k_target_feature), &[]),
|
("isa-68000", Unstable(sym::m68k_target_feature), &[]),
|
||||||
("isa-68010", Unstable(sym::m68k_target_feature), &["isa-68000"]),
|
("isa-68010", Unstable(sym::m68k_target_feature), &["isa-68000"]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue