<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_ast_pretty/src/pprust/mod.rs, branch 1.77.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.77.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.77.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-06-15T10:19:09+00:00</updated>
<entry>
<title>Fix suggestion for E0404 not dealing with multiple generics</title>
<updated>2023-06-15T10:19:09+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2023-06-10T09:06:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=32ae8810fcc6d96a1e7e5447f5b35759ca338ed9'/>
<id>urn:sha1:32ae8810fcc6d96a1e7e5447f5b35759ca338ed9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustc_parse: Move AST -&gt; TokenStream conversion logic to `rustc_ast`</title>
<updated>2022-05-22T09:01:07+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2022-05-21T12:50:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8e8fb4f49e7272b8dcbd25807a3ae8408ac41ce8'/>
<id>urn:sha1:8e8fb4f49e7272b8dcbd25807a3ae8408ac41ce8</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>
<entry>
<title>Remove &amp;self from PrintState::to_string</title>
<updated>2021-12-28T00:20:50+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2021-12-28T00:20:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e9fbe79292783972a222afd270db3f77c0b4f3c8'/>
<id>urn:sha1:e9fbe79292783972a222afd270db3f77c0b4f3c8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>expand: Turn `ast::Crate` into a first class expansion target</title>
<updated>2021-11-28T07:48:55+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2021-10-17T16:32:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=141c6cc78ece04fb8330b2c28a42c025500d2d0e'/>
<id>urn:sha1:141c6cc78ece04fb8330b2c28a42c025500d2d0e</id>
<content type='text'>
And stop creating a fake `mod` item for the crate root when expanding a crate.
</content>
</entry>
<entry>
<title>Convert some functions to return Cow&lt;'static,str&gt; instead of String to reduce potential reallocations</title>
<updated>2021-08-24T21:24:44+00:00</updated>
<author>
<name>klensy</name>
<email>klensy@users.noreply.github.com</email>
</author>
<published>2021-08-22T16:55:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c565339c37def41500c6d3175c2db3be8c5c4f76'/>
<id>urn:sha1:c565339c37def41500c6d3175c2db3be8c5c4f76</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove (lots of) dead code</title>
<updated>2021-03-28T02:16:33+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-03-16T05:50:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=441dc3640a408e612064464b0c6308bdca6c16ce'/>
<id>urn:sha1:441dc3640a408e612064464b0c6308bdca6c16ce</id>
<content type='text'>
Found with https://github.com/est31/warnalyzer.

Dubious changes:
- Is anyone else using rustc_apfloat? I feel weird completely deleting
  x87 support.
- Maybe some of the dead code in rustc_data_structures, in case someone
  wants to use it in the future?
- Don't change rustc_serialize

  I plan to scrap most of the json module in the near future (see
  https://github.com/rust-lang/compiler-team/issues/418) and fixing the
  tests needed more work than I expected.

TODO: check if any of the comments on the deleted code should be kept.
</content>
</entry>
<entry>
<title>rustc_ast_pretty: Remove `PrintState::insert_extra_parens`</title>
<updated>2021-01-07T21:43:38+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2021-01-07T14:58:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f915e3e5cff7505178bb19286db8abd7b8eb25dc'/>
<id>urn:sha1:f915e3e5cff7505178bb19286db8abd7b8eb25dc</id>
<content type='text'>
It's no longer necessary after #79472
</content>
</entry>
<entry>
<title>Allow skipping extra paren insertion during AST pretty-printing</title>
<updated>2020-10-11T16:09:48+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-09-26T16:51:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ea468f427016bbf89819199bb8420afc27e64a7f'/>
<id>urn:sha1:ea468f427016bbf89819199bb8420afc27e64a7f</id>
<content type='text'>
Fixes #74616
Makes progress towards #43081
Unblocks PR #76130

When pretty-printing an AST node, we may insert additional parenthesis
to ensure that precedence is properly preserved in code we output.
However, the proc macro implementation relies on comparing a
pretty-printed AST node to the captured `TokenStream`. Inserting extra
parenthesis changes the structure of the reparsed `TokenStream`, making
the comparison fail.

This PR refactors the AST pretty-printing code to allow skipping the
insertion of additional parenthesis. Several freestanding methods are
moved to trait methods on `PrintState`, which keep track of an internal
`insert_extra_parens` flag. This flag is normally `true`, but we expose
a public method which allows pretty-printing a nonterminal with
`insert_extra_parens = false`.

To avoid changing the public interface of `rustc_ast_pretty`, the
freestanding `_to_string` methods are changed to delegate to a
newly-crated `State`. The main pretty-printing code is moved to a new
`state` module to ensure that it does not accidentally call any of these
public helper functions (instead, the internal functions with the same
name should be used).
</content>
</entry>
<entry>
<title>Move pprust code to a 'state' submodule</title>
<updated>2020-10-11T16:09:48+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-09-26T16:41:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a20ae8901c1160b4044dda803cb061630e2f8331'/>
<id>urn:sha1:a20ae8901c1160b4044dda803cb061630e2f8331</id>
<content type='text'>
</content>
</entry>
</feed>
