Rollup merge of #83944 - jackh726:binder-refactor-fix2, r=lcnr
Fix a couple resolve bugs from binder refactor Fixes #83753 Fixes #83907
This commit is contained in:
commit
8853aaeefc
5 changed files with 56 additions and 1 deletions
|
@ -2719,6 +2719,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
Some(next) => next,
|
||||
None => break None,
|
||||
};
|
||||
// See issue #83753. If someone writes an associated type on a non-trait, just treat it as
|
||||
// there being no supertrait HRTBs.
|
||||
match tcx.def_kind(def_id) {
|
||||
DefKind::Trait | DefKind::TraitAlias | DefKind::Impl => {}
|
||||
_ => break None,
|
||||
}
|
||||
|
||||
if trait_defines_associated_type_named(def_id) {
|
||||
break Some(bound_vars.into_iter().collect());
|
||||
}
|
||||
|
@ -2764,7 +2771,14 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
| Scope::TraitRefBoundary { ref s, .. } => {
|
||||
scope = *s;
|
||||
}
|
||||
Scope::Root => bug!("In fn_like_elision without appropriate scope above"),
|
||||
Scope::Root => {
|
||||
// See issue #83907. Just bail out from looking inside.
|
||||
self.tcx.sess.delay_span_bug(
|
||||
rustc_span::DUMMY_SP,
|
||||
"In fn_like_elision without appropriate scope above",
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
// While not strictly necessary, we gather anon lifetimes *before* actually
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue