<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser, branch 1.63.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.63.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.63.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-06-20T07:41:46+00:00</updated>
<entry>
<title>Rollup merge of #98183 - dtolnay:emptybound, r=lcnr</title>
<updated>2022-06-20T07:41:46+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>jtitor@2k36.org</email>
</author>
<published>2022-06-20T07:41:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b6fb582cb7804da8ebe4f13027b14e7d4a248bff'/>
<id>urn:sha1:b6fb582cb7804da8ebe4f13027b14e7d4a248bff</id>
<content type='text'>
Fix pretty printing of empty bound lists in where-clause

Repro:

```rust
macro_rules! assert_item_stringify {
    ($item:item $expected:literal) =&gt; {
        assert_eq!(stringify!($item), $expected);
    };
}

fn main() {
    assert_item_stringify! {
        fn f&lt;'a, T&gt;() where 'a:, T: {}
        "fn f&lt;'a, T&gt;() where 'a:, T: {}"
    }
}
```

Previously this assertion would fail because rustc renders the where-clause as `where 'a, T` which is invalid syntax.

This PR makes the above assertion pass.

This bug also affects `-Zunpretty=expanded`. The intention is for that to emit syntactically valid code, but the buggy output is not valid Rust syntax.

```console
$ rustc &lt;(echo "fn f&lt;'a, T&gt;() where 'a:, T: {}") -Zunpretty=expanded
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
fn f&lt;'a, T&gt;() where 'a, T {}
```

```console
$ rustc &lt;(echo "fn f&lt;'a, T&gt;() where 'a:, T: {}") -Zunpretty=expanded | rustc -
error: expected `:`, found `,`
 --&gt; &lt;anon&gt;:7:23
  |
7 | fn f&lt;'a, T&gt;() where 'a, T {}
  |                       ^ expected `:`
```
</content>
</entry>
<entry>
<title>remove the rest of unnecessary `to_string`</title>
<updated>2022-06-17T09:48:09+00:00</updated>
<author>
<name>Takayuki Maeda</name>
<email>takoyaki0316@gmail.com</email>
</author>
<published>2022-06-17T09:48:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2135331a3352fa81dcb8592daa435d7a32d93ca0'/>
<id>urn:sha1:2135331a3352fa81dcb8592daa435d7a32d93ca0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix pretty printing of empty type bound lists in where-clause</title>
<updated>2022-06-17T00:24:50+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2022-06-17T00:14:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fe9635f7c0751aaa23f0b0d2309882a1a4641f9b'/>
<id>urn:sha1:fe9635f7c0751aaa23f0b0d2309882a1a4641f9b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros</title>
<updated>2022-06-16T02:19:31+00:00</updated>
<author>
<name>Chayim Refael Friedman</name>
<email>chayimfr@gmail.com</email>
</author>
<published>2022-05-24T23:41:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0ef4098a540f0e8b91f64e1a5670b4e3ff1f48f3'/>
<id>urn:sha1:0ef4098a540f0e8b91f64e1a5670b4e3ff1f48f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improve parsing errors and suggestions for bad if statements</title>
<updated>2022-06-14T03:53:48+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2022-05-28T04:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d1ba2d25d483a65f41ca6277c160e2ea6d813e3b'/>
<id>urn:sha1:d1ba2d25d483a65f41ca6277c160e2ea6d813e3b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #95211 - terrarier2111:improve-parser, r=compiler-errors</title>
<updated>2022-06-13T22:47:22+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>jtitor@2k36.org</email>
</author>
<published>2022-06-13T22:47:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e3a3c00be805c265e5be3b478d76423371459c3b'/>
<id>urn:sha1:e3a3c00be805c265e5be3b478d76423371459c3b</id>
<content type='text'>
Improve parser diagnostics

This pr fixes https://github.com/rust-lang/rust/issues/93867 and contains a couple of diagnostics related changes to the parser.
Here is a short list with some of the changes:
- don't suggest the same thing that is the current token
- suggest removing the current token if the following token is one of the suggestions (maybe incorrect)
- tell the user to put a type or lifetime after where if there is none (as a warning)
- reduce the amount of tokens suggested (via the new eat_noexpect and check_noexpect methods)

If any of these changes are undesirable, i can remove them, thanks!
</content>
</entry>
<entry>
<title>remove unnecessary `to_string` and `String::new` for `tool_only_span_suggestion`</title>
<updated>2022-06-13T07:01:16+00:00</updated>
<author>
<name>Takayuki Maeda</name>
<email>takoyaki0316@gmail.com</email>
</author>
<published>2022-06-13T07:01:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fd1290a63165155e4f7ec469ae6aeddf0bfb9f70'/>
<id>urn:sha1:fd1290a63165155e4f7ec469ae6aeddf0bfb9f70</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove unnecessary `to_string` and `String::new`</title>
<updated>2022-06-13T06:48:40+00:00</updated>
<author>
<name>Takayuki Maeda</name>
<email>takoyaki0316@gmail.com</email>
</author>
<published>2022-06-13T06:48:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=77d6176e69de8bcdc15a12402ce7245f06ca2329'/>
<id>urn:sha1:77d6176e69de8bcdc15a12402ce7245f06ca2329</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improves parser diagnostics, fixes #93867</title>
<updated>2022-06-12T15:48:52+00:00</updated>
<author>
<name>threadexception</name>
<email>hannes.gaumann@outlook.de</email>
</author>
<published>2022-05-01T17:05:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=21fdd549f63499a6f15160c22175cc9c3bbeb473'/>
<id>urn:sha1:21fdd549f63499a6f15160c22175cc9c3bbeb473</id>
<content type='text'>
</content>
</entry>
<entry>
<title>use `create_snapshot_for_diagnostic` instead of `clone`</title>
<updated>2022-06-12T08:27:36+00:00</updated>
<author>
<name>Takayuki Maeda</name>
<email>takoyaki0316@gmail.com</email>
</author>
<published>2022-06-12T08:27:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84a13a28b749eb4765da0918131a47461fb99e3d'/>
<id>urn:sha1:84a13a28b749eb4765da0918131a47461fb99e3d</id>
<content type='text'>
</content>
</entry>
</feed>
