<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/attr.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-08-22T06:37:19+00:00</updated>
<entry>
<title>Move validate_attr to `rustc_attr_parsing`</title>
<updated>2025-08-22T06:37:19+00:00</updated>
<author>
<name>Jonathan Brouwer</name>
<email>jonathantbrouwer@gmail.com</email>
</author>
<published>2025-07-29T14:35:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=21d31897794ed7fc7990de8e664d3c4ec511da7d'/>
<id>urn:sha1:21d31897794ed7fc7990de8e664d3c4ec511da7d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add FnContext in parser for diagnostic</title>
<updated>2025-08-14T13:31:47+00:00</updated>
<author>
<name>xizheyin</name>
<email>xizheyin@smail.nju.edu.cn</email>
</author>
<published>2025-08-14T13:30:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ce555f6313e78d3eed80fd22e22ef49f5bd3611'/>
<id>urn:sha1:3ce555f6313e78d3eed80fd22e22ef49f5bd3611</id>
<content type='text'>
Signed-off-by: xizheyin &lt;xizheyin@smail.nju.edu.cn&gt;
</content>
</entry>
<entry>
<title>Move various token stream things from `rustc_parse` to `rustc_ast`.</title>
<updated>2025-04-29T02:14:27+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2025-04-29T01:18:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=28236ab703d21483dc818108f157fbb2da5a2802'/>
<id>urn:sha1:28236ab703d21483dc818108f157fbb2da5a2802</id>
<content type='text'>
Specifically: `TokenCursor`, `TokenTreeCursor`,
`LazyAttrTokenStreamImpl`, `FlatToken`, `make_attr_token_stream`,
`ParserRange`, `NodeRange`. `ParserReplacement`, and `NodeReplacement`.
These are all related to token streams, rather than actual parsing.

This will facilitate the simplifications in the next commit.
</content>
</entry>
<entry>
<title>Provide helpful diagnostics for shebang lookalikes</title>
<updated>2025-03-13T14:23:53+00:00</updated>
<author>
<name>Pyrode</name>
<email>pyrode.01@gmail.com</email>
</author>
<published>2025-02-27T06:53:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a73e44bce16c9610c5415db3037a69eef0df3c4e'/>
<id>urn:sha1:a73e44bce16c9610c5415db3037a69eef0df3c4e</id>
<content type='text'>
</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>Remove `NtMeta`.</title>
<updated>2025-02-27T21:42:06+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-04-18T06:22:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7ea59e053bed52249ba8f42cbdbc7301312197e3'/>
<id>urn:sha1:7ea59e053bed52249ba8f42cbdbc7301312197e3</id>
<content type='text'>
Note: there was an existing code path involving `Interpolated` in
`MetaItem::from_tokens` that was dead. This commit transfers that to the
new form, but puts an `unreachable!` call inside it.
</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>Re-export more `rustc_span::symbol` things from `rustc_span`.</title>
<updated>2024-12-18T02:38:53+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-12-12T23:29:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2620eb42d72d24baa1ca1056a769862b92c85f7f'/>
<id>urn:sha1:2620eb42d72d24baa1ca1056a769862b92c85f7f</id>
<content type='text'>
`rustc_span::symbol` defines some things that are re-exported from
`rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some
closely related things such as `Ident` and `kw`. So you can do `use
rustc_span::{Symbol, sym}` but you have to do `use
rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good
reason.

This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`,
and changes many `rustc_span::symbol::` qualifiers in `compiler/` to
`rustc_span::`. This is a 200+ net line of code reduction, mostly
because many files with two `use rustc_span` items can be reduced to
one.
</content>
</entry>
<entry>
<title>Add hir::Attribute</title>
<updated>2024-12-15T18:18:46+00:00</updated>
<author>
<name>Jonathan Dönszelmann</name>
<email>jonathan@donsz.nl</email>
</author>
<published>2024-10-16T23:14:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d50c0a5480257cbac33b312cb633777f3d2b2483'/>
<id>urn:sha1:d50c0a5480257cbac33b312cb633777f3d2b2483</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rename NestedMetaItem to MetaItemInner</title>
<updated>2024-10-06T14:28:30+00:00</updated>
<author>
<name>codemountains</name>
<email>4kz12zz@gmail.com</email>
</author>
<published>2024-10-04T12:59:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6dfc4a0473ed0901b9c0d09f5189c41f3882d5fc'/>
<id>urn:sha1:6dfc4a0473ed0901b9c0d09f5189c41f3882d5fc</id>
<content type='text'>
</content>
</entry>
</feed>
