@@ -21,7 +21,8 @@ mod rt;
2121#[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
2222#[ rustc_diagnostic_item = "Alignment" ]
2323/// Possible alignments returned by `Formatter::align`
24- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
24+ #[ derive( Copy , Clone , Debug ) ]
25+ #[ derive_const( PartialEq , Eq ) ]
2526pub enum Alignment {
2627 #[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
2728 /// Indication that contents should be left-aligned.
@@ -103,7 +104,8 @@ pub type Result = result::Result<(), Error>;
103104/// }
104105/// ```
105106#[ stable( feature = "rust1" , since = "1.0.0" ) ]
106- #[ derive( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
107+ #[ derive( Copy , Clone , Debug , Default , Hash ) ]
108+ #[ derive_const( Eq , Ord , PartialEq , PartialOrd ) ]
107109pub struct Error ;
108110
109111/// A trait for writing or formatting into Unicode-accepting buffers or streams.
@@ -255,7 +257,8 @@ impl<W: Write + ?Sized> Write for &mut W {
255257}
256258
257259/// The signedness of a [`Formatter`] (or of a [`FormattingOptions`]).
258- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
260+ #[ derive( Copy , Clone , Debug ) ]
261+ #[ derive_const( PartialEq , Eq ) ]
259262#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
260263pub enum Sign {
261264 /// Represents the `+` flag.
@@ -266,7 +269,8 @@ pub enum Sign {
266269
267270/// Specifies whether the [`Debug`] trait should use lower-/upper-case
268271/// hexadecimal or normal integers.
269- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
272+ #[ derive( Copy , Clone , Debug ) ]
273+ #[ derive_const( PartialEq , Eq ) ]
270274#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
271275pub enum DebugAsHex {
272276 /// Use lower-case hexadecimal integers for the `Debug` trait (like [the `x?` type](../../std/fmt/index.html#formatting-traits)).
@@ -279,7 +283,8 @@ pub enum DebugAsHex {
279283///
280284/// `FormattingOptions` is a [`Formatter`] without an attached [`Write`] trait.
281285/// It is mainly used to construct `Formatter` instances.
282- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
286+ #[ derive( Copy , Clone , Debug ) ]
287+ #[ derive_const( PartialEq , Eq ) ]
283288#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
284289pub struct FormattingOptions {
285290 /// Flags, with the following bit fields:
0 commit comments