File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -911,13 +911,15 @@ impl<'tcx> TypeVisitor<'tcx> for HasEscapingVarsVisitor {
911911 }
912912
913913 fn visit_const ( & mut self , ct : & ' tcx ty:: Const < ' tcx > ) -> bool {
914- if let ty:: Const {
915- val : ConstValue :: Infer ( ty:: InferConst :: Canonical ( debruijn, _) ) ,
916- ..
917- } = * ct {
918- debruijn >= self . outer_index
919- } else {
920- false
914+ // we don't have a `visit_infer_const` callback, so we have to
915+ // hook in here to catch this case (annoying...), but
916+ // otherwise we do want to remember to visit the rest of the
917+ // const, as it has types/regions embedded in a lot of other
918+ // places.
919+ match ct. val {
920+ ConstValue :: Infer ( ty:: InferConst :: Canonical ( debruijn, _) )
921+ if debruijn >= self . outer_index => true ,
922+ _ => ct. super_visit_with ( self ) ,
921923 }
922924 }
923925}
You can’t perform that action at this time.
0 commit comments