about summary refs log tree commit diff
path: root/src/libstd/os/linux/raw.rs
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2015-10-13 13:06:00 +0100
committerBen S <ogham@bsago.me>2015-10-13 13:06:00 +0100
commitb40163beb925b176fdb570e4f4998ab9919e77a4 (patch)
tree25aeeb2c0d76c73e2ec2d2fa17b8a3a8d1c43f41 /src/libstd/os/linux/raw.rs
parentec4362da562a4b591a7d120c6677e14ea713481a (diff)
downloadrust-b40163beb925b176fdb570e4f4998ab9919e77a4.tar.gz
rust-b40163beb925b176fdb570e4f4998ab9919e77a4.zip
Make the Metadata struct Clone
This commit adds #[derive(Clone)] to std::fs::Metadata, making that struct
cloneable. Although the exact contents of that struct differ between OSes,
they all have it contain only value types, meaning that the data can be re-used without repercussions.

It also adds #[derive(Clone)] to every type used by that struct across all
OSes, including the various Unix `stat` structs and Windows's
`WIN32_FILE_ATTRIBUTE_DATA`.
Diffstat (limited to 'src/libstd/os/linux/raw.rs')
-rw-r--r--src/libstd/os/linux/raw.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs
index 3275ce07b48..d7abdef6b03 100644
--- a/src/libstd/os/linux/raw.rs
+++ b/src/libstd/os/linux/raw.rs
@@ -35,6 +35,7 @@ mod arch {
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
 
     #[repr(C)]
+    #[derive(Clone)]
     #[stable(feature = "raw_ext", since = "1.1.0")]
     pub struct stat {
         #[stable(feature = "raw_ext", since = "1.1.0")]
@@ -95,6 +96,7 @@ mod arch {
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i32;
 
     #[repr(C)]
+    #[derive(Clone)]
     #[stable(feature = "raw_ext", since = "1.1.0")]
     pub struct stat {
         #[stable(feature = "raw_ext", since = "1.1.0")]
@@ -154,6 +156,7 @@ mod arch {
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
 
     #[repr(C)]
+    #[derive(Clone)]
     #[stable(feature = "raw_ext", since = "1.1.0")]
     pub struct stat {
         #[stable(feature = "raw_ext", since = "1.1.0")]
@@ -211,6 +214,7 @@ mod arch {
     #[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
 
     #[repr(C)]
+    #[derive(Clone)]
     #[stable(feature = "raw_ext", since = "1.1.0")]
     pub struct stat {
         #[stable(feature = "raw_ext", since = "1.1.0")]