1
Fork 0

traits: prefer ClosureSubsts to InferCtxt::closure_kind

This commit is contained in:
Niko Matsakis 2017-11-08 08:52:24 -05:00
parent decf3d33d0
commit 716f75b1b8
2 changed files with 4 additions and 4 deletions

View file

@ -438,8 +438,8 @@ fn process_predicate<'a, 'gcx, 'tcx>(
}
}
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
match selcx.infcx().closure_kind(closure_def_id) {
ty::Predicate::ClosureKind(closure_def_id, closure_substs, kind) => {
match closure_substs.opt_closure_kind(closure_def_id, selcx.tcx()) {
Some(closure_kind) => {
if closure_kind.extends(kind) {
Ok(Some(vec![]))

View file

@ -718,8 +718,8 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
}
}
ty::Predicate::ClosureKind(closure_def_id, _closure_substs, kind) => {
match self.infcx.closure_kind(closure_def_id) {
ty::Predicate::ClosureKind(closure_def_id, closure_substs, kind) => {
match closure_substs.opt_closure_kind(closure_def_id, self.tcx()) {
Some(closure_kind) => {
if closure_kind.extends(kind) {
EvaluatedToOk