@@ -21,7 +21,8 @@ mod rt;
21
21
#[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
22
22
#[ rustc_diagnostic_item = "Alignment" ]
23
23
/// Possible alignments returned by `Formatter::align`
24
- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
24
+ #[ derive( Copy , Clone , Debug ) ]
25
+ #[ derive_const( PartialEq , Eq ) ]
25
26
pub enum Alignment {
26
27
#[ stable( feature = "fmt_flags_align" , since = "1.28.0" ) ]
27
28
/// Indication that contents should be left-aligned.
@@ -103,7 +104,8 @@ pub type Result = result::Result<(), Error>;
103
104
/// }
104
105
/// ```
105
106
#[ 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 ) ]
107
109
pub struct Error ;
108
110
109
111
/// A trait for writing or formatting into Unicode-accepting buffers or streams.
@@ -255,7 +257,8 @@ impl<W: Write + ?Sized> Write for &mut W {
255
257
}
256
258
257
259
/// 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 ) ]
259
262
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
260
263
pub enum Sign {
261
264
/// Represents the `+` flag.
@@ -266,7 +269,8 @@ pub enum Sign {
266
269
267
270
/// Specifies whether the [`Debug`] trait should use lower-/upper-case
268
271
/// hexadecimal or normal integers.
269
- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
272
+ #[ derive( Copy , Clone , Debug ) ]
273
+ #[ derive_const( PartialEq , Eq ) ]
270
274
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
271
275
pub enum DebugAsHex {
272
276
/// 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 {
279
283
///
280
284
/// `FormattingOptions` is a [`Formatter`] without an attached [`Write`] trait.
281
285
/// 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 ) ]
283
288
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
284
289
pub struct FormattingOptions {
285
290
/// Flags, with the following bit fields:
0 commit comments