<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/lifetimes/lifetime-errors, 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>2025-06-09T19:55:00+00:00</updated>
<entry>
<title>Make E0621 missing lifetime suggestion verbose</title>
<updated>2025-06-09T19:55:00+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2025-06-04T21:10:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3fce086d79afd9bc5b52a13e051934694cf196c1'/>
<id>urn:sha1:3fce086d79afd9bc5b52a13e051934694cf196c1</id>
<content type='text'>
```
error[E0621]: explicit lifetime required in the type of `x`
  --&gt; $DIR/42701_one_named_and_one_anonymous.rs:10:9
   |
LL |         &amp;*x
   |         ^^^ lifetime `'a` required
   |
help: add explicit lifetime `'a` to the type of `x`
   |
LL | fn foo2&lt;'a&gt;(a: &amp;'a Foo, x: &amp;'a i32) -&gt; &amp;'a i32 {
   |                             ++
```
</content>
</entry>
<entry>
<title>Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`</title>
<updated>2025-06-04T14:40:04+00:00</updated>
<author>
<name>Jake Goulding</name>
<email>jake.goulding@gmail.com</email>
</author>
<published>2025-03-17T16:43:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d35ad948492146f0811d43606db66c65c55980a9'/>
<id>urn:sha1:d35ad948492146f0811d43606db66c65c55980a9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove special-casing for argument patterns in MIR typeck</title>
<updated>2025-01-09T01:59:27+00:00</updated>
<author>
<name>dianne</name>
<email>diannes.gm@gmail.com</email>
</author>
<published>2025-01-09T01:58:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=72945beedd799c7debe0dddc14cc4e9a00943770'/>
<id>urn:sha1:72945beedd799c7debe0dddc14cc4e9a00943770</id>
<content type='text'>
</content>
</entry>
<entry>
<title>`best_blame_constraint`: avoid blaming assignments without user-provided types</title>
<updated>2025-01-07T00:12:11+00:00</updated>
<author>
<name>dianne</name>
<email>diannes.gm@gmail.com</email>
</author>
<published>2024-12-19T09:16:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=50222dba2edd2bcf265a8ca4753de0df59bf587d'/>
<id>urn:sha1:50222dba2edd2bcf265a8ca4753de0df59bf587d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>`best_blame_constraint`: don't filter constraints by sup SCC</title>
<updated>2025-01-07T00:08:29+00:00</updated>
<author>
<name>dianne</name>
<email>diannes.gm@gmail.com</email>
</author>
<published>2024-12-04T11:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac922245f0c86657a56d3ca5eff4a1d1b1fcb0a1'/>
<id>urn:sha1:ac922245f0c86657a56d3ca5eff4a1d1b1fcb0a1</id>
<content type='text'>
The SCCs of the region graph are not a reliable heuristic to use for blaming an interesting
constraint for diagnostics. For region errors, if the outlived region is `'static`, or the involved
types are invariant in their lifetiems, there will be cycles in the constraint graph containing both
the target region and the most interesting constraints to blame. To get better diagnostics in these
cases, this commit removes that heuristic.
</content>
</entry>
<entry>
<title>elided_named_lifetimes: bless &amp; add tests</title>
<updated>2024-08-31T12:35:42+00:00</updated>
<author>
<name>Pavel Grigorenko</name>
<email>GrigorenkoPV@ya.ru</email>
</author>
<published>2024-08-31T12:31:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a9b959a020cc156ef57a972c83381aabc43b1174'/>
<id>urn:sha1:a9b959a020cc156ef57a972c83381aabc43b1174</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Better span for "make binding mutable" suggestion</title>
<updated>2024-07-04T02:02:21+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-07-03T21:01:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=89ecae5d852a7346ee4e8240ae7a1130f1f6f458'/>
<id>urn:sha1:89ecae5d852a7346ee4e8240ae7a1130f1f6f458</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Detect when a lifetime is being reused in suggestion</title>
<updated>2024-05-17T21:23:47+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-05-17T21:23:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cf5702ee91dd9ba93c19aae9e663e613a577d02b'/>
<id>urn:sha1:cf5702ee91dd9ba93c19aae9e663e613a577d02b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Tweak suggested lifetimes to modify return type instead of `&amp;self` receiver</title>
<updated>2024-05-17T20:31:13+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-05-07T19:54:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1775e7b93d4142eb2e4c75c2d49a9c4d8541d7a6'/>
<id>urn:sha1:1775e7b93d4142eb2e4c75c2d49a9c4d8541d7a6</id>
<content type='text'>
Do not suggest constraining the `&amp;self` param, but rather the return type.
If that is wrong (because it is not sufficient), a follow up error will tell the
user to fix it. This way we lower the chances of *over* constraining, but still
get the cake of "correctly" contrained in two steps.

This is a correct suggestion:

```
error: lifetime may not live long enough
  --&gt; $DIR/ex3-both-anon-regions-return-type-is-anon.rs:9:9
   |
LL |     fn foo&lt;'a&gt;(&amp;self, x: &amp;i32) -&gt; &amp;i32 {
   |                -         - let's call the lifetime of this reference `'1`
   |                |
   |                let's call the lifetime of this reference `'2`
LL |         x
   |         ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
   |
help: consider introducing a named lifetime parameter and update trait if needed
   |
LL |     fn foo&lt;'a&gt;(&amp;self, x: &amp;'a i32) -&gt; &amp;'a i32 {
   |                           ++          ++
```

While this is incomplete because it should suggestino `&amp;'a self`

```
error: lifetime may not live long enough
  --&gt; $DIR/ex3-both-anon-regions-self-is-anon.rs:7:19
   |
LL |     fn foo&lt;'a&gt;(&amp;self, x: &amp;Foo) -&gt; &amp;Foo {
   |                -         - let's call the lifetime of this reference `'1`
   |                |
   |                let's call the lifetime of this reference `'2`
LL |         if true { x } else { self }
   |                   ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
   |
help: consider introducing a named lifetime parameter and update trait if needed
   |
LL |     fn foo&lt;'a&gt;(&amp;self, x: &amp;'a Foo) -&gt; &amp;'a Foo {
   |                           ++          ++
```

but the follow up error is

```
error: lifetime may not live long enough
 --&gt; tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs:7:30
  |
6 |     fn foo&lt;'a&gt;(&amp;self, x: &amp;'a Foo) -&gt; &amp;'a Foo {
  |            --  - let's call the lifetime of this reference `'1`
  |            |
  |            lifetime `'a` defined here
7 |         if true { x } else { self }
  |                              ^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
  |
help: consider introducing a named lifetime parameter and update trait if needed
  |
6 |     fn foo&lt;'a&gt;(&amp;'a self, x: &amp;'a Foo) -&gt; &amp;'a Foo {
  |                 ++
```
</content>
</entry>
<entry>
<title>Run `rustfmt` on modified tests</title>
<updated>2024-05-17T20:31:13+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-05-07T19:45:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ee5a157b4a9d51788d7306af63b3e3ef063ec49d'/>
<id>urn:sha1:ee5a157b4a9d51788d7306af63b3e3ef063ec49d</id>
<content type='text'>
</content>
</entry>
</feed>
