<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/tests.rs, branch cargo_update</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=cargo_update</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=cargo_update'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-09T17:49:40+00:00</updated>
<entry>
<title>Strip frontmatter in fewer places</title>
<updated>2025-09-09T17:49:40+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2025-09-08T17:25:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a66925a8138df105f77d646f9206024baf7ea4b'/>
<id>urn:sha1:7a66925a8138df105f77d646f9206024baf7ea4b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove `P`</title>
<updated>2025-08-09T07:47:01+00:00</updated>
<author>
<name>Deadbeef</name>
<email>ent3rm4n@gmail.com</email>
</author>
<published>2025-08-09T05:24:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ad1113f87ef828b300ebb8fca397efd358580da3'/>
<id>urn:sha1:ad1113f87ef828b300ebb8fca397efd358580da3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat: Right align line numbers</title>
<updated>2025-07-28T22:32:11+00:00</updated>
<author>
<name>Scott Schafer</name>
<email>schaferjscott@gmail.com</email>
</author>
<published>2025-05-30T22:03:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aa9767290e46c9c73fa1fd3abb52277b4d07cfae'/>
<id>urn:sha1:aa9767290e46c9c73fa1fd3abb52277b4d07cfae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Extract Translator struct</title>
<updated>2025-06-19T18:02:04+00:00</updated>
<author>
<name>Cameron Steffen</name>
<email>cam.steffen94@gmail.com</email>
</author>
<published>2025-06-19T18:02:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=07b9bb1855596ac84a80d898b40c4b403f1dcc3f'/>
<id>urn:sha1:07b9bb1855596ac84a80d898b40c4b403f1dcc3f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ast: Remove token visiting from AST visitor</title>
<updated>2025-04-30T07:36:03+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2025-04-29T06:59:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6668d13de27be6382f06cbdc253d9a48f62e4c34'/>
<id>urn:sha1:6668d13de27be6382f06cbdc253d9a48f62e4c34</id>
<content type='text'>
It's no longer necessary after the removal of nonterminal tokens in #124141.
</content>
</entry>
<entry>
<title>Remove `token::{Open,Close}Delim`.</title>
<updated>2025-04-20T21:35:56+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-04-16T06:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bf8ce32558a4657d077a6761eaa293d0645c2e16'/>
<id>urn:sha1:bf8ce32558a4657d077a6761eaa293d0645c2e16</id>
<content type='text'>
By replacing them with `{Open,Close}{Param,Brace,Bracket,Invisible}`.

PR #137902 made `ast::TokenKind` more like `lexer::TokenKind` by
replacing the compound `BinOp{,Eq}(BinOpToken)` variants with fieldless
variants `Plus`, `Minus`, `Star`, etc. This commit does a similar thing
with delimiters. It also makes `ast::TokenKind` more similar to
`parser::TokenType`.

This requires a few new methods:
- `TokenKind::is_{,open_,close_}delim()` replace various kinds of
  pattern matches.
- `Delimiter::as_{open,close}_token_kind` are used to convert
  `Delimiter` values to `TokenKind`.

Despite these additions, it's a net reduction in lines of code. This is
because e.g. `token::OpenParen` is so much shorter than
`token::OpenDelim(Delimiter::Parenthesis)` that many multi-line forms
reduce to single line forms. And many places where the number of lines
doesn't change are still easier to read, just because the names are
shorter, e.g.:
```
-   } else if self.token != token::CloseDelim(Delimiter::Brace) {
+   } else if self.token != token::CloseBrace {
```
</content>
</entry>
<entry>
<title>Impl `Copy` for `Token` and `TokenKind`.</title>
<updated>2025-04-02T05:16:49+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-05-15T23:22:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d8f7577b5f2f7c72d1e258c07b882d0afcf0956'/>
<id>urn:sha1:4d8f7577b5f2f7c72d1e258c07b882d0afcf0956</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move `ast::Item::ident` into `ast::ItemKind`.</title>
<updated>2025-04-01T03:08:57+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-03-20T22:47:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=df247968f267d30fb8b048c21f595f2293d8ff62'/>
<id>urn:sha1:df247968f267d30fb8b048c21f595f2293d8ff62</id>
<content type='text'>
`ast::Item` has an `ident` field.

- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
  `Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
  `Trait`, `TraitAlias`, `MacroDef`, `Delegation`.

- It's always empty for these item kinds: `Use`, `ForeignMod`,
  `GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.

There is a similar story for `AssocItemKind` and `ForeignItemKind`.

Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.

The commit is large but it's mostly obvious plumbing work. Some notable
things.

- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
  fields within some of the `ast::ItemKind` variants (specifically:
  `Struct`, `Union`, `Enum`). I might do that in a follow-up; this
  commit is big enough already.

- For the visitors: `FnKind` no longer needs an `ident` field because
  the `Fn` within how has one.

- In the parser, the `ItemInfo` typedef is no longer needed. It was used
  in various places to return an `Ident` alongside an `ItemKind`, but
  now the `Ident` (if present) is within the `ItemKind`.

- In a few places I renamed identifier variables called `name` (or
  `foo_name`) as `ident` (or `foo_ident`), to better match the type, and
  because `name` is normally used for `Symbol`s. It's confusing to see
  something like `foo_name.name`.
</content>
</entry>
<entry>
<title>Rename `ast::TokenKind::Not` as `ast::TokenKind::Bang`.</title>
<updated>2025-03-02T22:26:13+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-20T03:04:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=53167c0b7f8112a492b9442058a034605a120c9e'/>
<id>urn:sha1:53167c0b7f8112a492b9442058a034605a120c9e</id>
<content type='text'>
For consistency with `rustc_lexer::TokenKind::Bang`, and because other
`ast::TokenKind` variants generally have syntactic names instead of
semantic names (e.g. `Star` and `DotDot` instead of `Mul` and `Range`).
</content>
</entry>
<entry>
<title>Stop passing the same resource multiple times when building ParseSess</title>
<updated>2025-02-06T17:30:10+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-05T15:16:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b9b2c3affcc51e85d793f51875db067513642863'/>
<id>urn:sha1:b9b2c3affcc51e85d793f51875db067513642863</id>
<content type='text'>
</content>
</entry>
</feed>
