Skip to content

Commit a805298

Browse files
committed
traits: prefer ClosureSubsts to InferCtxt::closure_kind
1 parent 1ff3cd8 commit a805298

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc/traits/fulfill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ fn process_predicate<'a, 'gcx, 'tcx>(
491491
}
492492
}
493493

494-
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
495-
match selcx.infcx().closure_kind(closure_def_id) {
494+
ty::Predicate::ClosureKind(closure_def_id, closure_substs, kind) => {
495+
match closure_substs.opt_closure_kind(closure_def_id, selcx.tcx()) {
496496
Some(closure_kind) => {
497497
if closure_kind.extends(kind) {
498498
Ok(Some(vec![]))

src/librustc/traits/select.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
718718
}
719719
}
720720

721-
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
722-
match self.infcx.closure_kind(closure_def_id) {
721+
ty::Predicate::ClosureKind(closure_def_id, closure_substs, kind) => {
722+
match closure_substs.opt_closure_kind(closure_def_id, self.tcx()) {
723723
Some(closure_kind) => {
724724
if closure_kind.extends(kind) {
725725
EvaluatedToOk

0 commit comments

Comments
 (0)