1
Fork 0

Rollup merge of #109222 - chenyukang:yukang/fix-109143, r=petrochenkov

Do not ICE for unexpected lifetime with ConstGeneric rib

Fixes #109143
r? ````@petrochenkov````

Combining this test with the previous test will affect the previous diagnostics, so I added a separate test case.
This commit is contained in:
Matthias Krüger 2023-03-18 00:05:53 +01:00 committed by GitHub
commit dfd2b6493a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 4 deletions

View file

@ -1478,8 +1478,9 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
} else {
LifetimeUseSet::Many
}),
LifetimeRibKind::Generics { .. } => None,
LifetimeRibKind::ConstGeneric | LifetimeRibKind::AnonConst => {
LifetimeRibKind::Generics { .. }
| LifetimeRibKind::ConstGeneric => None,
LifetimeRibKind::AnonConst => {
span_bug!(ident.span, "unexpected rib kind: {:?}", rib.kind)
}
})