Rollup merge of #99631 - jmqd:master, r=oli-obk

Use span_bug in case of unexpected rib kind

Extremely minor QOL change to improve the ICE compiler output in case
this default match case is encountered (an unexpected rib kind).

I have limited experience in this area of the compiler; please let me know
if a span more precise than `param.ident.span` is more applicable.
This commit is contained in:
Matthias Krüger 2022-07-23 12:08:13 +02:00 committed by GitHub
commit f510d98ad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2111,7 +2111,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
let res = match kind {
ItemRibKind(..) | AssocItemRibKind => Res::Def(def_kind, def_id.to_def_id()),
NormalRibKind => Res::Err,
_ => bug!("Unexpected rib kind {:?}", kind),
_ => span_bug!(param.ident.span, "Unexpected rib kind {:?}", kind),
};
self.r.record_partial_res(param.id, PartialRes::new(res));
rib.bindings.insert(ident, res);