Make expand_abstract_consts infallible

This commit is contained in:
Boxy 2022-11-24 11:09:15 +00:00 committed by kadmin
parent 4085e94ece
commit 2ac5d91d63
8 changed files with 52 additions and 105 deletions

View file

@ -284,14 +284,8 @@ where
}
fn visit_const(&mut self, c: Const<'tcx>) -> ControlFlow<Self::BreakTy> {
self.visit_ty(c.ty())?;
let tcx = self.def_id_visitor.tcx();
if let ty::ConstKind::Unevaluated(uv) = c.kind()
&& let Ok(Some(ct)) = tcx.expand_unevaluated_abstract_const(uv.def, uv.substs)
{
ct.super_visit_with(self)?;
}
ControlFlow::CONTINUE
tcx.expand_abstract_consts(c).super_visit_with(self)
}
}