@@ -142,22 +142,6 @@ impl TypeWalk for ProjectionTy {
142
142
}
143
143
}
144
144
145
- #[ derive( Clone , PartialEq , Eq , Debug , Hash ) ]
146
- pub struct UnselectedProjectionTy {
147
- pub type_name : Name ,
148
- pub parameters : Substs ,
149
- }
150
-
151
- impl TypeWalk for UnselectedProjectionTy {
152
- fn walk ( & self , f : & mut impl FnMut ( & Ty ) ) {
153
- self . parameters . walk ( f) ;
154
- }
155
-
156
- fn walk_mut ( & mut self , f : & mut impl FnMut ( & mut Ty ) ) {
157
- self . parameters . walk_mut ( f) ;
158
- }
159
- }
160
-
161
145
/// A type.
162
146
///
163
147
/// See also the `TyKind` enum in rustc (librustc/ty/sty.rs), which represents
@@ -176,13 +160,6 @@ pub enum Ty {
176
160
/// trait and all its parameters are fully known.
177
161
Projection ( ProjectionTy ) ,
178
162
179
- /// This is a variant of a projection in which the trait is
180
- /// **not** known. It corresponds to a case where people write
181
- /// `T::Item` without specifying the trait. We would then try to
182
- /// figure out the trait by looking at all the traits that are in
183
- /// scope.
184
- UnselectedProjection ( UnselectedProjectionTy ) ,
185
-
186
163
/// A type parameter; for example, `T` in `fn f<T>(x: T) {}
187
164
Param {
188
165
/// The index of the parameter (starting with parameters from the
@@ -618,11 +595,6 @@ impl TypeWalk for Ty {
618
595
t. walk ( f) ;
619
596
}
620
597
}
621
- Ty :: UnselectedProjection ( p_ty) => {
622
- for t in p_ty. parameters . iter ( ) {
623
- t. walk ( f) ;
624
- }
625
- }
626
598
Ty :: Dyn ( predicates) | Ty :: Opaque ( predicates) => {
627
599
for p in predicates. iter ( ) {
628
600
p. walk ( f) ;
@@ -641,9 +613,6 @@ impl TypeWalk for Ty {
641
613
Ty :: Projection ( p_ty) => {
642
614
p_ty. parameters . walk_mut ( f) ;
643
615
}
644
- Ty :: UnselectedProjection ( p_ty) => {
645
- p_ty. parameters . walk_mut ( f) ;
646
- }
647
616
Ty :: Dyn ( predicates) | Ty :: Opaque ( predicates) => {
648
617
let mut v: Vec < _ > = predicates. iter ( ) . cloned ( ) . collect ( ) ;
649
618
for p in & mut v {
@@ -774,25 +743,11 @@ impl HirDisplay for ProjectionTy {
774
743
}
775
744
}
776
745
777
- impl HirDisplay for UnselectedProjectionTy {
778
- fn hir_fmt ( & self , f : & mut HirFormatter < impl HirDatabase > ) -> fmt:: Result {
779
- write ! ( f, "{}" , self . parameters[ 0 ] . display( f. db) ) ?;
780
- if self . parameters . len ( ) > 1 {
781
- write ! ( f, "<" ) ?;
782
- f. write_joined ( & self . parameters [ 1 ..] , ", " ) ?;
783
- write ! ( f, ">" ) ?;
784
- }
785
- write ! ( f, "::{}" , self . type_name) ?;
786
- Ok ( ( ) )
787
- }
788
- }
789
-
790
746
impl HirDisplay for Ty {
791
747
fn hir_fmt ( & self , f : & mut HirFormatter < impl HirDatabase > ) -> fmt:: Result {
792
748
match self {
793
749
Ty :: Apply ( a_ty) => a_ty. hir_fmt ( f) ?,
794
750
Ty :: Projection ( p_ty) => p_ty. hir_fmt ( f) ?,
795
- Ty :: UnselectedProjection ( p_ty) => p_ty. hir_fmt ( f) ?,
796
751
Ty :: Param { name, .. } => write ! ( f, "{}" , name) ?,
797
752
Ty :: Bound ( idx) => write ! ( f, "?{}" , idx) ?,
798
753
Ty :: Dyn ( predicates) | Ty :: Opaque ( predicates) => {
0 commit comments