// touch bound regions, they just capture the in-scope
// type/region parameters
match *obligation.self_ty().skip_binder().kind() {
- ty::Closure(_, closure_substs) => {
+ ty::Closure(def_id, closure_substs) => {
+ let is_const = self.tcx().is_const_fn_raw(def_id);
debug!(?kind, ?obligation, "assemble_unboxed_candidates");
match self.infcx.closure_kind(closure_substs) {
Some(closure_kind) => {
debug!(?closure_kind, "assemble_unboxed_candidates");
if closure_kind.extends(kind) {
- candidates.vec.push(ClosureCandidate);
+ candidates.vec.push(ClosureCandidate {
+ is_const,
+ });
}
}
None => {
debug!("assemble_unboxed_candidates: closure_kind not yet known");
- candidates.vec.push(ClosureCandidate);
+ candidates.vec.push(ClosureCandidate {
+ is_const,
+ });
}
}
}