<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/borrowck/clone-span-on-try-operator.fixed, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-04-11T16:41:41+00:00</updated>
<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>[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives</title>
<updated>2024-02-16T20:02:50+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2024-02-16T20:02:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ec2cc761bc7067712ecc7734502f703fe3b024c8'/>
<id>urn:sha1:ec2cc761bc7067712ecc7734502f703fe3b024c8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Tweak `.clone()` suggestion to work in more cases</title>
<updated>2023-12-04T21:54:32+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2023-11-19T23:53:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=03c88aaf218f3798e1b9ed98f18f57741d368132'/>
<id>urn:sha1:03c88aaf218f3798e1b9ed98f18f57741d368132</id>
<content type='text'>
When going through auto-deref, the `&lt;T as Clone&gt;` impl sometimes needs
to be specified for rustc to actually clone the value and not the
reference.

```
error[E0507]: cannot move out of dereference of `S`
  --&gt; $DIR/needs-clone-through-deref.rs:15:18
   |
LL |         for _ in self.clone().into_iter() {}
   |                  ^^^^^^^^^^^^ ----------- value moved due to this method call
   |                  |
   |                  move occurs because value has type `Vec&lt;usize&gt;`, which does not implement the `Copy` trait
   |
note: `into_iter` takes ownership of the receiver `self`, which moves value
  --&gt; $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |         for _ in &lt;Vec&lt;usize&gt; as Clone&gt;::clone(&amp;self.clone()).into_iter() {}
   |                  ++++++++++++++++++++++++++++++            +
```

CC #109429.
</content>
</entry>
<entry>
<title>Don't use method span on clone suggestion</title>
<updated>2023-07-10T20:09:28+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-06-22T20:40:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3a3f4a21445d1175294552fa40446a3116103cef'/>
<id>urn:sha1:3a3f4a21445d1175294552fa40446a3116103cef</id>
<content type='text'>
</content>
</entry>
</feed>
