Skip to content

Commit f4177f4

Browse files
authored
Rollup merge of rust-lang#139426 - jackh726:rust-analyzer-next-solver-new, r=lcnr
Make the UnifyKey and UnifyValue imports non-nightly Explicitly depend on ena in rustc_type_ir and import types from there. This is required for rust-analyzer to use the new solver. r? types
2 parents 5a43d92 + cd4453f commit f4177f4

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

Diff for: Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4589,6 +4589,7 @@ version = "0.0.0"
45894589
dependencies = [
45904590
"bitflags",
45914591
"derive-where",
4592+
"ena",
45924593
"indexmap",
45934594
"rustc-hash 1.1.0",
45944595
"rustc_ast_ir",

Diff for: compiler/rustc_type_ir/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ edition = "2024"
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
99
derive-where = "1.2.7"
10+
ena = "0.14.3"
1011
indexmap = "2.0.0"
1112
rustc-hash = "1.1.0"
1213
rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false }

Diff for: compiler/rustc_type_ir/src/data_structures/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::hash::BuildHasherDefault;
22

3+
pub use ena::unify::{NoError, UnifyKey, UnifyValue};
34
use rustc_hash::FxHasher;
45
pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
56

Diff for: compiler/rustc_type_ir/src/ty_kind.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ use rustc_ast_ir::Mutability;
66
#[cfg(feature = "nightly")]
77
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
88
#[cfg(feature = "nightly")]
9-
use rustc_data_structures::unify::{NoError, UnifyKey, UnifyValue};
10-
#[cfg(feature = "nightly")]
119
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext};
10+
use rustc_type_ir::data_structures::{NoError, UnifyKey, UnifyValue};
1211
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
1312

1413
use self::TyKind::*;
@@ -796,7 +795,6 @@ pub enum InferTy {
796795

797796
/// Raw `TyVid` are used as the unification key for `sub_relations`;
798797
/// they carry no values.
799-
#[cfg(feature = "nightly")]
800798
impl UnifyKey for TyVid {
801799
type Value = ();
802800
#[inline]
@@ -812,7 +810,6 @@ impl UnifyKey for TyVid {
812810
}
813811
}
814812

815-
#[cfg(feature = "nightly")]
816813
impl UnifyValue for IntVarValue {
817814
type Error = NoError;
818815

@@ -832,7 +829,6 @@ impl UnifyValue for IntVarValue {
832829
}
833830
}
834831

835-
#[cfg(feature = "nightly")]
836832
impl UnifyKey for IntVid {
837833
type Value = IntVarValue;
838834
#[inline] // make this function eligible for inlining - it is quite hot.
@@ -848,7 +844,6 @@ impl UnifyKey for IntVid {
848844
}
849845
}
850846

851-
#[cfg(feature = "nightly")]
852847
impl UnifyValue for FloatVarValue {
853848
type Error = NoError;
854849

@@ -866,7 +861,6 @@ impl UnifyValue for FloatVarValue {
866861
}
867862
}
868863

869-
#[cfg(feature = "nightly")]
870864
impl UnifyKey for FloatVid {
871865
type Value = FloatVarValue;
872866
#[inline]

0 commit comments

Comments
 (0)