@@ -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 , Debug ) ]
25+ #[ derive_const( Clone , 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 , Debug , Hash ) ]
108+ #[ derive_const( Clone , PartialEq , Eq , PartialOrd , Ord , Default ) ]
107109pub struct Error ;
108110
109111/// A trait for writing or formatting into Unicode-accepting buffers or streams.
@@ -256,7 +258,8 @@ impl<W: Write + ?Sized> Write for &mut W {
256258}
257259
258260/// The signedness of a [`Formatter`] (or of a [`FormattingOptions`]).
259- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
261+ #[ derive( Copy , Debug ) ]
262+ #[ derive_const( Clone , PartialEq , Eq ) ]
260263#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
261264pub enum Sign {
262265 /// Represents the `+` flag.
@@ -267,7 +270,8 @@ pub enum Sign {
267270
268271/// Specifies whether the [`Debug`] trait should use lower-/upper-case
269272/// hexadecimal or normal integers.
270- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
273+ #[ derive( Copy , Debug ) ]
274+ #[ derive_const( Clone , PartialEq , Eq ) ]
271275#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
272276pub enum DebugAsHex {
273277 /// Use lower-case hexadecimal integers for the `Debug` trait (like [the `x?` type](../../std/fmt/index.html#formatting-traits)).
@@ -280,7 +284,8 @@ pub enum DebugAsHex {
280284///
281285/// `FormattingOptions` is a [`Formatter`] without an attached [`Write`] trait.
282286/// It is mainly used to construct `Formatter` instances.
283- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
287+ #[ derive( Copy , Debug ) ]
288+ #[ derive_const( Clone , PartialEq , Eq ) ]
284289#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
285290pub struct FormattingOptions {
286291 /// Flags, with the following bit fields:
0 commit comments