rust/src
bors fae7785b60 Auto merge of #139897 - nnethercote:rm-OpenDelim-CloseDelim, r=petrochenkov
Remove `token::{Open,Close}Delim`

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 {
```

r? `@petrochenkov`
2025-04-22 01:15:06 +00:00
..
bootstrap Auto merge of #140043 - ChrisDenton:rollup-vwf0s9j, r=ChrisDenton 2025-04-20 02:08:02 +00:00
build_helper Rollup merge of #139870 - Shourya742:2025-04-15-add-retries-to-remove_and_create_dir_all, r=jieyouxu 2025-04-17 17:40:28 +02:00
ci Remove stray newline from post-merge report 2025-04-20 08:57:28 +02:00
doc Rollup merge of #140107 - tshepang:rdg-push, r=jieyouxu 2025-04-21 18:53:20 +00:00
etc Rollup merge of #139843 - thaliaarchi:editor-file-associations, r=Mark-Simulacrum 2025-04-19 19:30:47 +00:00
gcc@13cc824322 Update GCC submodule 2025-03-19 15:35:47 +01:00
librustdoc Auto merge of #139897 - nnethercote:rm-OpenDelim-CloseDelim, r=petrochenkov 2025-04-22 01:15:06 +00:00
llvm-project@a9865ceca0 Update to LLVM 20.1.2 2025-04-02 20:19:43 +08:00
rustc-std-workspace update rustc-std-workspace crates 2024-11-04 07:45:15 +01:00
rustdoc-json-types Update rustdoc-json-types FORMAT_VERSION to 45 2025-04-18 20:34:56 +02:00
tools Auto merge of #139897 - nnethercote:rm-OpenDelim-CloseDelim, r=petrochenkov 2025-04-22 01:15:06 +00:00
README.md
stage0 End all lines in src/stage0 with trailing newline 2025-04-12 11:50:33 -07:00
version Bump to 1.88.0 2025-03-28 16:53:17 +00:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.