1
Fork 0

Rollup merge of #112870 - compiler-errors:clause-2, r=oli-obk

Migrate `item_bounds` to `ty::Clause`

Should be simpler than the next PR that's coming up. Last three commits are the relevant ones.

r? ``@oli-obk`` or ``@lcnr``
This commit is contained in:
Matthias Krüger 2023-06-23 19:39:59 +02:00 committed by GitHub
commit 4e8983050e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 245 additions and 176 deletions

View file

@ -705,7 +705,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => tcx
.explicit_item_bounds(def_id)
.subst_iter_copied(tcx, substs)
.find_map(find_fn_kind_from_did),
.find_map(|(clause, span)| find_fn_kind_from_did((clause.as_predicate(), span))),
ty::Closure(_, substs) => match substs.as_closure().kind() {
ty::ClosureKind::Fn => Some(hir::Mutability::Not),
ty::ClosureKind::FnMut => Some(hir::Mutability::Mut),