Dynamic,
Foreign,
Opaque,
+ Closure,
Generator,
Projection,
}
impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> {
type BreakTy = NonStructuralMatchTy<'tcx>;
+ fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> {
+ Some(self.tcx())
+ }
fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
debug!("Search visiting ty: {:?}", ty);
ty::Projection(..) => {
return ControlFlow::Break(NonStructuralMatchTy::Projection);
}
+ ty::Closure(..) => {
+ return ControlFlow::Break(NonStructuralMatchTy::Closure);
+ }
ty::Generator(..) | ty::GeneratorWitness(..) => {
return ControlFlow::Break(NonStructuralMatchTy::Generator);
}
// First check all contained types and then tell the caller to continue searching.
return ty.super_visit_with(self);
}
- ty::Closure(..) | ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => {
+ ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => {
bug!("unexpected type during structural-match checking: {:?}", ty);
}
ty::Error(_) => {