Skip to content

Commit 2cbe07b

Browse files
committed
reintroduce commit_if_ok calls to subtype_predicate
1 parent 6cb4ffb commit 2cbe07b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/librustc/infer/mod.rs

+16-14
Original file line numberDiff line numberDiff line change
@@ -937,20 +937,22 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
937937
return None;
938938
}
939939

940-
let (
941-
ty::SubtypePredicate {
942-
a_is_expected,
943-
a,
944-
b,
945-
},
946-
_,
947-
) = self.replace_bound_vars_with_placeholders(predicate);
948-
949-
Some(
950-
self.at(cause, param_env)
951-
.sub_exp(a_is_expected, a, b)
952-
.map(|ok| ok.unit()),
953-
)
940+
Some(self.commit_if_ok(|_snapshot| {
941+
let (
942+
ty::SubtypePredicate {
943+
a_is_expected,
944+
a,
945+
b,
946+
},
947+
_,
948+
) = self.replace_bound_vars_with_placeholders(predicate);
949+
950+
Ok(
951+
self.at(cause, param_env)
952+
.sub_exp(a_is_expected, a, b)?
953+
.unit(),
954+
)
955+
}))
954956
}
955957

956958
pub fn region_outlives_predicate(

0 commit comments

Comments
 (0)