Skip to content

Commit 2d76bb1

Browse files
committed
replace some #[const_trait] with const trait
1 parent d1ed52b commit 2d76bb1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

library/core/src/cmp.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,8 @@ pub macro PartialEq($item:item) {
334334
#[doc(alias = "!=")]
335335
#[stable(feature = "rust1", since = "1.0.0")]
336336
#[rustc_diagnostic_item = "Eq"]
337-
#[const_trait]
338337
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
339-
pub trait Eq: [const] PartialEq<Self> + PointeeSized {
338+
pub const trait Eq: [const] PartialEq<Self> + PointeeSized {
340339
// this method is used solely by `impl Eq or #[derive(Eq)]` to assert that every component of a
341340
// type implements `Eq` itself. The current deriving infrastructure means doing this assertion
342341
// without using a method on this trait is nearly impossible.
@@ -966,9 +965,8 @@ impl<T: Clone> Clone for Reverse<T> {
966965
#[doc(alias = ">=")]
967966
#[stable(feature = "rust1", since = "1.0.0")]
968967
#[rustc_diagnostic_item = "Ord"]
969-
#[const_trait]
970968
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
971-
pub trait Ord: [const] Eq + [const] PartialOrd<Self> + PointeeSized {
969+
pub const trait Ord: [const] Eq + [const] PartialOrd<Self> + PointeeSized {
972970
/// This method returns an [`Ordering`] between `self` and `other`.
973971
///
974972
/// By convention, `self.cmp(&other)` returns the ordering matching the expression
@@ -1352,9 +1350,8 @@ pub macro Ord($item:item) {
13521350
)]
13531351
#[rustc_diagnostic_item = "PartialOrd"]
13541352
#[allow(multiple_supertrait_upcastable)] // FIXME(sized_hierarchy): remove this
1355-
#[const_trait]
13561353
#[rustc_const_unstable(feature = "const_cmp", issue = "143800")]
1357-
pub trait PartialOrd<Rhs: PointeeSized = Self>: PartialEq<Rhs> + PointeeSized {
1354+
pub const trait PartialOrd<Rhs: PointeeSized = Self>: PartialEq<Rhs> + PointeeSized {
13581355
/// This method returns an ordering between `self` and `other` values if one exists.
13591356
///
13601357
/// # Examples

0 commit comments

Comments
 (0)