Skip to content

Commit b25c845

Browse files
committed
Add some docs regarding rustc_abi rust-analyzer compat changes
1 parent 6d141c1 commit b25c845

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_abi/Cargo.toml

+3-1
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

+4
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ impl Scalar {
11021102
}
11031103
}
11041104

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

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

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

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

0 commit comments

Comments
 (0)