Skip to content

Commit bcd2e09

Browse files
committed
require trait impls to have matching const stabilities as the traits
1 parent 83e302a commit bcd2e09

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Diff for: core/src/ops/arith.rs

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ pub trait Add<Rhs = Self> {
9696
macro_rules! add_impl {
9797
($($t:ty)*) => ($(
9898
#[stable(feature = "rust1", since = "1.0.0")]
99+
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
99100
impl const Add for $t {
100101
type Output = $t;
101102

Diff for: core/src/ops/deref.rs

+3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ pub trait Deref {
150150
}
151151

152152
#[stable(feature = "rust1", since = "1.0.0")]
153+
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
153154
impl<T: ?Sized> const Deref for &T {
154155
type Target = T;
155156

@@ -163,6 +164,7 @@ impl<T: ?Sized> const Deref for &T {
163164
impl<T: ?Sized> !DerefMut for &T {}
164165

165166
#[stable(feature = "rust1", since = "1.0.0")]
167+
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
166168
impl<T: ?Sized> const Deref for &mut T {
167169
type Target = T;
168170

@@ -273,6 +275,7 @@ pub trait DerefMut: ~const Deref {
273275
}
274276

275277
#[stable(feature = "rust1", since = "1.0.0")]
278+
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
276279
impl<T: ?Sized> const DerefMut for &mut T {
277280
fn deref_mut(&mut self) -> &mut T {
278281
*self

0 commit comments

Comments
 (0)