about summary refs log tree commit diff
path: root/library/core/src/default.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src/default.rs')
-rw-r--r--library/core/src/default.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/core/src/default.rs b/library/core/src/default.rs
index 0a15cedfb55..4d108b0c18e 100644
--- a/library/core/src/default.rs
+++ b/library/core/src/default.rs
@@ -103,6 +103,8 @@ use crate::ascii::Char as AsciiChar;
 /// ```
 #[rustc_diagnostic_item = "Default"]
 #[stable(feature = "rust1", since = "1.0.0")]
+#[const_trait]
+#[rustc_const_unstable(feature = "const_default", issue = "67792")]
 pub trait Default: Sized {
     /// Returns the "default value" for a type.
     ///
@@ -149,7 +151,8 @@ pub macro Default($item:item) {
 macro_rules! default_impl {
     ($t:ty, $v:expr, $doc:tt) => {
         #[stable(feature = "rust1", since = "1.0.0")]
-        impl Default for $t {
+        #[rustc_const_unstable(feature = "const_default", issue = "67792")]
+        impl const Default for $t {
             #[inline(always)]
             #[doc = $doc]
             fn default() -> $t {