Auto merge of #86438 - FabianWolff:issue-83693, r=jackh726

Fix the ICE described in #83693

This pull request fixes #83693 and fixes #84768.
This commit is contained in:
bors 2021-07-25 16:17:58 +00:00
commit 478126c0f3
5 changed files with 89 additions and 3 deletions

View file

@ -2681,15 +2681,14 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
Scope::Binder { hir_id, .. } => {
break *hir_id;
}
Scope::Body { id, .. } => break id.hir_id,
Scope::ObjectLifetimeDefault { ref s, .. }
| Scope::Elision { ref s, .. }
| Scope::Supertrait { ref s, .. }
| Scope::TraitRefBoundary { ref s, .. } => {
scope = *s;
}
Scope::Root => {
// See issue #83907. Just bail out from looking inside.
Scope::Root | Scope::Body { .. } => {
// See issues #83907 and #83693. Just bail out from looking inside.
self.tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
"In fn_like_elision without appropriate scope above",