Skip to content

Commit e8bb26c

Browse files
committed
Fix rust-analyzer
1 parent 1d7cf0f commit e8bb26c

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

src/tools/rust-analyzer/crates/hir-def/src/data/adt.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use hir_expand::name::Name;
99
use intern::sym;
1010
use la_arena::Arena;
1111
use rustc_abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
12+
use rustc_data_structures::stable_hasher::Hash64;
1213
use triomphe::Arc;
1314
use tt::iter::TtElement;
1415

@@ -172,7 +173,7 @@ fn parse_repr_tt(tt: &TopSubtree) -> Option<ReprOptions> {
172173
}
173174
}
174175

175-
Some(ReprOptions { int, align: max_align, pack: min_pack, flags, field_shuffle_seed: 0 })
176+
Some(ReprOptions { int, align: max_align, pack: min_pack, flags, field_shuffle_seed: Hash64::ZERO })
176177
}
177178

178179
impl StructData {

src/tools/rust-analyzer/crates/hir-def/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ extern crate ra_ap_rustc_parse_format as rustc_parse_format;
1818
#[cfg(feature = "in-rust-tree")]
1919
extern crate rustc_abi;
2020

21+
#[cfg(feature = "in-rust-tree")]
22+
extern crate rustc_data_structures;
23+
2124
#[cfg(not(feature = "in-rust-tree"))]
2225
extern crate ra_ap_rustc_abi as rustc_abi;
2326

27+
#[cfg(not(feature = "in-rust-tree"))]
28+
extern crate ra_ap_rustc_data_structures as rustc_data_structures;
29+
2430
pub mod db;
2531

2632
pub mod attr;

src/tools/rust-analyzer/crates/hir-ty/src/layout.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use hir_def::{
1515
use la_arena::{Idx, RawIdx};
1616
use rustc_abi::AddressSpace;
1717
use rustc_index::{IndexSlice, IndexVec};
18+
use rustc_data_structures::stable_hasher::Hash64;
1819

1920
use triomphe::Arc;
2021

@@ -197,7 +198,7 @@ fn layout_of_simd_ty(
197198
align,
198199
max_repr_align: None,
199200
unadjusted_abi_align: align.abi,
200-
randomization_seed: 0,
201+
randomization_seed: Hash64::ZERO,
201202
}))
202203
}
203204

@@ -314,7 +315,7 @@ pub fn layout_of_ty_query(
314315
size,
315316
max_repr_align: None,
316317
unadjusted_abi_align: element.align.abi,
317-
randomization_seed: 0,
318+
randomization_seed: Hash64::ZERO,
318319
}
319320
}
320321
TyKind::Slice(element) => {
@@ -328,7 +329,7 @@ pub fn layout_of_ty_query(
328329
size: Size::ZERO,
329330
max_repr_align: None,
330331
unadjusted_abi_align: element.align.abi,
331-
randomization_seed: 0,
332+
randomization_seed: Hash64::ZERO,
332333
}
333334
}
334335
TyKind::Str => Layout {
@@ -340,7 +341,7 @@ pub fn layout_of_ty_query(
340341
size: Size::ZERO,
341342
max_repr_align: None,
342343
unadjusted_abi_align: dl.i8_align.abi,
343-
randomization_seed: 0,
344+
randomization_seed: Hash64::ZERO,
344345
},
345346
// Potentially-wide pointers.
346347
TyKind::Ref(_, _, pointee) | TyKind::Raw(_, pointee) => {

src/tools/rust-analyzer/crates/hir-ty/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ extern crate ra_ap_rustc_index as rustc_index;
1212
#[cfg(feature = "in-rust-tree")]
1313
extern crate rustc_abi;
1414

15+
#[cfg(feature = "in-rust-tree")]
16+
extern crate rustc_data_structures;
17+
1518
#[cfg(not(feature = "in-rust-tree"))]
1619
extern crate ra_ap_rustc_abi as rustc_abi;
1720

@@ -21,6 +24,9 @@ extern crate rustc_pattern_analysis;
2124
#[cfg(not(feature = "in-rust-tree"))]
2225
extern crate ra_ap_rustc_pattern_analysis as rustc_pattern_analysis;
2326

27+
#[cfg(not(feature = "in-rust-tree"))]
28+
extern crate ra_ap_rustc_data_structures as rustc_data_structures;
29+
2430
mod builder;
2531
mod chalk_db;
2632
mod chalk_ext;

0 commit comments

Comments
 (0)