about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2025-02-09 23:03:24 -0800
committerJubilee Young <workingjubilee@gmail.com>2025-02-11 18:55:48 -0800
commitd9c7abba55762f7ec25fc1d9a322f26896381e4f (patch)
treee61da1f158ae00f5d1fcb620946096c94e48863b
parent34a5ea911c56e79bd451c63f04ea2f5023d7d1a3 (diff)
downloadrust-d9c7abba55762f7ec25fc1d9a322f26896381e4f.tar.gz
rust-d9c7abba55762f7ec25fc1d9a322f26896381e4f.zip
compiler: narrow scope of nightly cfg in rustc_abi
-rw-r--r--compiler/rustc_abi/src/extern_abi.rs3
-rw-r--r--compiler/rustc_abi/src/lib.rs6
2 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_abi/src/extern_abi.rs b/compiler/rustc_abi/src/extern_abi.rs
index f3cf7f583ce..a4dc87247a0 100644
--- a/compiler/rustc_abi/src/extern_abi.rs
+++ b/compiler/rustc_abi/src/extern_abi.rs
@@ -1,5 +1,6 @@
 use std::fmt;
 
+#[cfg(feature = "nightly")]
 use rustc_macros::{Decodable, Encodable, HashStable_Generic};
 
 #[cfg(test)]
@@ -8,7 +9,7 @@ mod tests;
 use ExternAbi as Abi;
 
 #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug)]
-#[derive(HashStable_Generic, Encodable, Decodable)]
+#[cfg_attr(feature = "nightly", derive(HashStable_Generic, Encodable, Decodable))]
 pub enum ExternAbi {
     // Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
     // hashing tests. These are used in many places, so giving them stable values reduces test
diff --git a/compiler/rustc_abi/src/lib.rs b/compiler/rustc_abi/src/lib.rs
index 259f1c18ea8..1e4685dc2a3 100644
--- a/compiler/rustc_abi/src/lib.rs
+++ b/compiler/rustc_abi/src/lib.rs
@@ -52,20 +52,16 @@ use bitflags::bitflags;
 use rustc_data_structures::stable_hasher::StableOrd;
 use rustc_index::{Idx, IndexSlice, IndexVec};
 #[cfg(feature = "nightly")]
-use rustc_macros::HashStable_Generic;
-#[cfg(feature = "nightly")]
-use rustc_macros::{Decodable_Generic, Encodable_Generic};
+use rustc_macros::{Decodable_Generic, Encodable_Generic, HashStable_Generic};
 
 mod callconv;
 mod layout;
 #[cfg(test)]
 mod tests;
 
-#[cfg(feature = "nightly")]
 mod extern_abi;
 
 pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
-#[cfg(feature = "nightly")]
 pub use extern_abi::{AbiDatas, AbiUnsupported, ExternAbi, all_names, lookup};
 #[cfg(feature = "nightly")]
 pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};