<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/expr.rs, branch 1.86.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.86.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.86.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-02-08T22:12:13+00:00</updated>
<entry>
<title>Rustfmt</title>
<updated>2025-02-08T22:12:13+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-08T22:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fcae03369abb4c2cc180cd5a49e1f4440a81300'/>
<id>urn:sha1:1fcae03369abb4c2cc180cd5a49e1f4440a81300</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #135882 - hkBst:master, r=estebank</title>
<updated>2025-01-30T11:45:27+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2025-01-30T11:45:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=78ded09912a6f64ab83978ab70b40ef7ff94b833'/>
<id>urn:sha1:78ded09912a6f64ab83978ab70b40ef7ff94b833</id>
<content type='text'>
simplify `similar_tokens` from `Option&lt;Vec&lt;_&gt;&gt;` to `&amp;[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
</content>
</entry>
<entry>
<title>Use identifiers in diagnostics more often</title>
<updated>2025-01-27T01:23:34+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-01-27T01:16:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac1c6c50f4a82a34002231d2c1a2a5a007af959f'/>
<id>urn:sha1:ac1c6c50f4a82a34002231d2c1a2a5a007af959f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>simplify similar_tokens from Vec&lt;_&gt; to &amp;[_]</title>
<updated>2025-01-23T10:45:42+00:00</updated>
<author>
<name>Marijn Schouten</name>
<email>mhkbst@gmail.com</email>
</author>
<published>2025-01-22T15:50:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5f01e12ea8035fdfc23eefaf6b580dbb9a8863ec'/>
<id>urn:sha1:5f01e12ea8035fdfc23eefaf6b580dbb9a8863ec</id>
<content type='text'>
</content>
</entry>
<entry>
<title>simplify similar_tokens from Option&lt;Vec&lt;_&gt;&gt; to Vec&lt;_&gt;</title>
<updated>2025-01-23T10:45:42+00:00</updated>
<author>
<name>Marijn Schouten</name>
<email>mhkbst@gmail.com</email>
</author>
<published>2025-01-22T15:01:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ccb967438de778b7f4ee3cf94f3e8163f6f5c53f'/>
<id>urn:sha1:ccb967438de778b7f4ee3cf94f3e8163f6f5c53f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Run `clippy --fix` for `unnecessary_map_or` lint</title>
<updated>2025-01-19T19:15:00+00:00</updated>
<author>
<name>Yotam Ofek</name>
<email>yotam.ofek@gmail.com</email>
</author>
<published>2025-01-19T19:15:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=264fa0fc5430f3a9a52a92df706d7c9ac5af4f85'/>
<id>urn:sha1:264fa0fc5430f3a9a52a92df706d7c9ac5af4f85</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change comparison operators to have Fixity::None</title>
<updated>2024-12-21T04:12:22+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2024-12-21T03:50:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fe65e886f30ab4e045e8e492e08f7c5e3a73129a'/>
<id>urn:sha1:fe65e886f30ab4e045e8e492e08f7c5e3a73129a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Speed up `Parser::expected_token_types`.</title>
<updated>2024-12-19T05:05:41+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-04T04:55:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b9bf0b4b10148aa914243a527d9010aba9b7b827'/>
<id>urn:sha1:b9bf0b4b10148aa914243a527d9010aba9b7b827</id>
<content type='text'>
The parser pushes a `TokenType` to `Parser::expected_token_types` on
every call to the various `check`/`eat` methods, and clears it on every
call to `bump`. Some of those `TokenType` values are full tokens that
require cloning and dropping. This is a *lot* of work for something
that is only used in error messages and it accounts for a significant
fraction of parsing execution time.

This commit overhauls `TokenType` so that `Parser::expected_token_types`
can be implemented as a bitset. This requires changing `TokenType` to a
C-style parameterless enum, and adding `TokenTypeSet` which uses a
`u128` for the bits. (The new `TokenType` has 105 variants.)

The new types `ExpTokenPair` and `ExpKeywordPair` are now arguments to
the `check`/`eat` methods. This is for maximum speed. The elements in
the pairs are always statically known; e.g. a
`token::BinOp(token::Star)` is always paired with a `TokenType::Star`.
So we now compute `TokenType`s in advance and pass them in to
`check`/`eat` rather than the current approach of constructing them on
insertion into `expected_token_types`.

Values of these pair types can be produced by the new `exp!` macro,
which is used at every `check`/`eat` call site. The macro is for
convenience, allowing any pair to be generated from a single identifier.

The ident/keyword filtering in `expected_one_of_not_found` is no longer
necessary. It was there to account for some sloppiness in
`TokenKind`/`TokenType` comparisons.

The existing `TokenType` is moved to a new file `token_type.rs`, and all
its new infrastructure is added to that file. There is more boilerplate
code than I would like, but I can't see how to make it shorter.
</content>
</entry>
<entry>
<title>Rename `Parser::expected_tokens` as `Parser::expected_token_types`.</title>
<updated>2024-12-19T05:05:41+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-03T09:09:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=48f7714819525ec5b361ea480eaecea61620a56b'/>
<id>urn:sha1:48f7714819525ec5b361ea480eaecea61620a56b</id>
<content type='text'>
Because the `Token` type is similar to but different to the `TokenType`
type, and the difference is important, so we want to avoid confusion.
</content>
</entry>
<entry>
<title>Rollup merge of #134161 - nnethercote:overhaul-token-cursors, r=spastorino</title>
<updated>2024-12-18T14:56:53+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>39484203+jieyouxu@users.noreply.github.com</email>
</author>
<published>2024-12-18T14:56:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=477f222b02300761cea70ab4644275ce245a37c4'/>
<id>urn:sha1:477f222b02300761cea70ab4644275ce245a37c4</id>
<content type='text'>
Overhaul token cursors

Some nice cleanups here.

r? `````@davidtwco`````
</content>
</entry>
</feed>
