Skip to content

Commit 25cbc3f

Browse files
committed
Add some docs regarding rustc_abi rust-analyzer compat changes
1 parent 7bca53a commit 25cbc3f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_abi/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ rustc_serialize = { path = "../rustc_serialize", optional = true }
1515

1616
[features]
1717
default = ["nightly", "randomize"]
18-
randomize = ["rand", "rand_xoshiro"]
18+
randomize = ["rand", "rand_xoshiro", "nightly"]
19+
# rust-analyzer depends on this crate and we therefore require it to built on a stable toolchain
20+
# without depending on rustc_data_structures, rustc_macros and rustc_serialize
1921
nightly = [
2022
"rustc_data_structures",
2123
"rustc_index/nightly",

compiler/rustc_abi/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@ impl Scalar {
11001100
}
11011101
}
11021102

1103+
// NOTE: This struct is generic over the FieldIdx for rust-analyzer usage.
11031104
/// Describes how the fields of a type are located in memory.
11041105
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
11051106
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
@@ -1354,6 +1355,7 @@ impl Abi {
13541355
}
13551356
}
13561357

1358+
// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
13571359
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
13581360
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
13591361
pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
@@ -1374,6 +1376,7 @@ pub enum Variants<FieldIdx: Idx, VariantIdx: Idx> {
13741376
},
13751377
}
13761378

1379+
// NOTE: This struct is generic over the VariantIdx for rust-analyzer usage.
13771380
#[derive(PartialEq, Eq, Hash, Clone, Debug)]
13781381
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
13791382
pub enum TagEncoding<VariantIdx: Idx> {
@@ -1482,6 +1485,7 @@ impl Niche {
14821485
}
14831486
}
14841487

1488+
// NOTE: This struct is generic over the FieldIdx and VariantIdx for rust-analyzer usage.
14851489
#[derive(PartialEq, Eq, Hash, Clone)]
14861490
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
14871491
pub struct LayoutS<FieldIdx: Idx, VariantIdx: Idx> {

0 commit comments

Comments
 (0)