<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libsyntax_ext/deriving/generic/mod.rs, branch 1.35.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.35.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.35.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2019-03-25T12:21:46+00:00</updated>
<entry>
<title>Auto merge of #59256 - petrochenkov:derval2, r=Zoxc</title>
<updated>2019-03-25T12:21:46+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2019-03-25T12:21:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d91b32b4dc9db066ab7deedbc51dc62ba597524b'/>
<id>urn:sha1:d91b32b4dc9db066ab7deedbc51dc62ba597524b</id>
<content type='text'>
Make meta-item API compatible with `LocalInternedString::get` soundness fix

r? @Zoxc
</content>
</entry>
<entry>
<title>Remove methods is_struct/is_tuple/is_unit from VariantData</title>
<updated>2019-03-24T09:10:16+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2019-03-23T21:06:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c667c2fc0896b2a58a363d2c535881e5b983857a'/>
<id>urn:sha1:c667c2fc0896b2a58a363d2c535881e5b983857a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make meta-item API compatible with `LocalInternedString::get` soundness fix</title>
<updated>2019-03-17T14:04:58+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2019-03-17T11:17:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=db74efce69711fcee03d3338afcbca67c27ceee8'/>
<id>urn:sha1:db74efce69711fcee03d3338afcbca67c27ceee8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>syntax: Do not accidentally treat multi-segment meta-items as single-segment</title>
<updated>2019-03-16T20:13:15+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2019-02-28T06:17:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8371caf5ee13e775d2b2dc64c9b08e37dab49eda'/>
<id>urn:sha1:8371caf5ee13e775d2b2dc64c9b08e37dab49eda</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustc: doc comments</title>
<updated>2019-02-10T23:42:32+00:00</updated>
<author>
<name>Alexander Regueiro</name>
<email>alexreg@me.com</email>
</author>
<published>2019-02-08T13:53:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c3e182cf43aea2c010a1915eb37293a458df2228'/>
<id>urn:sha1:c3e182cf43aea2c010a1915eb37293a458df2228</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support const generics in derive</title>
<updated>2019-02-07T14:02:16+00:00</updated>
<author>
<name>varkor</name>
<email>github@varkor.com</email>
</author>
<published>2019-02-05T15:50:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d7695abb7667d2e8b7a010282ad5f44abbc58a58'/>
<id>urn:sha1:d7695abb7667d2e8b7a010282ad5f44abbc58a58</id>
<content type='text'>
Co-Authored-By: Gabriel Smith &lt;yodaldevoid@users.noreply.github.com&gt;
</content>
</entry>
<entry>
<title>Rollup merge of #58133 - taiki-e:libsyntax_ext-2018, r=Centril</title>
<updated>2019-02-07T05:57:40+00:00</updated>
<author>
<name>kennytm</name>
<email>kennytm@gmail.com</email>
</author>
<published>2019-02-07T05:57:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=262b241e1652e8c07442fff261e4701e3871442f'/>
<id>urn:sha1:262b241e1652e8c07442fff261e4701e3871442f</id>
<content type='text'>
libsyntax_ext =&gt; 2018

Transitions `libsyntax_ext` to Rust 2018; cc #58099

r? @Centril
</content>
</entry>
<entry>
<title>Overhaul `syntax::fold::Folder`.</title>
<updated>2019-02-05T22:06:27+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2019-02-05T04:20:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9fcb1658ab13a7f722e4747c5a4b691291e88a3b'/>
<id>urn:sha1:9fcb1658ab13a7f722e4747c5a4b691291e88a3b</id>
<content type='text'>
This commit changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&amp;mut T`), and
renames it `syntax::mut_visit::MutVisitor`.

The first benefit is speed. The functional style does not require any
reallocations, due to the use of `P::map` and
`MoveMap::move_{,flat_}map`. However, every field in the AST must be
overwritten; even those fields that are unchanged are overwritten with
the same value. This causes a lot of unnecessary memory writes. The
imperative style reduces instruction counts by 1--3% across a wide range
of workloads, particularly incremental workloads.

The second benefit is conciseness; the imperative style is usually more
concise. E.g. compare the old functional style:
```
fn fold_abc(&amp;mut self, abc: ABC) {
    ABC {
        a: fold_a(abc.a),
        b: fold_b(abc.b),
        c: abc.c,
    }
}
```
with the imperative style:
```
fn visit_abc(&amp;mut self, ABC { a, b, c: _ }: &amp;mut ABC) {
    visit_a(a);
    visit_b(b);
}
```
(The reductions get larger in more complex examples.)

Overall, the patch removes over 200 lines of code -- even though the new
code has more comments -- and a lot of the remaining lines have fewer
characters.

Some notes:

- The old style used methods called `fold_*`. The new style mostly uses
  methods called `visit_*`, but there are a few methods that map a `T`
  to something other than a `T`, which are called `flat_map_*` (`T` maps
  to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s).

- `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed
  `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to
  reflect their slightly changed signatures.

- Although this commit renames the `fold` module as `mut_visit`, it
  keeps it in the `fold.rs` file, so as not to confuse git. The next
  commit will rename the file.
</content>
</entry>
<entry>
<title>libsyntax_ext =&gt; 2018</title>
<updated>2019-02-04T12:49:54+00:00</updated>
<author>
<name>Taiki Endo</name>
<email>te316e89@gmail.com</email>
</author>
<published>2019-02-04T12:49:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94f121ff3f47fecdcf458b691f1bf87f8b1f1f1d'/>
<id>urn:sha1:94f121ff3f47fecdcf458b691f1bf87f8b1f1f1d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove licenses</title>
<updated>2018-12-26T04:08:33+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2018-12-25T15:56:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2a663555ddf36f6b041445894a8c175cd1bc718c'/>
<id>urn:sha1:2a663555ddf36f6b041445894a8c175cd1bc718c</id>
<content type='text'>
</content>
</entry>
</feed>
