Skip to content

Commit ed747ea

Browse files
committed
reintroduce commit_if_ok calls to subtype_predicate
1 parent ed3ac1a commit ed747ea

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
@@ -935,20 +935,22 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
935935
return None;
936936
}
937937

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

954956
pub fn region_outlives_predicate(

0 commit comments

Comments
 (0)