Skip to content

Commit f09fb12

Browse files
compiler-errorsgitbot
authored and
gitbot
committed
Enforce syntactical stability of const traits in HIR
1 parent db35b2c commit f09fb12

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

core/src/intrinsics/fallback.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#![allow(missing_docs)]
99

1010
#[const_trait]
11+
#[rustc_const_unstable(feature = "core_intrinsics_fallbacks", issue = "none")]
1112
pub trait CarryingMulAdd: Copy + 'static {
1213
type Unsigned: Copy + 'static;
1314
fn carrying_mul_add(

core/src/marker.rs

+1
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ marker_impls! {
952952
/// This should be used for `~const` bounds,
953953
/// as non-const bounds will always hold for every type.
954954
#[unstable(feature = "const_destruct", issue = "133214")]
955+
#[rustc_const_unstable(feature = "const_destruct", issue = "133214")]
955956
#[lang = "destruct"]
956957
#[rustc_on_unimplemented(message = "can't drop `{Self}`", append_const_msg)]
957958
#[rustc_deny_explicit_impl]

core/src/ops/arith.rs

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
/// ```
6666
#[lang = "add"]
6767
#[stable(feature = "rust1", since = "1.0.0")]
68+
#[rustc_const_unstable(feature = "const_ops", issue = "90080")]
6869
#[rustc_on_unimplemented(
6970
on(all(_Self = "{integer}", Rhs = "{float}"), message = "cannot add a float to an integer",),
7071
on(all(_Self = "{float}", Rhs = "{integer}"), message = "cannot add an integer to a float",),

core/src/ops/deref.rs

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
#[stable(feature = "rust1", since = "1.0.0")]
135135
#[rustc_diagnostic_item = "Deref"]
136136
#[const_trait]
137+
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
137138
pub trait Deref {
138139
/// The resulting type after dereferencing.
139140
#[stable(feature = "rust1", since = "1.0.0")]
@@ -263,6 +264,7 @@ impl<T: ?Sized> const Deref for &mut T {
263264
#[doc(alias = "*")]
264265
#[stable(feature = "rust1", since = "1.0.0")]
265266
#[const_trait]
267+
#[rustc_const_unstable(feature = "const_deref", issue = "88955")]
266268
pub trait DerefMut: ~const Deref {
267269
/// Mutably dereferences the value.
268270
#[stable(feature = "rust1", since = "1.0.0")]

core/src/ops/drop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
#[lang = "drop"]
205205
#[stable(feature = "rust1", since = "1.0.0")]
206206
#[const_trait]
207+
#[rustc_const_unstable(feature = "const_destruct", issue = "133214")]
207208
pub trait Drop {
208209
/// Executes the destructor for this type.
209210
///

0 commit comments

Comments
 (0)