<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser/attr_wrapper.rs, branch 1.65.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.65.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.65.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-09-09T07:25:38+00:00</updated>
<entry>
<title>Rename `{Create,Lazy}TokenStream` as `{To,Lazy}AttrTokenStream`.</title>
<updated>2022-09-09T07:25:38+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-09-09T07:15:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d2df07c425f9b390c33e0ac31674ce4794352b3a'/>
<id>urn:sha1:d2df07c425f9b390c33e0ac31674ce4794352b3a</id>
<content type='text'>
`To` is better than `Create` for indicating that this is a non-consuming
conversion, rather than creating something out of nothing.

And the addition of `Attr` is because the current names makes them sound
like they relate to `TokenStream`, but really they relate to
`AttrTokenStream`.
</content>
</entry>
<entry>
<title>Rename `AttrAnnotatedToken{Stream,Tree}`.</title>
<updated>2022-09-09T02:45:26+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-09-09T02:44:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a56d345490ed68ab57cf1854dd8978fefc9862d0'/>
<id>urn:sha1:a56d345490ed68ab57cf1854dd8978fefc9862d0</id>
<content type='text'>
These two type names are long and have long matching prefixes. I find
them hard to read, especially in combinations like
`AttrAnnotatedTokenStream::new(vec![AttrAnnotatedTokenTree::Token(..)])`.

This commit renames them as `AttrToken{Stream,Tree}`.
</content>
</entry>
<entry>
<title>Move `Spacing` out of `AttrAnnotatedTokenStream`.</title>
<updated>2022-09-09T02:00:46+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-09-09T01:51:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=890e759ffcf61a2c66f722bb448432b9a78fdaaf'/>
<id>urn:sha1:890e759ffcf61a2c66f722bb448432b9a78fdaaf</id>
<content type='text'>
And into `AttrAnnotatedTokenTree::Token`.

PR #99887 did the same thing for `TokenStream`.
</content>
</entry>
<entry>
<title>remove redundant clones</title>
<updated>2022-09-03T05:58:41+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2022-09-03T05:58:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=57198b549f20a63650113b11b806f535a9d35fbb'/>
<id>urn:sha1:57198b549f20a63650113b11b806f535a9d35fbb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorino</title>
<updated>2022-09-01T08:01:06+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-09-01T08:01:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=eac6c33bc6338f40e66975dd6f65dab27765067b'/>
<id>urn:sha1:eac6c33bc6338f40e66975dd6f65dab27765067b</id>
<content type='text'>
Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`

`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec&lt;T&gt;(Option&lt;Box&lt;Vec&lt;T&gt;&gt;&gt;);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec&lt;TypeBinding&gt;` rather than a `&amp;[TypeBinding]`, because this
  avoid some unnecessary allocations.

r? `@spastorino`
</content>
</entry>
<entry>
<title>Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`.</title>
<updated>2022-08-29T05:42:13+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-08-17T04:22:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b38106b6d8478fbfbded5403ee31c056c71cef48'/>
<id>urn:sha1:b38106b6d8478fbfbded5403ee31c056c71cef48</id>
<content type='text'>
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec&lt;T&gt;(Option&lt;Box&lt;Vec&lt;T&gt;&gt;&gt;);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec&lt;TypeBinding&gt;` rather than a `&amp;[TypeBinding]`, because this
  avoid some unnecessary allocations.
</content>
</entry>
<entry>
<title>Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot</title>
<updated>2022-08-28T18:31:08+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-08-28T18:31:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce36e88256f09078519f8bc6b21e4dc88f88f523'/>
<id>urn:sha1:ce36e88256f09078519f8bc6b21e4dc88f88f523</id>
<content type='text'>
Avoid cloning a collection only to iterate over it

`@rustbot` label: +C-cleanup
</content>
</entry>
<entry>
<title>Use `AttrVec` in more places.</title>
<updated>2022-08-21T21:35:33+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2022-08-17T02:34:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=619b8abaa65efd7fcc05453381e532ed8b716cf0'/>
<id>urn:sha1:619b8abaa65efd7fcc05453381e532ed8b716cf0</id>
<content type='text'>
In some places we use `Vec&lt;Attribute&gt;` and some places we use
`ThinVec&lt;Attribute&gt;` (a.k.a. `AttrVec`). This results in various points
where we have to convert between `Vec` and `ThinVec`.

This commit changes the places that use `Vec&lt;Attribute&gt;` to use
`AttrVec`. A lot of this is mechanical and boring, but there are
some interesting parts:
- It adds a few new methods to `ThinVec`.
- It implements `MapInPlace` for `ThinVec`, and introduces a macro to
  avoid the repetition of this trait for `Vec`, `SmallVec`, and
  `ThinVec`.

Overall, it makes the code a little nicer, and has little effect on
performance. But it is a precursor to removing
`rustc_data_structures::thin_vec::ThinVec` and replacing it with
`thin_vec::ThinVec`, which is implemented more efficiently.
</content>
</entry>
<entry>
<title>avoid cloning and then iterating</title>
<updated>2022-08-13T14:16:52+00:00</updated>
<author>
<name>KaDiWa</name>
<email>kalle.wachsmuth@gmail.com</email>
</author>
<published>2022-08-13T13:50:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4eebcb9910c1180791b0e5dba5b3192d0e0046a4'/>
<id>urn:sha1:4eebcb9910c1180791b0e5dba5b3192d0e0046a4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ast: Introduce some traits to get AST node properties generically</title>
<updated>2022-05-11T09:43:27+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2022-05-01T17:58:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f2b7fa484739d3f7d1303c7d42138040caaf435e'/>
<id>urn:sha1:f2b7fa484739d3f7d1303c7d42138040caaf435e</id>
<content type='text'>
And use them to avoid constructing some artificial `Nonterminal` tokens during expansion
</content>
</entry>
</feed>
