File tree Expand file tree Collapse file tree 5 files changed +24
-1
lines changed
src/tools/rust-analyzer/crates/hir-ty/src/next_solver Expand file tree Collapse file tree 5 files changed +24
-1
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 1- pub use ra_ap_rustc_next_trait_solver :: solve:: inspect:: * ;
1+ pub use rustc_next_trait_solver :: solve:: inspect:: * ;
22
33use rustc_ast_ir:: try_visit;
44use rustc_next_trait_solver:: {
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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+ }
You can’t perform that action at this time.
0 commit comments