<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/functional-struct-update/functional-struct-update-noncopyable.stderr, branch 1.85.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-04-12T20:57:07+00:00</updated>
<entry>
<title>review comments</title>
<updated>2024-04-12T20:57:07+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-04-12T20:57:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4c7213c888174612250f77c29d929c16b331ade5'/>
<id>urn:sha1:4c7213c888174612250f77c29d929c16b331ade5</id>
<content type='text'>
Added comments and reworded messages
</content>
</entry>
<entry>
<title>Account for move error in the spread operator on struct literals</title>
<updated>2024-04-11T16:41:42+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-03-16T18:19:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d578ac9e476a376246320db1d934972601c5b0f5'/>
<id>urn:sha1:d578ac9e476a376246320db1d934972601c5b0f5</id>
<content type='text'>
We attempt to suggest an appropriate clone for move errors on expressions
like `S { ..s }` where a field isn't `Copy`. If we can't suggest, we still don't
emit the incorrect suggestion of `S { ..s }.clone()`.

```
error[E0509]: cannot move out of type `S&lt;K&gt;`, which implements the `Drop` trait
  --&gt; $DIR/borrowck-struct-update-with-dtor.rs:28:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.c` has type `K`, which does not implement the `Copy` trait
   |
help: clone the value from the field instead of using the spread operator syntax
   |
LL |         let _s2 = S { a: 2, c: s0.c.clone(), ..s0 };
   |                           +++++++++++++++++
```
```
error[E0509]: cannot move out of type `S&lt;()&gt;`, which implements the `Drop` trait
  --&gt; $DIR/borrowck-struct-update-with-dtor.rs:20:19
   |
LL |         let _s2 = S { a: 2, ..s0 };
   |                   ^^^^^^^^^^^^^^^^
   |                   |
   |                   cannot move out of here
   |                   move occurs because `s0.b` has type `B`, which does not implement the `Copy` trait
   |
note: `B` doesn't implement `Copy` or `Clone`
  --&gt; $DIR/borrowck-struct-update-with-dtor.rs:4:1
   |
LL | struct B;
   | ^^^^^^^^
help: if `B` implemented `Clone`, you could clone the value from the field instead of using the spread operator syntax
   |
LL |         let _s2 = S { a: 2, b: s0.b.clone(), ..s0 };
   |                           +++++++++++++++++
```
</content>
</entry>
<entry>
<title>Suggest `.clone()` in some move errors</title>
<updated>2024-04-11T16:41:41+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-03-13T03:41:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=10c2fbec2437a873463382726d4815520430ff1f'/>
<id>urn:sha1:10c2fbec2437a873463382726d4815520430ff1f</id>
<content type='text'>
```
error[E0507]: cannot move out of `*x` which is behind a shared reference
  --&gt; $DIR/borrowck-fn-in-const-a.rs:6:16
   |
LL |         return *x
   |                ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait
   |
help: consider cloning the value if the performance cost is acceptable
   |
LL -         return *x
LL +         return x.clone()
   |
```
</content>
</entry>
<entry>
<title>Show number in error message even for one error</title>
<updated>2023-11-24T18:15:52+00:00</updated>
<author>
<name>Nilstrieb</name>
<email>48135649+Nilstrieb@users.noreply.github.com</email>
</author>
<published>2023-11-21T15:44:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=41e8d152dc5abb5a706999ada8b059d3420af8f3'/>
<id>urn:sha1:41e8d152dc5abb5a706999ada8b059d3420af8f3</id>
<content type='text'>
Co-authored-by: Adrian &lt;adrian.iosdev@gmail.com&gt;
</content>
</entry>
<entry>
<title>Move /src/test to /tests</title>
<updated>2023-01-11T09:32:08+00:00</updated>
<author>
<name>Albert Larsan</name>
<email>74931857+albertlarsan68@users.noreply.github.com</email>
</author>
<published>2023-01-05T08:13:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cf2dff2b1e3fa55fa5415d524200070d0d7aacfe'/>
<id>urn:sha1:cf2dff2b1e3fa55fa5415d524200070d0d7aacfe</id>
<content type='text'>
</content>
</entry>
</feed>
