<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/expr.rs, branch 1.79.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.79.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.79.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-06-07T01:12:48+00:00</updated>
<entry>
<title>Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davidtwco"</title>
<updated>2024-06-07T01:12:48+00:00</updated>
<author>
<name>Rémy Rakic</name>
<email>remy.rakic+github@gmail.com</email>
</author>
<published>2024-06-06T21:17:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a24e8b204b0a29af3b122f3c43d02b9ab341f74'/>
<id>urn:sha1:7a24e8b204b0a29af3b122f3c43d02b9ab341f74</id>
<content type='text'>
This reverts commit 57dad1d75e562ff73051c1c43b07eaf65c7dbd74, reversing
changes made to 36316df9fe6c3e246153fe6e78967643cf08c148.
</content>
</entry>
<entry>
<title>Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, r=davidtwco</title>
<updated>2024-04-23T10:10:26+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-04-23T10:10:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=57dad1d75e562ff73051c1c43b07eaf65c7dbd74'/>
<id>urn:sha1:57dad1d75e562ff73051c1c43b07eaf65c7dbd74</id>
<content type='text'>
Disallow ambiguous attributes on expressions

This implements the suggestion in [#15701](https://github.com/rust-lang/rust/issues/15701#issuecomment-2033124217) to disallow ambiguous outer attributes on expressions. This should resolve one of the concerns blocking the stabilization of `stmt_expr_attributes`.
</content>
</entry>
<entry>
<title>Improve handling of expr-&gt;field errors</title>
<updated>2024-04-22T15:47:35+00:00</updated>
<author>
<name>Sasha Pourcelot</name>
<email>sasha.pourcelot@protonmail.com</email>
</author>
<published>2024-04-20T13:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=98332c108b8074954203fa4b0c82fbab876d3059'/>
<id>urn:sha1:98332c108b8074954203fa4b0c82fbab876d3059</id>
<content type='text'>
The current message for "`-&gt;` used for field access" is the following:

```rust
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `-&gt;`
 --&gt; src/main.rs:2:6
  |
2 |     a-&gt;b;
  |      ^^ expected one of 8 possible tokens
```

(playground link[1])

This PR tries to address this by adding a dedicated error message and recovery. The proposed error message is:

```
error: `-&gt;` used for field access or method call
 --&gt; ./tiny_test.rs:2:6
  |
2 |     a-&gt;b;
  |      ^^ help: try using `.` instead
  |
  = help: the `.` operator will dereference the value if needed
```

(feel free to bikeshed it as much as necessary)

[1]: https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2021&amp;gist=7f8b6f4433aa7866124123575456f54e

Signed-off-by: Sasha Pourcelot &lt;sasha.pourcelot@protonmail.com&gt;
</content>
</entry>
<entry>
<title>Disallow ambiguous attributes on expressions</title>
<updated>2024-04-18T18:42:19+00:00</updated>
<author>
<name>Dominik Stolz</name>
<email>d.stolz@tum.de</email>
</author>
<published>2024-04-17T21:40:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5af861cf7b4a87857ca6aa9dab2ad277ea8c059b'/>
<id>urn:sha1:5af861cf7b4a87857ca6aa9dab2ad277ea8c059b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove some things that do not need to be</title>
<updated>2024-04-11T19:09:52+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-04-07T15:59:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f9ca2135101831f9dc240201e3c0e807fa2d1b1b'/>
<id>urn:sha1:f9ca2135101831f9dc240201e3c0e807fa2d1b1b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't ICE for postfix match after as</title>
<updated>2024-04-02T22:31:42+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-04-02T22:31:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9d116e8e188a84d97e1b64f54410fda7ec6f2dc6'/>
<id>urn:sha1:9d116e8e188a84d97e1b64f54410fda7ec6f2dc6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>chore: fix some comments</title>
<updated>2024-03-27T14:32:53+00:00</updated>
<author>
<name>xiaoxiangxianzi</name>
<email>zhaoyizheng@outlook.com</email>
</author>
<published>2024-03-27T13:19:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3157114f0b4b28caad0d593a0cc5d8b04d02a29c'/>
<id>urn:sha1:3157114f0b4b28caad0d593a0cc5d8b04d02a29c</id>
<content type='text'>
Signed-off-by: xiaoxiangxianzi &lt;zhaoyizheng@outlook.com&gt;
</content>
</entry>
<entry>
<title>Clarify `parse_dot_suffix_expr`.</title>
<updated>2024-03-25T02:08:07+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-03-21T05:14:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dce0f7f5c2a62a5aabb1d02351473d6f2b125541'/>
<id>urn:sha1:dce0f7f5c2a62a5aabb1d02351473d6f2b125541</id>
<content type='text'>
For the `MiddleDot` case, current behaviour:
- For a case like `1.2`, `sym1` is `1` and `sym2` is `2`, and `self.token`
  holds `1.2`.
- It creates a new ident token from `sym1` that it puts into `self.token`.
- Then it does `bump_with` with a new dot token, which moves the `sym1`
  token into `prev_token`.
- Then it does `bump_with` with a new ident token from `sym2`, which moves the
  `dot` token into `prev_token` and discards the `sym1` token.
- Then it does `bump`, which puts whatever is next into `self.token`,
  moves the `sym2` token into `prev_token`, and discards the `dot` token
  altogether.

New behaviour:
- Skips creating and inserting the `sym1` and dot tokens, because they are
  unnecessary.
- This also demonstrates that the comment about `Spacing::Alone` is
  wrong -- that value is never used. That comment was added in #77250,
  and AFAICT it has always been incorrect.

The commit also expands comments. I found this code hard to read
previously, the examples in comments make it easier.
</content>
</entry>
<entry>
<title>Change `parse_expr_tuple_field_access`.</title>
<updated>2024-03-25T02:05:59+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-03-13T04:59:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9c091160dc57aa5224a35e6755c357f7089ff2e5'/>
<id>urn:sha1:9c091160dc57aa5224a35e6755c357f7089ff2e5</id>
<content type='text'>
Pass in the span for the field rather than using `prev_token`.
Also rename it `mk_expr_tuple_field_access`, because it doesn't do any
actual parsing, it just creates an expression with what it's given.

Not much of a clarity win by itself, but unlocks additional subsequent
simplifications.
</content>
</entry>
<entry>
<title>Remove `next_token` handling from `parse_expr_tuple_field_access`.</title>
<updated>2024-03-25T02:05:59+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-03-13T04:45:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=90eeb3d6817303469059041ef7c8c57f3508f476'/>
<id>urn:sha1:90eeb3d6817303469059041ef7c8c57f3508f476</id>
<content type='text'>
It's clearer at the call site.
</content>
</entry>
</feed>
