Explicitly depend on ena in rustc_type_ir and make the UnifyKey and UnifyValue imports non-nightly

This commit is contained in:
jackh726 2025-04-05 18:21:22 +00:00
parent bad13a970a
commit cd4453fdba
4 changed files with 4 additions and 7 deletions

View file

@ -4581,6 +4581,7 @@ version = "0.0.0"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"derive-where", "derive-where",
"ena",
"indexmap", "indexmap",
"rustc-hash 1.1.0", "rustc-hash 1.1.0",
"rustc_ast_ir", "rustc_ast_ir",

View file

@ -7,6 +7,7 @@ edition = "2024"
# tidy-alphabetical-start # tidy-alphabetical-start
bitflags = "2.4.1" bitflags = "2.4.1"
derive-where = "1.2.7" derive-where = "1.2.7"
ena = "0.14.3"
indexmap = "2.0.0" indexmap = "2.0.0"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"
rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false } rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false }

View file

@ -1,5 +1,6 @@
use std::hash::BuildHasherDefault; use std::hash::BuildHasherDefault;
pub use ena::unify::{NoError, UnifyKey, UnifyValue};
use rustc_hash::FxHasher; use rustc_hash::FxHasher;
pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet}; pub use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};

View file

@ -6,9 +6,8 @@ use rustc_ast_ir::Mutability;
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
#[cfg(feature = "nightly")] #[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_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 rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic};
use self::TyKind::*; use self::TyKind::*;
@ -796,7 +795,6 @@ pub enum InferTy {
/// Raw `TyVid` are used as the unification key for `sub_relations`; /// Raw `TyVid` are used as the unification key for `sub_relations`;
/// they carry no values. /// they carry no values.
#[cfg(feature = "nightly")]
impl UnifyKey for TyVid { impl UnifyKey for TyVid {
type Value = (); type Value = ();
#[inline] #[inline]
@ -812,7 +810,6 @@ impl UnifyKey for TyVid {
} }
} }
#[cfg(feature = "nightly")]
impl UnifyValue for IntVarValue { impl UnifyValue for IntVarValue {
type Error = NoError; type Error = NoError;
@ -832,7 +829,6 @@ impl UnifyValue for IntVarValue {
} }
} }
#[cfg(feature = "nightly")]
impl UnifyKey for IntVid { impl UnifyKey for IntVid {
type Value = IntVarValue; type Value = IntVarValue;
#[inline] // make this function eligible for inlining - it is quite hot. #[inline] // make this function eligible for inlining - it is quite hot.
@ -848,7 +844,6 @@ impl UnifyKey for IntVid {
} }
} }
#[cfg(feature = "nightly")]
impl UnifyValue for FloatVarValue { impl UnifyValue for FloatVarValue {
type Error = NoError; type Error = NoError;
@ -866,7 +861,6 @@ impl UnifyValue for FloatVarValue {
} }
} }
#[cfg(feature = "nightly")]
impl UnifyKey for FloatVid { impl UnifyKey for FloatVid {
type Value = FloatVarValue; type Value = FloatVarValue;
#[inline] #[inline]