<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_parse/src/parser, branch 1.50.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.50.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.50.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2020-12-25T02:39:35+00:00</updated>
<entry>
<title>Rollup merge of #80160 - diondokter:move_async_fix, r=davidtwco</title>
<updated>2020-12-25T02:39:35+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2020-12-25T02:39:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=299c2fc69554998e8991715d09a611376a5b9cf3'/>
<id>urn:sha1:299c2fc69554998e8991715d09a611376a5b9cf3</id>
<content type='text'>
Implemented a compiler diagnostic for move async mistake

Fixes #79694

First time contributing, so I hope I'm doing everything right.
(If not, please correct me!)

This code performs a check when a move capture clause is parsed. The check is to detect if the user has reversed the async move keywords and to provide a diagnostic with a suggestion to fix it.

Checked code:
```rust
fn main() {
    move async { };
}
```

Previous output:
```txt
PS C:\Repos\move_async_test&gt; cargo build
   Compiling move_async_test v0.1.0 (C:\Repos\move_async_test)
error: expected one of `|` or `||`, found keyword `async`
 --&gt; src\main.rs:2:10
  |
2 |     move async { };
  |          ^^^^^ expected one of `|` or `||`

error: aborting due to previous error

error: could not compile `move_async_test`
```

New output:
```txt
PS C:\Repos\move_async_test&gt; cargo +dev build
   Compiling move_async_test v0.1.0 (C:\Repos\move_async_test)
error: the order of `move` and `async` is incorrect
 --&gt; src\main.rs:2:13
  |
2 |     let _ = move async { };
  |             ^^^^^^^^^^
  |
help: try switching the order
  |
2 |     let _ = async move { };
  |             ^^^^^^^^^^

error: aborting due to previous error

error: could not compile `move_async_test`
```

Is there a file/module where these kind of things are tested?
Would love some feedback 😄
</content>
</entry>
<entry>
<title>Implemented a compiler diagnostic for move async mistake</title>
<updated>2020-12-21T11:57:08+00:00</updated>
<author>
<name>Dion Dokter</name>
<email>diondokter@gmail.com</email>
</author>
<published>2020-12-18T16:32:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a272d621bc7a2ca61d704fbe531dc532d49ab402'/>
<id>urn:sha1:a272d621bc7a2ca61d704fbe531dc532d49ab402</id>
<content type='text'>
Ran the tidy check

Following the diagnostic guide better

Diagnostic generation is now relegated to its own function in the diagnostics module.
Added tests

Fixed the ui test
</content>
</entry>
<entry>
<title>implement edition-specific :pat behavior for 2015/18</title>
<updated>2020-12-19T13:13:36+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-11-11T00:00:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1a7d00a529503ac38a6b1ae28e8e779e434e02e0'/>
<id>urn:sha1:1a7d00a529503ac38a6b1ae28e8e779e434e02e0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco</title>
<updated>2020-12-19T01:47:05+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-12-19T01:47:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d1741e59cb87d3c8c794eebf6d5430d1b383f51f'/>
<id>urn:sha1:d1741e59cb87d3c8c794eebf6d5430d1b383f51f</id>
<content type='text'>
Gracefully handle mistyping -&gt; as =&gt; in function return type

Fixes #77019
</content>
</entry>
<entry>
<title>Don't allow `const` to begin a nonterminal</title>
<updated>2020-12-17T21:58:56+00:00</updated>
<author>
<name>Camelid</name>
<email>camelidcamel@gmail.com</email>
</author>
<published>2020-12-17T21:51:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d6f1787447e1132d929efbb5b772be232e336c23'/>
<id>urn:sha1:d6f1787447e1132d929efbb5b772be232e336c23</id>
<content type='text'>
Thanks to Vadim Petrochenkov who [told me what the fix was][z]!

[z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
</content>
</entry>
<entry>
<title>Address review comments</title>
<updated>2020-12-17T13:12:48+00:00</updated>
<author>
<name>mibac138</name>
<email>5672750+mibac138@users.noreply.github.com</email>
</author>
<published>2020-12-17T12:44:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e916641fd35bddabc8b018a5e51fe23b93875c66'/>
<id>urn:sha1:e916641fd35bddabc8b018a5e51fe23b93875c66</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #79978 - Aaron1011:fix/capture-broken-token, r=petrochenkov</title>
<updated>2020-12-13T19:31:06+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-12-13T19:31:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=803c60218ffac3384b0063c1b87ae7944163bba7'/>
<id>urn:sha1:803c60218ffac3384b0063c1b87ae7944163bba7</id>
<content type='text'>
Properly capture trailing 'unglued' token

If we try to capture the `Vec&lt;u8&gt;` in `Option&lt;Vec&lt;u8&gt;&gt;`, we'll
need to capture a `&gt;` token which was 'unglued' from a `&gt;&gt;` token.
The processing of unglueing a token for parsing purposes bypasses the
usual capturing infrastructure, so we currently lose the trailing `&gt;`.
As a result, we fall back to the reparsed `TokenStream`, causing us to
lose spans.

This commit makes token capturing keep track of a trailing 'unglued'
token. Note that we don't need to care about unglueing except at the end
of the captured tokens - if we capture both the first and second unglued
tokens, then we'll end up capturing the full 'glued' token, which
already works correctly.
</content>
</entry>
<entry>
<title>Auto merge of #79668 - coolreader18:recover-const-impl, r=petrochenkov</title>
<updated>2020-12-13T10:52:29+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-12-13T10:52:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=057937bddac3f43a46dfc07ee2d9fa59de7b7ca9'/>
<id>urn:sha1:057937bddac3f43a46dfc07ee2d9fa59de7b7ca9</id>
<content type='text'>
Recover on `const impl&lt;&gt; X for Y`

`@leonardo-m` mentioned that `const impl Foo for Bar` could be recovered from in #79287.

I'm not sure about the error strings as they are, I think it should probably be something like the error that `expected_one_of_not_found` makes + the suggestion to flip the keywords, but I'm not sure how exactly to do that. Also, I decided not to try to handle `const unsafe impl` or `unsafe const impl` cause I figured that `unsafe impl const` would be pretty rare anyway (if it's even valid?), and it wouldn't be worth making the code more messy.
</content>
</entry>
<entry>
<title>Properly capture trailing 'unglued' token</title>
<updated>2020-12-12T21:28:13+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-12-12T20:20:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e6fa6334dd54f7c96514b520c5b9f261df3fc16b'/>
<id>urn:sha1:e6fa6334dd54f7c96514b520c5b9f261df3fc16b</id>
<content type='text'>
If we try to capture the `Vec&lt;u8&gt;` in `Option&lt;Vec&lt;u8&gt;&gt;`, we'll
need to capture a `&gt;` token which was 'unglued' from a `&gt;&gt;` token.
The processing of unglueing a token for parsing purposes bypasses the
usual capturing infrastructure, so we currently lose the trailing `&gt;`.
As a result, we fall back to the reparsed `TokenStream`, causing us to
lose spans.

This commit makes token capturing keep track of a trailing 'unglued'
token. Note that we don't need to care about unglueing except at the end
of the captured tokens - if we capture both the first and second unglued
tokens, then we'll end up capturing the full 'glued' token, which
already works correctly.
</content>
</entry>
<entry>
<title>Recover on `const impl&lt;&gt; X for Y`</title>
<updated>2020-12-12T20:45:54+00:00</updated>
<author>
<name>Noah</name>
<email>33094578+coolreader18@users.noreply.github.com</email>
</author>
<published>2020-12-03T18:37:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1e27b65d8e877fd33ff8de20c359282577b8956c'/>
<id>urn:sha1:1e27b65d8e877fd33ff8de20c359282577b8956c</id>
<content type='text'>
</content>
</entry>
</feed>
