Delay a bug when we see SelfCtor in ref pattern
This commit is contained in:
parent
18f32b73bd
commit
285b9d1cd4
3 changed files with 29 additions and 0 deletions
|
@ -1870,6 +1870,15 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
// These entities are explicitly allowed to be shadowed by fresh bindings.
|
||||
None
|
||||
}
|
||||
Res::SelfCtor(_) => {
|
||||
// We resolve `Self` in pattern position as an ident sometimes during recovery,
|
||||
// so delay a bug instead of ICEing.
|
||||
self.r.session.delay_span_bug(
|
||||
ident.span,
|
||||
"unexpected `SelfCtor` in pattern, expected identifier"
|
||||
);
|
||||
None
|
||||
}
|
||||
_ => span_bug!(
|
||||
ident.span,
|
||||
"unexpected resolution for an identifier in pattern: {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue