@@ -2,12 +2,13 @@ use std::fmt;
2
2
use std:: ops:: Deref ;
3
3
4
4
use derive_where:: derive_where;
5
+ // We *would* normally import these through `rustc_data_structures`, but external
6
+ // users (i.e. rust-analyzer) may need the impls for these traits.
7
+ use ena:: unify:: { NoError , UnifyKey , UnifyValue } ;
5
8
use rustc_ast_ir:: Mutability ;
6
9
#[ cfg( feature = "nightly" ) ]
7
10
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
8
11
#[ cfg( feature = "nightly" ) ]
9
- use rustc_data_structures:: unify:: { NoError , UnifyKey , UnifyValue } ;
10
- #[ cfg( feature = "nightly" ) ]
11
12
use rustc_macros:: { Decodable_NoContext , Encodable_NoContext , HashStable_NoContext } ;
12
13
use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
13
14
@@ -796,7 +797,6 @@ pub enum InferTy {
796
797
797
798
/// Raw `TyVid` are used as the unification key for `sub_relations`;
798
799
/// they carry no values.
799
- #[ cfg( feature = "nightly" ) ]
800
800
impl UnifyKey for TyVid {
801
801
type Value = ( ) ;
802
802
#[ inline]
@@ -812,7 +812,6 @@ impl UnifyKey for TyVid {
812
812
}
813
813
}
814
814
815
- #[ cfg( feature = "nightly" ) ]
816
815
impl UnifyValue for IntVarValue {
817
816
type Error = NoError ;
818
817
@@ -832,7 +831,6 @@ impl UnifyValue for IntVarValue {
832
831
}
833
832
}
834
833
835
- #[ cfg( feature = "nightly" ) ]
836
834
impl UnifyKey for IntVid {
837
835
type Value = IntVarValue ;
838
836
#[ inline] // make this function eligible for inlining - it is quite hot.
@@ -848,7 +846,6 @@ impl UnifyKey for IntVid {
848
846
}
849
847
}
850
848
851
- #[ cfg( feature = "nightly" ) ]
852
849
impl UnifyValue for FloatVarValue {
853
850
type Error = NoError ;
854
851
@@ -866,7 +863,6 @@ impl UnifyValue for FloatVarValue {
866
863
}
867
864
}
868
865
869
- #[ cfg( feature = "nightly" ) ]
870
866
impl UnifyKey for FloatVid {
871
867
type Value = FloatVarValue ;
872
868
#[ inline]
0 commit comments