Skip to content

Commit

Permalink
Auto merge of #115195 - cuviper:beta-next, r=cuviper
Browse files Browse the repository at this point in the history
[beta] backport and stage0 bump

- Bump to released stable compiler
- Add projection obligations when comparing impl too #115039

r? cuviper
  • Loading branch information
bors committed Aug 25, 2023
2 parents 680cdf8 + dc84bde commit ba87e4d
Show file tree
Hide file tree
Showing 3 changed files with 313 additions and 373 deletions.
9 changes: 8 additions & 1 deletion compiler/rustc_hir_analysis/src/check/compare_impl_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,16 @@ fn compare_method_predicate_entailment<'tcx>(
continue;
};
for obligation in obligations {
debug!(?obligation);
match obligation.predicate.kind().skip_binder() {
// We need to register Projection oblgiations too, because we may end up with
// an implied `X::Item: 'a`, which gets desugared into `X::Item = ?0`, `?0: 'a`.
// If we only register the region outlives obligation, this leads to an unconstrained var.
// See `implied_bounds_entailment_alias_var` test.
ty::PredicateKind::Clause(
ty::ClauseKind::RegionOutlives(..) | ty::ClauseKind::TypeOutlives(..),
ty::ClauseKind::RegionOutlives(..)
| ty::ClauseKind::TypeOutlives(..)
| ty::ClauseKind::Projection(..),
) => ocx.register_obligation(obligation),
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(arg)) => {
if wf_args_seen.insert(arg) {
Expand Down
Loading

0 comments on commit ba87e4d

Please sign in to comment.