Skip to content

Commit 716f75b

Browse files
committed
traits: prefer ClosureSubsts to InferCtxt::closure_kind
1 parent decf3d3 commit 716f75b

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
@@ -438,8 +438,8 @@ fn process_predicate<'a, 'gcx, 'tcx>(
438438
}
439439
}
440440

441-
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
442-
match selcx.infcx().closure_kind(closure_def_id) {
441+
ty::Predicate::ClosureKind(closure_def_id, closure_substs, kind) => {
442+
match closure_substs.opt_closure_kind(closure_def_id, selcx.tcx()) {
443443
Some(closure_kind) => {
444444
if closure_kind.extends(kind) {
445445
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)