rust/src
Nicholas Nethercote bf8ce32558 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 {
```
2025-04-21 07:35:56 +10:00
..
bootstrap Rollup merge of #139931 - ognevny:bootstrap-llvm-zlib, r=Kobzol 2025-04-17 17:40:29 +02: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 Rollup merge of #139859 - marcoieni:rename-macos-runner, r=Kobzol 2025-04-15 21:16:06 +02:00
doc Auto merge of #139949 - matthiaskrgr:rollup-pxc5tsx, r=matthiaskrgr 2025-04-17 11:21:54 +00:00
etc Rollup merge of #139214 - bjorn3:edition_2024_rustfmt, r=compiler-errors 2025-04-02 13:10:42 +11:00
gcc@13cc824322 Update GCC submodule 2025-03-19 15:35:47 +01:00
librustdoc Remove token::{Open,Close}Delim. 2025-04-21 07:35:56 +10:00
llvm-project@a9865ceca0 Update to LLVM 20.1.2 2025-04-02 20:19:43 +08:00
rustc-std-workspace
rustdoc-json-types rustdoc: Use own logic to print #[repr(..)] attributes in JSON output. 2025-03-22 18:47:12 +00:00
tools Remove token::{Open,Close}Delim. 2025-04-21 07:35:56 +10: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.