]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/mod.rs
Auto merge of #95833 - notriddle:notriddle/human-readable-signals, r=yaahc
[rust.git] / compiler / rustc_middle / src / ty / mod.rs
index 14e5dc0dd772250ed73d858597338a668c7a2eb7..a493aaac276b1a3e8f0cf9cb533ee27b61128829 100644 (file)
@@ -2303,6 +2303,11 @@ pub fn is_const_fn_raw(self, def_id: DefId) -> bool {
         matches!(self.def_kind(def_id), DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(..))
             && self.impl_constness(def_id) == hir::Constness::Const
     }
+
+    #[inline]
+    pub fn is_const_default_method(self, def_id: DefId) -> bool {
+        matches!(self.trait_of_item(def_id), Some(trait_id) if self.has_attr(trait_id, sym::const_trait))
+    }
 }
 
 /// Yields the parent function's `LocalDefId` if `def_id` is an `impl Trait` definition.