<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser, branch 1.87.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.87.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.87.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-04-24T20:55:32+00:00</updated>
<entry>
<title>Revert overzealous parse recovery for single colons</title>
<updated>2025-04-24T20:55:32+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-04-24T00:19:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2aec882174cc1751ad8ebb66de8812d298a1640f'/>
<id>urn:sha1:2aec882174cc1751ad8ebb66de8812d298a1640f</id>
<content type='text'>
(cherry picked from commit 16da97be2f1e94a550985f22289975db4b32c18d)
</content>
</entry>
<entry>
<title>Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, r=compiler-errors</title>
<updated>2025-03-26T08:40:28+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-03-26T08:40:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=30344f7fa3bea828bd4a5f9a6e19ca94a5ccc6cd'/>
<id>urn:sha1:30344f7fa3bea828bd4a5f9a6e19ca94a5ccc6cd</id>
<content type='text'>
Mostly parser: Eliminate code that's been dead / semi-dead since the removal of type ascription syntax

**Disclaimer**: This PR is intended to mostly clean up code as opposed to bringing about behavioral changes. Therefore it doesn't aim to address any of the 'FIXME: remove after a month [dated: 2023-05-02]: "type ascription syntax has been removed, see issue [#]101728"'.

---

By commit:

1. Removes truly dead code:
   * Since 1.71 (#109128) `let _ = { f: x };` is a syntax error as opposed to a semantic error which allows the parse-time diagnostic (suggestion) "*struct literal body without path // you might have forgotten […]*" to kick in.
   * The analysis-time diagnostic (suggestion) from &lt;=1.70 "*cannot find value \`f\` in this scope // you might have forgotten […]*" is therefore no longer reachable.
2. Updates `is_certainly_not_a_block` to be in line with the current grammar:
   * The seq. `{ ident:` is definitely not the start of a block. Before the removal of ty ascr, `{ ident: ty_start` would begin a block expr.
   * This shouldn't make more code compile IINM, it should *ultimately* only affect diagnostics.
   * For example, `if T { f: () } {}` will now be interpreted as an `if` with struct lit `T { f: () }` as its *condition* (which is banned in the parser anyway) as opposed to just `T` (with the *consequent* being `f : ()` which is also invalid (since 1.71)). The diagnostics are almost the same because we have two separate parse recovery procedures + diagnostics: `StructLiteralNeedingParens` (*invalid struct lit*) before and `StructLiteralNotAllowedHere` (*struct lits aren't allowed here*) now, as you can see from the diff.
   * (As an aside, even before this PR, fn `maybe_suggest_struct_literal` should've just used the much older &amp; clearer `StructLiteralNotAllowedHere`)
   * NB: This does sadly regress the compiler output for `tests/ui/parser/type-ascription-in-pattern.rs` but that can be fixed in follow-up PRs. It's not super important IMO and a natural consequence.
3. Removes code that's become dead due to the prior commit.
   * Basically reverts #106620 + #112475 (without regressing rustc's output!).
   * Now the older &amp; more robust parse recovery procedure (cc `StructLiteralNotAllowedHere`) takes care of the cases the removed code used to handle.
   * This automatically fixes the suggestions for \[[playground](https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2024&amp;gist=7e2030163b11ee96d17adc3325b01780)\]:
     * `if Ty::&lt;i32&gt; { f: K }.m() {}`: `if Ty::&lt;i32&gt; { SomeStruct { f: K } }.m() {}` (broken) → ` if (Ty::&lt;i32&gt; { f: K }).m() {}`
     * `if &lt;T as Trait&gt;::Out { f: K::&lt;&gt; }.m() {}`: `if &lt;T as Trait&gt;(::Out { f: K::&lt;&gt; }).m() {}` (broken) → `if (&lt;T as Trait&gt;::Out { f: K::&lt;&gt; }).m() {}`
4. Merge and simplify UI tests pertaining to this issue, so it's easier to add more regression tests like for the two cases mentioned above.
5. Merge UI tests and add the two regression tests.

Best reviewed commit by commit (on request I'll partially squash after approval).
</content>
</entry>
<entry>
<title>Rollup merge of #138911 - compiler-errors:define-opaque, r=oli-obk</title>
<updated>2025-03-26T00:34:49+00:00</updated>
<author>
<name>Jacob Pratt</name>
<email>jacob@jhpratt.dev</email>
</author>
<published>2025-03-26T00:34:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5bd69d940e83db1971fbd1c5a999fdb308200cf7'/>
<id>urn:sha1:5bd69d940e83db1971fbd1c5a999fdb308200cf7</id>
<content type='text'>
Allow defining opaques in statics and consts

r? oli-obk

Fixes https://github.com/rust-lang/rust/issues/138902
</content>
</entry>
<entry>
<title>Allow defining opaques in statics and consts</title>
<updated>2025-03-25T16:44:59+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-03-24T23:19:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f8df298d74ad4a385ca0b14e65ae154a9b8fa5c5'/>
<id>urn:sha1:f8df298d74ad4a385ca0b14e65ae154a9b8fa5c5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove now unreachable parse recovery code</title>
<updated>2025-03-25T14:15:41+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-03-23T23:12:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9f336ce2eb0ba04de7f1ddd2e1b0958e7df15c42'/>
<id>urn:sha1:9f336ce2eb0ba04de7f1ddd2e1b0958e7df15c42</id>
<content type='text'>
StructLiteralNeedingParens is no longer reachable always giving
precedence to StructLiteralNotAllowedHere.

As an aside: The former error struct shouldn't've existed in the
first place. We should've just used the latter in this branch.
</content>
</entry>
<entry>
<title>Brace-ident-colon can certainly no longer start a block</title>
<updated>2025-03-25T14:15:21+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-03-23T23:01:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=82796dd8585c0c160fe2a50b12f77455a7e0f8d7'/>
<id>urn:sha1:82796dd8585c0c160fe2a50b12f77455a7e0f8d7</id>
<content type='text'>
thanks to the removal of type ascription.
</content>
</entry>
<entry>
<title>Use `sym::dummy` for a dummy arg in `parse_fn_params`.</title>
<updated>2025-03-25T07:00:14+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-03-25T07:00:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=501945a22e314bad511e08a187c0aa029df51038'/>
<id>urn:sha1:501945a22e314bad511e08a187c0aa029df51038</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove fields that are dead since the removal of type ascription syntax</title>
<updated>2025-03-24T19:04:23+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-03-23T21:00:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=848b0da34fa20d0ff5d12d1d4f506affc765534b'/>
<id>urn:sha1:848b0da34fa20d0ff5d12d1d4f506affc765534b</id>
<content type='text'>
Since `{ ident: ident }` is a parse error, these fields are dead.
</content>
</entry>
<entry>
<title>Rollup merge of #138435 - eholk:prefix-yield, r=oli-obk</title>
<updated>2025-03-20T14:36:15+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-03-20T14:36:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d752721636e9daf9c263d35f0dbd543492746e2a'/>
<id>urn:sha1:d752721636e9daf9c263d35f0dbd543492746e2a</id>
<content type='text'>
Add support for postfix yield expressions

We've been having a discussion about whether we want postfix yield, or want to stick with prefix yield, or have both. I figured it's easy enough to support both for now and let us play around with them while the feature is still experimental.

This PR treats `yield x` and `x.yield` as semantically equivalent. There was a suggestion to make `yield x` have a `()` type (so it only works in coroutines with `Resume = ()`. I think that'd be worth trying, either in a later PR, or before this one merges, depending on people's opinions.

#43122
</content>
</entry>
<entry>
<title>Refactor YieldKind so postfix yield must have an expression</title>
<updated>2025-03-18T19:19:43+00:00</updated>
<author>
<name>Eric Holk</name>
<email>ericholk@microsoft.com</email>
</author>
<published>2025-03-18T19:19:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2bd7f73c2175c1f0ad56a0be4b5c39e2fc5ab97b'/>
<id>urn:sha1:2bd7f73c2175c1f0ad56a0be4b5c39e2fc5ab97b</id>
<content type='text'>
</content>
</entry>
</feed>
