t.super_visit_with(self)
}
+ fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
+ match c.val {
+ ty::ConstKind::Bound(debruijn, bound_var) if debruijn == self.binder_index => {
+ self.types.insert(
+ bound_var.as_u32(),
+ Symbol::intern(&format!("^{}", bound_var.as_u32())),
+ );
+ }
+ _ => (),
+ }
+
+ c.super_visit_with(self)
+ }
+
fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
match r {
ty::ReLateBound(index, br) if *index == self.binder_index => match br {
// ignore the inputs to a projection, as they may not appear
// in the normalized form
if self.just_constrained {
- match t.kind {
- ty::Projection(..) | ty::Opaque(..) => {
- return false;
- }
- _ => {}
+ if let ty::Projection(..) | ty::Opaque(..) = t.kind {
+ return false;
}
}
t.super_visit_with(self)
}
+ fn visit_const(&mut self, c: &'tcx ty::Const<'tcx>) -> bool {
+ // if we are only looking for "constrained" region, we have to
+ // ignore the inputs of an unevaluated const, as they may not appear
+ // in the normalized form
+ if self.just_constrained {
+ if let ty::ConstKind::Unevaluated(..) = c.val {
+ return false;
+ }
+ }
+
+ c.super_visit_with(self)
+ }
+
fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool {
if let ty::ReLateBound(debruijn, br) = *r {
if debruijn == self.current_index {