<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/for-loop-while/break-while-condition.stderr, branch 1.85.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-04-30T07:16:59+00:00</updated>
<entry>
<title>Remove note about iteration count in coerce</title>
<updated>2024-04-30T07:16:59+00:00</updated>
<author>
<name>Gurinder Singh</name>
<email>frederick.the.fool@gmail.com</email>
</author>
<published>2024-04-19T13:00:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6289ed842897f75f7b1f06aee44f9f123f57077d'/>
<id>urn:sha1:6289ed842897f75f7b1f06aee44f9f123f57077d</id>
<content type='text'>
and replace it with a simple note suggesting
returning a value.

The type mismatch error was never due to
how many times the loop iterates. It is more
because of the peculiar structure of what the for
loop desugars to. So the note talking about
iteration count didn't make sense
</content>
</entry>
<entry>
<title>Provide structured suggestion for type mismatch in loop</title>
<updated>2023-11-22T19:56:53+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2023-11-19T21:01:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=45efb8e6a68081462a70fa8cb40510d50ab848a4'/>
<id>urn:sha1:45efb8e6a68081462a70fa8cb40510d50ab848a4</id>
<content type='text'>
We currently provide only a `help` message, this PR introduces the last
two structured suggestions instead:

```
error[E0308]: mismatched types
  --&gt; $DIR/issue-98982.rs:2:5
   |
LL |   fn foo() -&gt; i32 {
   |               --- expected `i32` because of return type
LL | /     for i in 0..0 {
LL | |         return i;
LL | |     }
   | |_____^ expected `i32`, found `()`
   |
note: the function expects a value to always be returned, but loops might run zero times
  --&gt; $DIR/issue-98982.rs:2:5
   |
LL |     for i in 0..0 {
   |     ^^^^^^^^^^^^^ this might have zero elements to iterate on
LL |         return i;
   |         -------- if the loop doesn't execute, this value would never get returned
help: return a value for the case when the loop has zero elements to iterate on
   |
LL ~     }
LL ~     /* `i32` value */
   |
help: otherwise consider changing the return type to account for that possibility
   |
LL ~ fn foo() -&gt; Option&lt;i32&gt; {
LL |     for i in 0..0 {
LL ~         return Some(i);
LL ~     }
LL ~     None
   |
```

Fix #98982.
</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>
