@@ -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 , Debug ) ]
25
+ #[ derive_const( Clone , 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 , Debug , Hash ) ]
108
+ #[ derive_const( Clone , PartialEq , Eq , PartialOrd , Ord , Default ) ]
107
109
pub struct Error ;
108
110
109
111
/// A trait for writing or formatting into Unicode-accepting buffers or streams.
@@ -256,7 +258,8 @@ impl<W: Write + ?Sized> Write for &mut W {
256
258
}
257
259
258
260
/// 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 ) ]
260
263
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
261
264
pub enum Sign {
262
265
/// Represents the `+` flag.
@@ -267,7 +270,8 @@ pub enum Sign {
267
270
268
271
/// Specifies whether the [`Debug`] trait should use lower-/upper-case
269
272
/// hexadecimal or normal integers.
270
- #[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
273
+ #[ derive( Copy , Debug ) ]
274
+ #[ derive_const( Clone , PartialEq , Eq ) ]
271
275
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
272
276
pub enum DebugAsHex {
273
277
/// 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 {
280
284
///
281
285
/// `FormattingOptions` is a [`Formatter`] without an attached [`Write`] trait.
282
286
/// 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 ) ]
284
289
#[ unstable( feature = "formatting_options" , issue = "118117" ) ]
285
290
pub struct FormattingOptions {
286
291
/// Flags, with the following bit fields:
0 commit comments