about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-18 00:05:53 +0100
committerGitHub <noreply@github.com>2023-03-18 00:05:53 +0100
commitdfd2b6493a4a9e44194faa11e4ae30f62d8a403b (patch)
tree48c5236097dfc33dea7079a3dcf65d6b1b681aa5 /compiler/rustc_resolve/src
parente7d6369ed436e75c65aec961095807e884b04cc0 (diff)
parent827a990255b49a5a6eee67844fbbeaeb323236b4 (diff)
downloadrust-dfd2b6493a4a9e44194faa11e4ae30f62d8a403b.tar.gz
rust-dfd2b6493a4a9e44194faa11e4ae30f62d8a403b.zip
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.
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index eff10e5af9f..1afd8851ce0 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -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)
                                     }
                                 })