// If the function belongs to a trait, then it must enable the const_trait_impl
// feature to use that trait function (with a const default body).
- if tcx.trait_of_item(def_id).is_some() {
+ if tcx.trait_of_item(def_id.to_def_id()).is_some() {
return true;
}