Skip to content

Commit cd4453f

Browse files
committedApr 6, 2025·
Explicitly depend on ena in rustc_type_ir and make the UnifyKey and UnifyValue imports non-nightly
1 parent bad13a9 commit cd4453f

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed
 

‎Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4581,6 +4581,7 @@ version = "0.0.0"
45814581
dependencies = [
45824582
"bitflags",
45834583
"derive-where",
4584+
"ena",
45844585
"indexmap",
45854586
"rustc-hash 1.1.0",
45864587
"rustc_ast_ir",

‎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 }

‎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

‎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)
Please sign in to comment.