1
Fork 0

Workaround ICE with if-let and RFC 2229

This commit is contained in:
Mark Rousskov 2021-09-18 18:04:40 -04:00
parent db1fb85cff
commit 440d9372a2
2 changed files with 8 additions and 9 deletions

View file

@ -2417,13 +2417,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let substs = InternalSubsts::for_item(tcx, def_id, |param, _| {
if let Some(i) = (param.index as usize).checked_sub(generics.parent_count) {
// Our own parameters are the resolved lifetimes.
match param.kind {
GenericParamDefKind::Lifetime
if let hir::GenericArg::Lifetime(lifetime) = &lifetimes[i] =>
{
if let GenericParamDefKind::Lifetime = param.kind {
if let hir::GenericArg::Lifetime(lifetime) = &lifetimes[i] {
self.ast_region_to_region(lifetime, None).into()
} else {
bug!()
}
_ => bug!(),
} else {
bug!()
}
} else {
match param.kind {