1
Fork 0

Coerce const FnDefs to implement const Fn traits

This commit is contained in:
Deadbeef 2021-09-15 11:28:10 +00:00
parent d3f981b144
commit f8aa73d3dd
No known key found for this signature in database
GPG key ID: 027DF9338862ADDD
7 changed files with 55 additions and 13 deletions

View file

@ -655,8 +655,7 @@ impl<'tcx> Validator<'_, 'tcx> {
let is_const_fn = match *fn_ty.kind() {
ty::FnDef(def_id, _) => {
self.tcx.is_const_fn_raw(def_id)
|| is_lang_panic_fn(self.tcx, def_id)
self.tcx.is_const_fn_raw(def_id) || is_lang_panic_fn(self.tcx, def_id)
}
_ => false,
};