<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libcore/clone.rs, branch 1.14.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.14.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.14.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2016-09-28T23:17:56+00:00</updated>
<entry>
<title>Remove stage0 hacks</title>
<updated>2016-09-28T23:17:56+00:00</updated>
<author>
<name>Brian Anderson</name>
<email>banderson@mozilla.com</email>
</author>
<published>2016-09-28T20:55:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3b49c60ab71547e6dbaef086eb4cd2bb7fe9ff94'/>
<id>urn:sha1:3b49c60ab71547e6dbaef086eb4cd2bb7fe9ff94</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #36384 - petrochenkov:derclone, r=alexcrichton</title>
<updated>2016-09-15T12:46:19+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2016-09-15T12:46:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=726850170d3ec4606246ad90fcb08d1eee913c76'/>
<id>urn:sha1:726850170d3ec4606246ad90fcb08d1eee913c76</id>
<content type='text'>
Improve shallow `Clone` deriving

`Copy` unions now support `#[derive(Clone)]`.
Less code is generated for `#[derive(Clone, Copy)]`.
+
Unions now support `#[derive(Eq)]`.
Less code is generated for `#[derive(Eq)]`.

---
Example of code reduction:
```
enum E {
	A { a: u8, b: u16 },
	B { c: [u8; 100] },
}
```
Before:
```
fn clone(&amp;self) -&gt; E {
    match (&amp;*self,) {
        (&amp;E::A { a: ref __self_0, b: ref __self_1 },) =&gt; {
            ::std::clone::assert_receiver_is_clone(&amp;(*__self_0));
            ::std::clone::assert_receiver_is_clone(&amp;(*__self_1));
            *self
        }
        (&amp;E::B { c: ref __self_0 },) =&gt; {
            ::std::clone::assert_receiver_is_clone(&amp;(*__self_0));
            *self
        }
    }
}
```
After:
```
fn clone(&amp;self) -&gt; E {
    {
        let _: ::std::clone::AssertParamIsClone&lt;u8&gt;;
        let _: ::std::clone::AssertParamIsClone&lt;u16&gt;;
        let _: ::std::clone::AssertParamIsClone&lt;[u8; 100]&gt;;
        *self
    }
}
```

All the matches are removed, bound assertions are more lightweight.
`let _: Checker&lt;CheckMe&gt;;`, unlike `checker(&amp;check_me);`, doesn't have to be translated by rustc_trans and then inlined by LLVM, it doesn't even exist in MIR, this means faster compilation.

---
Union impls are generated like this:
```
union U {
	a: u8,
	b: u16,
	c: [u8; 100],
}
```
```
fn clone(&amp;self) -&gt; U {
    {
        let _: ::std::clone::AssertParamIsCopy&lt;Self&gt;;
        *self
    }
}
```

Fixes https://github.com/rust-lang/rust/issues/36043
cc @durka
r? @alexcrichton
</content>
</entry>
<entry>
<title>Improve Clone doc</title>
<updated>2016-09-11T09:58:17+00:00</updated>
<author>
<name>ggomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2016-09-09T14:07:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3d289278ee123a67827c2b8bbff053d904d7373a'/>
<id>urn:sha1:3d289278ee123a67827c2b8bbff053d904d7373a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improve shallow `Clone` deriving</title>
<updated>2016-09-10T15:43:27+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2016-08-26T16:23:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2a2c9d38c78ece0a6c5de80e382a136173e64b14'/>
<id>urn:sha1:2a2c9d38c78ece0a6c5de80e382a136173e64b14</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `#[prelude_import]` in `libcore`.</title>
<updated>2016-08-24T22:12:23+00:00</updated>
<author>
<name>Jeffrey Seyfried</name>
<email>jeffrey.seyfried@gmail.com</email>
</author>
<published>2016-08-22T10:02:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e2ad3be1787cdd36d52fcd2355225156f5460dc4'/>
<id>urn:sha1:e2ad3be1787cdd36d52fcd2355225156f5460dc4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Prefer `ClassName` over `Self` in example trait implementations</title>
<updated>2016-05-23T17:14:15+00:00</updated>
<author>
<name>Carol (Nichols || Goulding)</name>
<email>carol.nichols@gmail.com</email>
</author>
<published>2016-05-23T17:13:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d81a999b54f5c2df14a8057ab14ed7161093e353'/>
<id>urn:sha1:d81a999b54f5c2df14a8057ab14ed7161093e353</id>
<content type='text'>
</content>
</entry>
<entry>
<title>"more than 32" =&gt; "more than 32 elements"</title>
<updated>2016-05-23T17:00:01+00:00</updated>
<author>
<name>Carol (Nichols || Goulding)</name>
<email>carol.nichols@gmail.com</email>
</author>
<published>2016-05-23T17:00:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c22c52449ad29021debd61cad6cadbc5a325433e'/>
<id>urn:sha1:c22c52449ad29021debd61cad6cadbc5a325433e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Emphasize semantic differences of Copy/Clone rather than impl</title>
<updated>2016-05-23T16:58:42+00:00</updated>
<author>
<name>Carol (Nichols || Goulding)</name>
<email>carol.nichols@gmail.com</email>
</author>
<published>2016-05-23T16:58:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d2ee6e04ab7f2095351b48acff7c997dc4ac779a'/>
<id>urn:sha1:d2ee6e04ab7f2095351b48acff7c997dc4ac779a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Shorten, yet clarify, initial summary sentences</title>
<updated>2016-05-23T16:53:42+00:00</updated>
<author>
<name>Carol (Nichols || Goulding)</name>
<email>carol.nichols@gmail.com</email>
</author>
<published>2016-05-23T16:52:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b4e123d3e0fd9459733f9ebb0802877a995abef4'/>
<id>urn:sha1:b4e123d3e0fd9459733f9ebb0802877a995abef4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add more detail to `Clone`'s documentation</title>
<updated>2016-05-23T14:03:44+00:00</updated>
<author>
<name>Carol (Nichols || Goulding)</name>
<email>carol.nichols@gmail.com</email>
</author>
<published>2016-05-22T22:06:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c41227fefc449b08f3535758bd75b4b19866e0f7'/>
<id>urn:sha1:c41227fefc449b08f3535758bd75b4b19866e0f7</id>
<content type='text'>
Used as resources:
- https://users.rust-lang.org/t/whats-the-difference-between-trait-copy-and-clone/2609/2?u=carols10cents
</content>
</entry>
</feed>
