]> git.lizzy.rs Git - rust.git/commitdiff
Derive Clone for ArgumentV1
authorShotaro Yamada <sinkuu@sinkuu.xyz>
Sun, 6 Jan 2019 06:33:42 +0000 (15:33 +0900)
committerShotaro Yamada <sinkuu@sinkuu.xyz>
Sun, 6 Jan 2019 06:33:42 +0000 (15:33 +0900)
manual impl was a workaround for #28229.

src/libcore/fmt/mod.rs

index bb6f511acf7e569749a1b227e384fb4c05190d2c..0127277d9cfc8d08392b5f1da5920fba897a0ca0 100644 (file)
@@ -247,7 +247,7 @@ struct Void {
 /// family of functions. It contains a function to format the given value. At
 /// compile time it is ensured that the function and the value have the correct
 /// types, and then this struct is used to canonicalize arguments to one type.
-#[derive(Copy)]
+#[derive(Copy, Clone)]
 #[allow(missing_debug_implementations)]
 #[unstable(feature = "fmt_internals", reason = "internal to format_args!",
            issue = "0")]
@@ -257,14 +257,6 @@ pub struct ArgumentV1<'a> {
     formatter: fn(&Void, &mut Formatter) -> Result,
 }
 
-#[unstable(feature = "fmt_internals", reason = "internal to format_args!",
-           issue = "0")]
-impl Clone for ArgumentV1<'_> {
-    fn clone(&self) -> Self {
-        *self
-    }
-}
-
 impl<'a> ArgumentV1<'a> {
     #[inline(never)]
     fn show_usize(x: &usize, f: &mut Formatter) -> Result {