1
Fork 0

functions marked with attr are not const

This commit is contained in:
Deadbeef 2021-07-10 11:16:03 +08:00
parent 89d190f090
commit 27e863b3df
No known key found for this signature in database
GPG key ID: 6525773485376D92
2 changed files with 9 additions and 4 deletions

View file

@ -60,9 +60,6 @@ fn is_const_fn_raw(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
return true;
}
if tcx.has_attr(def_id, sym::default_method_body_is_const) {
return true;
}
// If the function itself is not annotated with `const`, it may still be a `const fn`
// if it resides in a const trait impl.
is_parent_const_impl_raw(tcx, hir_id)