<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_ast/src, branch 1.76.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.76.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.76.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-12-20T00:07:34+00:00</updated>
<entry>
<title>Give `VariantData::Struct`  named fields, to clairfy `recovered`.</title>
<updated>2023-12-20T00:07:34+00:00</updated>
<author>
<name>Alona Enraght-Moony</name>
<email>code@alona.page</email>
</author>
<published>2023-12-19T22:47:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=11337805fba24f88a00c137f6a5af1af296bd71e'/>
<id>urn:sha1:11337805fba24f88a00c137f6a5af1af296bd71e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #118880 - GearsDatapacks:issue-118859-fix, r=compiler-errors</title>
<updated>2023-12-17T20:29:59+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2023-12-17T20:29:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6269bf1a3a17527347d0f7b890840e2cd1ccfd9f'/>
<id>urn:sha1:6269bf1a3a17527347d0f7b890840e2cd1ccfd9f</id>
<content type='text'>
More expressions correctly are marked to end with curly braces

Fixes #118859, and replaces the mentioned match statement with an exhaustive list, so that this code doesn't get overlooked in the future
</content>
</entry>
<entry>
<title>Auto merge of #118897 - nnethercote:more-unescaping-cleanups, r=fee1-dead</title>
<updated>2023-12-16T08:52:06+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-12-16T08:52:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3ad8e2d129a67b0dc450d6ef1100ae41d2cd4b8a'/>
<id>urn:sha1:3ad8e2d129a67b0dc450d6ef1100ae41d2cd4b8a</id>
<content type='text'>
More unescaping cleanups

More minor improvements I found while working on #118699.

r? `@fee1-dead`
</content>
</entry>
<entry>
<title>Fix enforcement of generics for associated items</title>
<updated>2023-12-15T16:17:28+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-12-09T17:27:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bc1ca6b52854d09cfdcb83d0559f3e72720aa41f'/>
<id>urn:sha1:bc1ca6b52854d09cfdcb83d0559f3e72720aa41f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change expr_trailing_brace to an exhaustive match to force new expression kinds to specify whether they contain a brace</title>
<updated>2023-12-14T18:11:18+00:00</updated>
<author>
<name>GearsDatapacks</name>
<email>surya@seriousinfinitude.com</email>
</author>
<published>2023-12-12T15:20:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fc6dbc32b0aba985af20e8eddfb05337f691dc5'/>
<id>urn:sha1:1fc6dbc32b0aba985af20e8eddfb05337f691dc5</id>
<content type='text'>
Add inline const and other possible curly brace expressions to expr_trailing_brace

Add tests for `}` before `else` in `let...else` error

Change to explicit cases for expressions with optional values when being checked for trailing braces

Add tests for more complex cases of `}` before `else` in `let..else` statement

Move other possible `}` cases into separate arm and add FIXME for future reference
</content>
</entry>
<entry>
<title>Unify single-char and multi-char `CStrUnit::Char` handling.</title>
<updated>2023-12-12T23:06:13+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-12T22:46:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a50efe265309d0fee0661121508f77d23aecd82e'/>
<id>urn:sha1:a50efe265309d0fee0661121508f77d23aecd82e</id>
<content type='text'>
The two cases are equivalent. C string literals aren't common so there
is no performance need here.
</content>
</entry>
<entry>
<title>Don't rebuild raw strings when unescaping.</title>
<updated>2023-12-12T22:26:10+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-12-11T05:35:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4acc5e6480e6eada1ad8d867ea31de9b998216a8'/>
<id>urn:sha1:4acc5e6480e6eada1ad8d867ea31de9b998216a8</id>
<content type='text'>
Raw strings don't have escape sequences, so for them "unescaping" just
means checking for invalid chars like bare CR. Which means there is no
need to rebuild them one char or byte at a time while escaping, because
the unescaped version will be the same. This commit removes that
rebuilding.

Also, the commit changes things so that "unescaping" is unconditional for
raw strings and raw byte strings. That's simpler and they're rare enough
that the perf effect is negligible.
</content>
</entry>
<entry>
<title>Don't gate the feature twice</title>
<updated>2023-12-12T13:52:05+00:00</updated>
<author>
<name>Nadrieril</name>
<email>nadrieril+git@gmail.com</email>
</author>
<published>2023-12-12T13:52:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=19e0c984d3ff44c6e273ddae2f327e8ad8726fae'/>
<id>urn:sha1:19e0c984d3ff44c6e273ddae2f327e8ad8726fae</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add spacing information to delimiters.</title>
<updated>2023-12-10T22:36:40+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-10-12T04:36:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4cfdbd328b7171b2328d11b950b1af0978d6b1ef'/>
<id>urn:sha1:4cfdbd328b7171b2328d11b950b1af0978d6b1ef</id>
<content type='text'>
This is an extension of the previous commit. It means the output of
something like this:
```
stringify!(let a: Vec&lt;u32&gt; = vec![];)
```
goes from this:
```
let a: Vec&lt;u32&gt; = vec![] ;
```
With this PR, it now produces this string:
```
let a: Vec&lt;u32&gt; = vec![];
```
</content>
</entry>
<entry>
<title>Improve `print_tts` by changing `tokenstream::Spacing`.</title>
<updated>2023-12-10T22:19:09+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-08-08T01:43:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=925f7fad576b6a8659d93846faf8d9610e59bab0'/>
<id>urn:sha1:925f7fad576b6a8659d93846faf8d9610e59bab0</id>
<content type='text'>
`tokenstream::Spacing` appears on all `TokenTree::Token` instances,
both punct and non-punct. Its current usage:
- `Joint` means "can join with the next token *and* that token is a
  punct".
- `Alone` means "cannot join with the next token *or* can join with the
  next token but that token is not a punct".

The fact that `Alone` is used for two different cases is awkward.
This commit augments `tokenstream::Spacing` with a new variant
`JointHidden`, resulting in:
- `Joint` means "can join with the next token *and* that token is a
  punct".
- `JointHidden` means "can join with the next token *and* that token is a
  not a punct".
- `Alone` means "cannot join with the next token".

This *drastically* improves the output of `print_tts`. For example,
this:
```
stringify!(let a: Vec&lt;u32&gt; = vec![];)
```
currently produces this string:
```
let a : Vec &lt; u32 &gt; = vec! [] ;
```
With this PR, it now produces this string:
```
let a: Vec&lt;u32&gt; = vec![] ;
```
(The space after the `]` is because `TokenTree::Delimited` currently
doesn't have spacing information. The subsequent commit fixes this.)

The new `print_tts` doesn't replicate original code perfectly. E.g.
multiple space characters will be condensed into a single space
character. But it's much improved.

`print_tts` still produces the old, uglier output for code produced by
proc macros. Because we have to translate the generated code from
`proc_macro::Spacing` to the more expressive `token::Spacing`, which
results in too much `proc_macro::Along` usage and no
`proc_macro::JointHidden` usage. So `space_between` still exists and
is used by `print_tts` in conjunction with the `Spacing` field.

This change will also help with the removal of `Token::Interpolated`.
Currently interpolated tokens are pretty-printed nicely via AST pretty
printing. `Token::Interpolated` removal will mean they get printed with
`print_tts`. Without this change, that would result in much uglier
output for code produced by decl macro expansions. With this change, AST
pretty printing and `print_tts` produce similar results.

The commit also tweaks the comments on `proc_macro::Spacing`. In
particular, it refers to "compound tokens" rather than "multi-char
operators" because lifetimes aren't operators.
</content>
</entry>
</feed>
