11use std:: fmt;
22
33use 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 } ;
47use rustc_ast_ir:: Mutability ;
58#[ cfg( feature = "nightly" ) ]
69use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
710#[ cfg( feature = "nightly" ) ]
8- use rustc_data_structures:: unify:: { NoError , UnifyKey , UnifyValue } ;
9- #[ cfg( feature = "nightly" ) ]
1011use rustc_macros:: { Decodable , Encodable , HashStable_NoContext , TyDecodable , TyEncodable } ;
1112use rustc_type_ir_macros:: { Lift_Generic , TypeFoldable_Generic , TypeVisitable_Generic } ;
1213
@@ -645,7 +646,6 @@ rustc_index::newtype_index! {
645646 #[ encodable]
646647 #[ orderable]
647648 #[ debug_format = "?{}t" ]
648- #[ gate_rustc_only]
649649 pub struct TyVid { }
650650}
651651
@@ -654,7 +654,6 @@ rustc_index::newtype_index! {
654654 #[ encodable]
655655 #[ orderable]
656656 #[ debug_format = "?{}i" ]
657- #[ gate_rustc_only]
658657 pub struct IntVid { }
659658}
660659
@@ -663,7 +662,6 @@ rustc_index::newtype_index! {
663662 #[ encodable]
664663 #[ orderable]
665664 #[ debug_format = "?{}f" ]
666- #[ gate_rustc_only]
667665 pub struct FloatVid { }
668666}
669667
@@ -706,7 +704,6 @@ pub enum InferTy {
706704
707705/// Raw `TyVid` are used as the unification key for `sub_relations`;
708706/// they carry no values.
709- #[ cfg( feature = "nightly" ) ]
710707impl UnifyKey for TyVid {
711708 type Value = ( ) ;
712709 #[ inline]
@@ -722,7 +719,6 @@ impl UnifyKey for TyVid {
722719 }
723720}
724721
725- #[ cfg( feature = "nightly" ) ]
726722impl UnifyValue for IntVarValue {
727723 type Error = NoError ;
728724
@@ -742,7 +738,6 @@ impl UnifyValue for IntVarValue {
742738 }
743739}
744740
745- #[ cfg( feature = "nightly" ) ]
746741impl UnifyKey for IntVid {
747742 type Value = IntVarValue ;
748743 #[ inline] // make this function eligible for inlining - it is quite hot.
@@ -758,7 +753,6 @@ impl UnifyKey for IntVid {
758753 }
759754}
760755
761- #[ cfg( feature = "nightly" ) ]
762756impl UnifyValue for FloatVarValue {
763757 type Error = NoError ;
764758
@@ -776,7 +770,6 @@ impl UnifyValue for FloatVarValue {
776770 }
777771}
778772
779- #[ cfg( feature = "nightly" ) ]
780773impl UnifyKey for FloatVid {
781774 type Value = FloatVarValue ;
782775 #[ inline]
0 commit comments