<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/attr_wrapper.rs, branch 1.87.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.87.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.87.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-02-08T22:12:13+00:00</updated>
<entry>
<title>Rustfmt</title>
<updated>2025-02-08T22:12:13+00:00</updated>
<author>
<name>bjorn3</name>
<email>17426603+bjorn3@users.noreply.github.com</email>
</author>
<published>2025-02-08T22:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fcae03369abb4c2cc180cd5a49e1f4440a81300'/>
<id>urn:sha1:1fcae03369abb4c2cc180cd5a49e1f4440a81300</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Introduce `InvisibleOrigin` on invisible delimiters.</title>
<updated>2024-11-20T21:16:54+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-04-16T23:59:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=afe238f66fc9348b8c4a1daacefb93c0ec36296a'/>
<id>urn:sha1:afe238f66fc9348b8c4a1daacefb93c0ec36296a</id>
<content type='text'>
It's not used meaningfully yet, but will be needed to get rid of
interpolated tokens.
</content>
</entry>
<entry>
<title>Revert "Avoid nested replacement ranges" from #129346.</title>
<updated>2024-11-04T04:57:35+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-11-04T04:41:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=981dc02eaf876a25b95581411e841ba664dc9e97'/>
<id>urn:sha1:981dc02eaf876a25b95581411e841ba664dc9e97</id>
<content type='text'>
It caused a test regression in the `cfg_eval.rs` crate. (The bugfix
in #129346 was in a different commit; this commit was just a code
simplification.)
</content>
</entry>
<entry>
<title>Rollup merge of #130551 - nnethercote:fix-break-last-token, r=petrochenkov</title>
<updated>2024-09-23T14:54:44+00:00</updated>
<author>
<name>Jubilee</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2024-09-23T14:54:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=515bdcda01fb56609600d2f6214a382511046341'/>
<id>urn:sha1:515bdcda01fb56609600d2f6214a382511046341</id>
<content type='text'>
Fix `break_last_token`.

It currently doesn't handle the three-char tokens `&gt;&gt;=` and `&lt;&lt;=` correctly. These can be broken twice, resulting in three individual tokens. This is a latent bug that currently doesn't cause any problems, but does cause problems for #124141, because that PR increases the usage of lazy token streams.

r? `@petrochenkov`
</content>
</entry>
<entry>
<title>Fix `break_last_token`.</title>
<updated>2024-09-22T23:14:30+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-09-19T09:32:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73cc5751773d4c49cc9d938548762520037926ba'/>
<id>urn:sha1:73cc5751773d4c49cc9d938548762520037926ba</id>
<content type='text'>
It currently doesn't handle the three-char tokens `&gt;&gt;=` and `&lt;&lt;=`
correctly. These can be broken twice, resulting in three individual
tokens. This is a latent bug that currently doesn't cause any problems,
but does cause problems for #124141, because that PR increases the usage
of lazy token streams.
</content>
</entry>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>clippy::useless_conversion</title>
<updated>2024-09-11T21:52:53+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-11T18:58:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6d064295c8fb7413cb0500289f922f8d7feb38dc'/>
<id>urn:sha1:6d064295c8fb7413cb0500289f922f8d7feb38dc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Optimize `collect_tokens` a little.</title>
<updated>2024-08-23T20:58:35+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-08-22T03:14:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d4bf28c014772f7233fc396992164c72c08fbfd9'/>
<id>urn:sha1:d4bf28c014772f7233fc396992164c72c08fbfd9</id>
<content type='text'>
Use `Cow` to avoid cloning `ret.attrs()` unless necessary. This requires
moving some things around to satisfy the borrow checker.
</content>
</entry>
<entry>
<title>Avoid double-handling of attributes in `collect_tokens`.</title>
<updated>2024-08-23T20:57:47+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-08-21T04:16:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1fdabfbebbb12b2836f91aeec3157fd092f9a8ad'/>
<id>urn:sha1:1fdabfbebbb12b2836f91aeec3157fd092f9a8ad</id>
<content type='text'>
By keeping track of attributes that have been previously processed.

This fixes the `macro-rules-derive-cfg.stdout` test, and is necessary
for #124141 which removes nonterminals.

Also shrink the `SmallVec` inline size used in `IntervalSet`. 2 gives
slightly better perf than 4 now that there's an `IntervalSet` in
`Parser`, which is cloned reasonably often.
</content>
</entry>
<entry>
<title>Avoid nested replacement ranges.</title>
<updated>2024-08-23T04:40:08+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-08-20T02:28:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0bae33fcd503473aec70aef28b0e08abce965557'/>
<id>urn:sha1:0bae33fcd503473aec70aef28b0e08abce965557</id>
<content type='text'>
In a case like this:
```
mod a {
    mod b {
        #[cfg_attr(unix, inline)]
        fn f() {
            #[cfg_attr(linux, inline)]
            fn g1() {}
            #[cfg_attr(linux, inline)]
            fn g2() {}
        }
    }
}
```
We currently end up with the following replacement ranges.
- The lazy tokens for `f` has replacement ranges for `g1` and `g2`.
- The lazy tokens for `a` has replacement ranges for `f`, `g1`, and
  `g2`.

I.e. the replacement ranges for `g1` and `g2` are duplicated. In
general, replacement ranges for inner AST nodes are duplicated up the
chain for each nested `collect_tokens` call. And the code that processes
the replacements is careful about the ordering in which the replacements
are applied, to ensure that inner replacements are applied before outer
replacements.

But all of this is unnecessary. If you apply an inner replacement and
then an outer replacement, the outer replacement completely overwrites
the inner replacement.

This commit avoids the duplication by removing replacements from
`self.capture_state.parser_replacements` when they are used. (The effect
on the example above is that the lazy tokesn for `a` no longer include
replacement ranges for `g1` and `g2`.) This eliminates the possibility
of nested replacements on individual AST nodes, which avoids the need
for careful ordering of replacements.
</content>
</entry>
</feed>
