about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2025-02-07 21:58:08 +0800
committerDeadbeef <ent3rm4n@gmail.com>2025-02-27 04:56:27 +0000
commitef66cbb27bc2a911edf4541e1c56102dc03e42d9 (patch)
tree5fb460c1ecc5ad46a2cf26261facbc965ea55edb /library
parent00f245915b0c7839d42c26f9628220c4f1b93bf6 (diff)
downloadrust-ef66cbb27bc2a911edf4541e1c56102dc03e42d9.tar.gz
rust-ef66cbb27bc2a911edf4541e1c56102dc03e42d9.zip
require trait impls to have matching const stabilities as the traits
Diffstat (limited to 'library')
-rw-r--r--library/core/src/ops/arith.rs1
-rw-r--r--library/core/src/ops/deref.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/ops/arith.rs b/library/core/src/ops/arith.rs
index fe7ff2d9ede..54d79beca95 100644
--- a/library/core/src/ops/arith.rs
+++ b/library/core/src/ops/arith.rs
@@ -96,6 +96,7 @@ pub trait Add<Rhs = Self> {
 macro_rules! add_impl {
     ($($t:ty)*) => ($(
         #[stable(feature = "rust1", since = "1.0.0")]
+        #[rustc_const_unstable(feature = "const_ops", issue = "90080")]
         impl const Add for $t {
             type Output = $t;
 
diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs
index 11490ea2bfc..e74f5443ac2 100644
--- a/library/core/src/ops/deref.rs
+++ b/library/core/src/ops/deref.rs
@@ -150,6 +150,7 @@ pub trait Deref {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
 impl<T: ?Sized> const Deref for &T {
     type Target = T;
 
@@ -163,6 +164,7 @@ impl<T: ?Sized> const Deref for &T {
 impl<T: ?Sized> !DerefMut for &T {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
 impl<T: ?Sized> const Deref for &mut T {
     type Target = T;
 
@@ -273,6 +275,7 @@ pub trait DerefMut: ~const Deref {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
 impl<T: ?Sized> const DerefMut for &mut T {
     fn deref_mut(&mut self) -> &mut T {
         *self