Rollup merge of #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
This commit is contained in:
Jakub Beránek
2025-04-07 08:23:34 +02:00
committed by GitHub
4 changed files with 4 additions and 7 deletions
+1
View File
@@ -4589,6 +4589,7 @@ version = "0.0.0"
dependencies = [
"bitflags",
"derive-where",
"ena",
"indexmap",
"rustc-hash 1.1.0",
"rustc_ast_ir",
+1
View File
@@ -7,6 +7,7 @@ edition = "2024"
# tidy-alphabetical-start
bitflags = "2.4.1"
derive-where = "1.2.7"
ena = "0.14.3"
indexmap = "2.0.0"
rustc-hash = "1.1.0"
rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false }
@@ -1,5 +1,6 @@
use std::hash::BuildHasherDefault;
pub use ena::unify::{NoError, UnifyKey, UnifyValue};
use rustc_hash::FxHasher;
pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
+1 -7
View File
@@ -6,9 +6,8 @@
#[cfg(feature = "nightly")]
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
#[cfg(feature = "nightly")]
use rustc_data_structures::unify::{NoError, UnifyKey, UnifyValue};
#[cfg(feature = "nightly")]
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_NoContext};
use rustc_type_ir::data_structures::{NoError, UnifyKey, UnifyValue};
use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
use self::TyKind::*;
@@ -796,7 +795,6 @@ pub enum InferTy {
/// Raw `TyVid` are used as the unification key for `sub_relations`;
/// they carry no values.
#[cfg(feature = "nightly")]
impl UnifyKey for TyVid {
type Value = ();
#[inline]
@@ -812,7 +810,6 @@ fn tag() -> &'static str {
}
}
#[cfg(feature = "nightly")]
impl UnifyValue for IntVarValue {
type Error = NoError;
@@ -832,7 +829,6 @@ fn unify_values(value1: &Self, value2: &Self) -> Result<Self, Self::Error> {
}
}
#[cfg(feature = "nightly")]
impl UnifyKey for IntVid {
type Value = IntVarValue;
#[inline] // make this function eligible for inlining - it is quite hot.
@@ -848,7 +844,6 @@ fn tag() -> &'static str {
}
}
#[cfg(feature = "nightly")]
impl UnifyValue for FloatVarValue {
type Error = NoError;
@@ -866,7 +861,6 @@ fn unify_values(value1: &Self, value2: &Self) -> Result<Self, Self::Error> {
}
}
#[cfg(feature = "nightly")]
impl UnifyKey for FloatVid {
type Value = FloatVarValue;
#[inline]