<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse, 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>Ensure Fluent messages are in alphabetical order</title>
<updated>2023-05-25T23:49:35+00:00</updated>
<author>
<name>clubby789</name>
<email>jamie@hill-daniel.co.uk</email>
</author>
<published>2023-05-23T01:51:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f97fddab91fbf290ea5b691fe355d6f915220b6e'/>
<id>urn:sha1:f97fddab91fbf290ea5b691fe355d6f915220b6e</id>
<content type='text'>
</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>Rollup merge of #111633 - nnethercote:avoid-ref-format, r=WaffleLapkin</title>
<updated>2023-05-18T05:22:35+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>99973273+Dylan-DPC@users.noreply.github.com</email>
</author>
<published>2023-05-18T05:22:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=08efb9d652c840715d15954592426e2befe13b36'/>
<id>urn:sha1:08efb9d652c840715d15954592426e2befe13b36</id>
<content type='text'>
Avoid `&amp;format("...")` calls in error message code.

Some error message cleanups. Best reviewed one commit at a time.

r? `@davidtwco`
</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>Avoid `&amp;format("...")` calls in error message code.</title>
<updated>2023-05-16T07:59:56+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-05-16T06:04:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=01e33a3600789b0e96511c4ac95fc114b507c79e'/>
<id>urn:sha1:01e33a3600789b0e96511c4ac95fc114b507c79e</id>
<content type='text'>
Error message all end up passing into a function as an `impl
Into&lt;{D,Subd}iagnosticMessage&gt;`. If an error message is creatd as
`&amp;format("...")` that means we allocate a string (in the `format!`
call), then take a reference, and then clone (allocating again) the
reference to produce the `{D,Subd}iagnosticMessage`, which is silly.

This commit removes the leading `&amp;` from a lot of these cases. This
means the original `String` is moved into the
`{D,Subd}iagnosticMessage`, avoiding the double allocations. This
requires changing some function argument types from `&amp;str` to `String`
(when all arguments are `String`) or `impl
Into&lt;{D,Subd}iagnosticMessage&gt;` (when some arguments are `String` and
some are `&amp;str`).
</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>
</feed>
