1
Fork 0

Remove trait_of_item query.

This commit is contained in:
Camille GILLOT 2022-03-13 00:58:21 +01:00
parent d7ea161b7e
commit 957548183d
10 changed files with 25 additions and 36 deletions

View file

@ -97,7 +97,7 @@ impl<'tcx> CheckConstVisitor<'tcx> {
// 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;
}