about summary refs log tree commit diff
path: root/src/libfmt_macros/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libfmt_macros/lib.rs')
-rw-r--r--src/libfmt_macros/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libfmt_macros/lib.rs b/src/libfmt_macros/lib.rs
index d88551eb855..db389457a1e 100644
--- a/src/libfmt_macros/lib.rs
+++ b/src/libfmt_macros/lib.rs
@@ -44,6 +44,8 @@ pub enum Piece<'a> {
     NextArgument(Argument<'a>),
 }
 
+impl<'a> Copy for Piece<'a> {}
+
 /// Representation of an argument specification.
 #[deriving(PartialEq)]
 pub struct Argument<'a> {
@@ -53,6 +55,8 @@ pub struct Argument<'a> {
     pub format: FormatSpec<'a>,
 }
 
+impl<'a> Copy for Argument<'a> {}
+
 /// Specification for the formatting of an argument in the format string.
 #[deriving(PartialEq)]
 pub struct FormatSpec<'a> {
@@ -72,6 +76,8 @@ pub struct FormatSpec<'a> {
     pub ty: &'a str
 }
 
+impl<'a> Copy for FormatSpec<'a> {}
+
 /// Enum describing where an argument for a format can be located.
 #[deriving(PartialEq)]
 pub enum Position<'a> {
@@ -83,6 +89,8 @@ pub enum Position<'a> {
     ArgumentNamed(&'a str),
 }
 
+impl<'a> Copy for Position<'a> {}
+
 /// Enum of alignments which are supported.
 #[deriving(PartialEq)]
 pub enum Alignment {
@@ -96,6 +104,8 @@ pub enum Alignment {
     AlignUnknown,
 }
 
+impl Copy for Alignment {}
+
 /// Various flags which can be applied to format strings. The meaning of these
 /// flags is defined by the formatters themselves.
 #[deriving(PartialEq)]
@@ -112,6 +122,8 @@ pub enum Flag {
     FlagSignAwareZeroPad,
 }
 
+impl Copy for Flag {}
+
 /// A count is used for the precision and width parameters of an integer, and
 /// can reference either an argument or a literal integer.
 #[deriving(PartialEq)]
@@ -128,6 +140,8 @@ pub enum Count<'a> {
     CountImplied,
 }
 
+impl<'a> Copy for Count<'a> {}
+
 /// The parser structure for interpreting the input format string. This is
 /// modelled as an iterator over `Piece` structures to form a stream of tokens
 /// being output.