<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser, branch 1.71.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.71.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.71.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-05-27T18:40:28+00:00</updated>
<entry>
<title>Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwco</title>
<updated>2023-05-27T18:40:28+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-05-27T18:40:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=97fae38bf92a80c6ba41bf2a195afb2300aae275'/>
<id>urn:sha1:97fae38bf92a80c6ba41bf2a195afb2300aae275</id>
<content type='text'>
fix(parse): return unpected when current token is EOF

close https://github.com/rust-lang/rust/issues/111148

#111148 panic occurred because [FatalError.raise()](https://github.com/bvanjoi/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#LL540C3-L540C3) was encountered which caused by `Eof` and `Pound`(the last token) had same span, when parsing `#` in `fn a&lt;&lt;i&lt;Y&lt;w&lt;&gt;#`.

&lt;img width="825" alt="image" src="https://user-images.githubusercontent.com/30187863/236612589-9e2c6a0b-18cd-408c-b636-c12a51cbcf1c.png"&gt;

There are a few ways to solve this problem:

- Change the action assign for [self.last_unexpected_token_span](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/diagnostics.rs#L592), for example, if current token is `Eof`, then return Error directly.
- Avoid triggering the `FatalError` when the current token is `Eof`.

I have chosen the second option because executing `expected_one_of_not_found` when the token is `Eof` but not in `ediable` seems reasonable.
</content>
</entry>
<entry>
<title>Use `is_some_and`/`is_ok_and` in less obvious spots</title>
<updated>2023-05-24T14:33:43+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2023-05-24T14:33:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=307799a711826294bc2b3e562cd87bf1e2ff28b4'/>
<id>urn:sha1:307799a711826294bc2b3e562cd87bf1e2ff28b4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use `Option::is_some_and` and `Result::is_ok_and` in the compiler</title>
<updated>2023-05-24T14:20:41+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2023-05-24T14:19:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fb0f74a8c9e8b8f488ec5894d5d314caebf4c662'/>
<id>urn:sha1:fb0f74a8c9e8b8f488ec5894d5d314caebf4c662</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #111708 - jyn514:delay-span-bug-msg, r=compiler-errors</title>
<updated>2023-05-20T06:51:00+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>99973273+Dylan-DPC@users.noreply.github.com</email>
</author>
<published>2023-05-20T06:51:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=35bef062c7ea1e583832fe48dec57ef932d7169a'/>
<id>urn:sha1:35bef062c7ea1e583832fe48dec57ef932d7169a</id>
<content type='text'>
Give a more useful location for where a span_bug was delayed

Before:
```
   = note: delayed at    0: &lt;rustc_errors::HandlerInner&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: &lt;rustc_errors::Handler&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

After:
```
   = note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:2158:28
              0: &lt;rustc_errors::HandlerInner&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: &lt;rustc_errors::Handler&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

This both makes the relevant frame easier to find without having to dig through diagnostic internals, and avoids the weird-looking formatting for the first frame.

Found while working on https://github.com/rust-lang/rust/issues/111529.
</content>
</entry>
<entry>
<title>Rollup merge of #111054 - cjgillot:cfg-eval-recover, r=b-naber</title>
<updated>2023-05-18T12:07:08+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>99973273+Dylan-DPC@users.noreply.github.com</email>
</author>
<published>2023-05-18T12:07:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ee26abdafba8b75c6df4ac8af849978108f1a290'/>
<id>urn:sha1:ee26abdafba8b75c6df4ac8af849978108f1a290</id>
<content type='text'>
Do not recover when parsing stmt in cfg-eval.

`parse_stmt` does recovery on its own. When parsing the statement fails, we always get `Ok(None)` instead of an `Err` variant with the diagnostic that we can emit.

To avoid this behaviour, we need to opt-out of recovery for cfg_eval.

Fixes https://github.com/rust-lang/rust/issues/105228
</content>
</entry>
<entry>
<title>Give a more useful location for where a span_bug was delayed</title>
<updated>2023-05-18T04:15:22+00:00</updated>
<author>
<name>jyn</name>
<email>github@jyn.dev</email>
</author>
<published>2023-05-18T04:15:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e6a7fdedd720cce583f30cab41f67bf0a353a75a'/>
<id>urn:sha1:e6a7fdedd720cce583f30cab41f67bf0a353a75a</id>
<content type='text'>
Before:
```
   = note: delayed at    0: &lt;rustc_errors::HandlerInner&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: &lt;rustc_errors::Handler&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
...
```

After:
```
   = note: delayed at compiler/rustc_parse/src/parser/diagnostics.rs:2158:28
              0: &lt;rustc_errors::HandlerInner&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1335:29
              1: &lt;rustc_errors::Handler&gt;::emit_diagnostic
                        at ./compiler/rustc_errors/src/lib.rs:1124:9
```

This both makes the relevant frame easier to find without having to dig
through diagnostic internals, and avoids the weird-looking formatting
for the first frame.
</content>
</entry>
<entry>
<title>Recover `impl&lt;T ?Sized&gt;` correctly</title>
<updated>2023-05-15T17:14:59+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-05-10T23:00:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a5763ff8d3e67c156ebe8160de1db26a644d4c5d'/>
<id>urn:sha1:a5763ff8d3e67c156ebe8160de1db26a644d4c5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #111531 - chenyukang:yukang-fix-111416-ice, r=compiler-errors</title>
<updated>2023-05-15T08:58:39+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-05-15T08:58:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a1f3e7a8839b9872a5c0e5cbd895269ef3e00de'/>
<id>urn:sha1:7a1f3e7a8839b9872a5c0e5cbd895269ef3e00de</id>
<content type='text'>
Fix ice caused by shorthand fields in NoFieldsForFnCall

Fixes #111416
</content>
</entry>
<entry>
<title>fmt</title>
<updated>2023-05-13T11:40:17+00:00</updated>
<author>
<name>yukang</name>
<email>moorekang@gmail.com</email>
</author>
<published>2023-05-13T10:06:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=83789b8b068ad38c6a3c937d0a2c6ca64e588c85'/>
<id>urn:sha1:83789b8b068ad38c6a3c937d0a2c6ca64e588c85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix ice caused by shorthand fields in NoFieldsForFnCall</title>
<updated>2023-05-13T10:06:16+00:00</updated>
<author>
<name>yukang</name>
<email>moorekang@gmail.com</email>
</author>
<published>2023-05-13T10:06:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce6cfc37d033eb1fb1f2e3af1c17c218917b54ec'/>
<id>urn:sha1:ce6cfc37d033eb1fb1f2e3af1c17c218917b54ec</id>
<content type='text'>
</content>
</entry>
</feed>
