File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,20 @@ impl<'tcx> TypeVisitor<'tcx> for BoundNamesCollector {
273
273
t. super_visit_with ( self )
274
274
}
275
275
276
+ fn visit_const ( & mut self , c : & ' tcx ty:: Const < ' tcx > ) -> bool {
277
+ match c. val {
278
+ ty:: ConstKind :: Bound ( debruijn, bound_var) if debruijn == self . binder_index => {
279
+ self . types . insert (
280
+ bound_var. as_u32 ( ) ,
281
+ Symbol :: intern ( & format ! ( "^{}" , bound_var. as_u32( ) ) ) ,
282
+ ) ;
283
+ }
284
+ _ => ( ) ,
285
+ }
286
+
287
+ c. super_visit_with ( self )
288
+ }
289
+
276
290
fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
277
291
match r {
278
292
ty:: ReLateBound ( index, br) if * index == self . binder_index => match br {
Original file line number Diff line number Diff line change @@ -978,17 +978,27 @@ impl<'tcx> TypeVisitor<'tcx> for LateBoundRegionsCollector {
978
978
// ignore the inputs to a projection, as they may not appear
979
979
// in the normalized form
980
980
if self . just_constrained {
981
- match t. kind {
982
- ty:: Projection ( ..) | ty:: Opaque ( ..) => {
983
- return false ;
984
- }
985
- _ => { }
981
+ if let ty:: Projection ( ..) | ty:: Opaque ( ..) = t. kind {
982
+ return false ;
986
983
}
987
984
}
988
985
989
986
t. super_visit_with ( self )
990
987
}
991
988
989
+ fn visit_const ( & mut self , c : & ' tcx ty:: Const < ' tcx > ) -> bool {
990
+ // if we are only looking for "constrained" region, we have to
991
+ // ignore the inputs of an unevaluated const, as they may not appear
992
+ // in the normalized form
993
+ if self . just_constrained {
994
+ if let ty:: ConstKind :: Unevaluated ( ..) = c. val {
995
+ return false ;
996
+ }
997
+ }
998
+
999
+ c. super_visit_with ( self )
1000
+ }
1001
+
992
1002
fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
993
1003
if let ty:: ReLateBound ( debruijn, br) = * r {
994
1004
if debruijn == self . current_index {
You can’t perform that action at this time.
0 commit comments