1
Fork 0

Simplify even more candidates

This commit is contained in:
Michael Goulet 2023-06-16 01:16:40 +00:00
parent 1311bb56f3
commit 2835d9d1d3
6 changed files with 88 additions and 161 deletions

View file

@ -781,8 +781,13 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
);
return;
}
Ok(Some(ImplSource::Closure(data))) => {
if !tcx.is_const_fn_raw(data.closure_def_id) {
Ok(Some(ImplSource::Closure(_))) => {
let ty::Closure(closure_def_id, substs) =
*poly_trait_pred.self_ty().no_bound_vars().unwrap().kind()
else {
unreachable!()
};
if !tcx.is_const_fn_raw(closure_def_id) {
self.check_op(ops::FnCallNonConst {
caller,
callee,