@@ -9,6 +9,7 @@ use rustc_trait_selection::traits;
99use traits:: { translate_substs, Reveal } ;
1010
1111use rustc_data_structures:: sso:: SsoHashSet ;
12+ use std:: collections:: btree_map:: Entry ;
1213use std:: collections:: BTreeMap ;
1314use std:: ops:: ControlFlow ;
1415
@@ -69,7 +70,6 @@ impl<'tcx> TypeVisitor<'tcx> for BoundVarsCollector<'tcx> {
6970 {
7071 return ControlFlow :: CONTINUE ;
7172 }
72- use std:: collections:: btree_map:: Entry ;
7373 match * t. kind ( ) {
7474 ty:: Bound ( debruijn, bound_ty) if debruijn == self . binder_index => {
7575 match self . vars . entry ( bound_ty. var . as_u32 ( ) ) {
@@ -90,27 +90,18 @@ impl<'tcx> TypeVisitor<'tcx> for BoundVarsCollector<'tcx> {
9090 }
9191
9292 fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
93- use std:: collections:: btree_map:: Entry ;
9493 match r {
95- ty:: ReLateBound ( index, br) if * index == self . binder_index => match br. kind {
96- ty:: BrNamed ( _def_id, _name) => {
97- // FIXME
98- }
99-
100- ty:: BrAnon ( var) => match self . vars . entry ( var) {
94+ ty:: ReLateBound ( index, br) if * index == self . binder_index => {
95+ match self . vars . entry ( br. var . as_u32 ( ) ) {
10196 Entry :: Vacant ( entry) => {
10297 entry. insert ( ty:: BoundVariableKind :: Region ( br. kind ) ) ;
10398 }
10499 Entry :: Occupied ( entry) => match entry. get ( ) {
105100 ty:: BoundVariableKind :: Region ( _) => { }
106101 _ => bug ! ( "Conflicting bound vars" ) ,
107102 } ,
108- } ,
109-
110- ty:: BrEnv => {
111- // FIXME
112103 }
113- } ,
104+ }
114105
115106 _ => ( ) ,
116107 } ;
0 commit comments