]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/check_const.rs
Rollup merge of #100019 - TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait...
[rust.git] / compiler / rustc_passes / src / check_const.rs
index f1a81b65329afe29529971d16a70c7ea13b0490d..70518284cf91439ce218819084e699fcb79d59c9 100644 (file)
@@ -97,7 +97,7 @@ fn const_check_violated(&self, expr: NonConstExpr, span: Span) {
 
             // 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;
             }