Skip to content

Commit c7ebe4a

Browse files
committed
Try to fix build
1 parent 9348de0 commit c7ebe4a

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/consts.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ impl<'db> Const<'db> {
3636
internee: kind,
3737
flags: flags.flags,
3838
outer_exclusive_binder: flags.outer_exclusive_binder,
39+
#[cfg(feature = "in-rust-tree")]
40+
stable_hash: {
41+
// SAFETY: These have the same layout.
42+
unsafe { std::mem::transmute(crate::next_solver::util::Fingerprint::ZERO) }
43+
},
3944
};
4045
Const::new_(interner.db(), InternedWrapperNoDebug(cached))
4146
}

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/inspect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub use ra_ap_rustc_next_trait_solver::solve::inspect::*;
1+
pub use rustc_next_trait_solver::solve::inspect::*;
22

33
use rustc_ast_ir::try_visit;
44
use rustc_next_trait_solver::{

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/predicate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ impl<'db> Predicate<'db> {
227227
internee: kind,
228228
flags: flags.flags,
229229
outer_exclusive_binder: flags.outer_exclusive_binder,
230+
#[cfg(feature = "in-rust-tree")]
231+
stable_hash: {
232+
// SAFETY: These have the same layout.
233+
unsafe { std::mem::transmute(crate::next_solver::util::Fingerprint::ZERO) }
234+
},
230235
};
231236
Predicate::new_(interner.db(), InternedWrapperNoDebug(cached))
232237
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ impl<'db> Ty<'db> {
6060
internee: kind,
6161
flags: flags.flags,
6262
outer_exclusive_binder: flags.outer_exclusive_binder,
63+
#[cfg(feature = "in-rust-tree")]
64+
stable_hash: {
65+
// SAFETY: These have the same layout.
66+
unsafe { std::mem::transmute(crate::next_solver::util::Fingerprint::ZERO) }
67+
},
6368
};
6469
Ty::new_(interner.db(), InternedWrapperNoDebug(cached))
6570
}

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/util.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,3 +1062,11 @@ pub fn sizedness_fast_path<'db>(
10621062

10631063
false
10641064
}
1065+
1066+
/// This is a copy of [`rustc_data_structures::fingerprint::Fingerprint`], which we can't construct on stable.
1067+
#[repr(C)]
1068+
pub struct Fingerprint(u64, u64);
1069+
1070+
impl Fingerprint {
1071+
pub const ZERO: Fingerprint = Fingerprint(0, 0);
1072+
}

0 commit comments

Comments
 (0)