Skip to content

Commit d9c7abb

Browse files
compiler: narrow scope of nightly cfg in rustc_abi
1 parent 34a5ea9 commit d9c7abb

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

compiler/rustc_abi/src/extern_abi.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::fmt;
22

3+
#[cfg(feature = "nightly")]
34
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
45

56
#[cfg(test)]
@@ -8,7 +9,7 @@ mod tests;
89
use ExternAbi as Abi;
910

1011
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug)]
11-
#[derive(HashStable_Generic, Encodable, Decodable)]
12+
#[cfg_attr(feature = "nightly", derive(HashStable_Generic, Encodable, Decodable))]
1213
pub enum ExternAbi {
1314
// Some of the ABIs come first because every time we add a new ABI, we have to re-bless all the
1415
// hashing tests. These are used in many places, so giving them stable values reduces test

compiler/rustc_abi/src/lib.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,16 @@ use bitflags::bitflags;
5252
use rustc_data_structures::stable_hasher::StableOrd;
5353
use rustc_index::{Idx, IndexSlice, IndexVec};
5454
#[cfg(feature = "nightly")]
55-
use rustc_macros::HashStable_Generic;
56-
#[cfg(feature = "nightly")]
57-
use rustc_macros::{Decodable_Generic, Encodable_Generic};
55+
use rustc_macros::{Decodable_Generic, Encodable_Generic, HashStable_Generic};
5856

5957
mod callconv;
6058
mod layout;
6159
#[cfg(test)]
6260
mod tests;
6361

64-
#[cfg(feature = "nightly")]
6562
mod extern_abi;
6663

6764
pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
68-
#[cfg(feature = "nightly")]
6965
pub use extern_abi::{AbiDatas, AbiUnsupported, ExternAbi, all_names, lookup};
7066
#[cfg(feature = "nightly")]
7167
pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};

0 commit comments

Comments
 (0)