1
1
use std:: fmt;
2
2
3
3
use derive_where:: derive_where;
4
+ // We *would* normally import these through `rustc_data_structures`, but external
5
+ // users (i.e. rust-analyzer) may need the impls for these traits.
6
+ use ena:: unify:: { NoError , UnifyKey , UnifyValue } ;
4
7
use rustc_ast_ir:: Mutability ;
5
8
#[ cfg( feature = "nightly" ) ]
6
9
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
7
10
#[ cfg( feature = "nightly" ) ]
8
- use rustc_data_structures:: unify:: { NoError , UnifyKey , UnifyValue } ;
9
- #[ cfg( feature = "nightly" ) ]
10
11
use rustc_macros:: { Decodable , Encodable , HashStable_NoContext , TyDecodable , TyEncodable } ;
11
12
use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
12
13
@@ -645,7 +646,6 @@ rustc_index::newtype_index! {
645
646
#[ encodable]
646
647
#[ orderable]
647
648
#[ debug_format = "?{}t" ]
648
- #[ gate_rustc_only]
649
649
pub struct TyVid { }
650
650
}
651
651
@@ -654,7 +654,6 @@ rustc_index::newtype_index! {
654
654
#[ encodable]
655
655
#[ orderable]
656
656
#[ debug_format = "?{}i" ]
657
- #[ gate_rustc_only]
658
657
pub struct IntVid { }
659
658
}
660
659
@@ -663,7 +662,6 @@ rustc_index::newtype_index! {
663
662
#[ encodable]
664
663
#[ orderable]
665
664
#[ debug_format = "?{}f" ]
666
- #[ gate_rustc_only]
667
665
pub struct FloatVid { }
668
666
}
669
667
@@ -706,7 +704,6 @@ pub enum InferTy {
706
704
707
705
/// Raw `TyVid` are used as the unification key for `sub_relations`;
708
706
/// they carry no values.
709
- #[ cfg( feature = "nightly" ) ]
710
707
impl UnifyKey for TyVid {
711
708
type Value = ( ) ;
712
709
#[ inline]
@@ -722,7 +719,6 @@ impl UnifyKey for TyVid {
722
719
}
723
720
}
724
721
725
- #[ cfg( feature = "nightly" ) ]
726
722
impl UnifyValue for IntVarValue {
727
723
type Error = NoError ;
728
724
@@ -742,7 +738,6 @@ impl UnifyValue for IntVarValue {
742
738
}
743
739
}
744
740
745
- #[ cfg( feature = "nightly" ) ]
746
741
impl UnifyKey for IntVid {
747
742
type Value = IntVarValue ;
748
743
#[ inline] // make this function eligible for inlining - it is quite hot.
@@ -758,7 +753,6 @@ impl UnifyKey for IntVid {
758
753
}
759
754
}
760
755
761
- #[ cfg( feature = "nightly" ) ]
762
756
impl UnifyValue for FloatVarValue {
763
757
type Error = NoError ;
764
758
@@ -776,7 +770,6 @@ impl UnifyValue for FloatVarValue {
776
770
}
777
771
}
778
772
779
- #[ cfg( feature = "nightly" ) ]
780
773
impl UnifyKey for FloatVid {
781
774
type Value = FloatVarValue ;
782
775
#[ inline]
0 commit comments