Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #64946

Merged
merged 52 commits into from
Oct 1, 2019
Merged

Rollup of 10 pull requests #64946

merged 52 commits into from
Oct 1, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Oct 1, 2019

Successful merges:

Failed merges:

r? @ghost

AnthonyMikh and others added 30 commits September 25, 2019 22:55
1. Rewrite `if let` into `match` to return earl and avoid indenting giant block 
2. Assign `spans_updated` only once
`taken` is actually used afterwards
Add some tests for macros in extern blocks, remove duplicate tests
This commit silences the unreachable code lint when it originates from
within a await desugaring.

Signed-off-by: David Wood <david@davidtw.co>
davidtwco and others added 17 commits September 30, 2019 23:41
This commit improves obligation errors for async/await:

```
note: future does not implement `std::marker::Send` because this value is used across an
      await
  --> $DIR/issue-64130-non-send-future-diags.rs:15:5
   |
LL |     let g = x.lock().unwrap();
   |         - has type `std::sync::MutexGuard<'_, u32>`
LL |     baz().await;
   |     ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
   | - `g` is later dropped here
```

Signed-off-by: David Wood <david@davidtw.co>
Reborrowing doesn't work for loops
Closure typing obligations flow in both direcitons to properly infer
types. Because of this, we will get 2 type errors whenever there's
an unfulfilled obligation. To avoid this, we deduplicate them in the
`InferCtxt`.
syntax: Support modern attribute syntax in the `meta` matcher

Where "modern" means rust-lang#57367:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```

Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (rust-lang#34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice.

Closes rust-lang#49629 (by fully supporting `meta` rather than removing it.)
Stabilize macros in some more positions

- Fn-like macros and attribute macros in `extern` blocks
- Fn-like procedural macros in type positions
- ~Attribute macros on inline modules~ (moved to rust-lang#64273)

Stabilization report: rust-lang#63931 (comment).

Closes rust-lang#49476
cc rust-lang#54727
…tebank

syntax: recover trailing `|` in or-patterns

Fixes rust-lang#64879.

For example (this also shows that we are sensitive to the typo `||`):

```
error: a trailing `|` is not allowed in an or-pattern
  --> $DIR/remove-leading-vert.rs:33:11
   |
LL |         A || => {}
   |         - ^^ help: remove the `||`
   |         |
   |         while parsing this or-pattern starting here
   |
   = note: alternatives in or-patterns are separated with `|`, not `||`
```

r? @estebank
…efinition, r=nikomatsakis

async/await: improve not-send errors

cc rust-lang#64130.

```
note: future does not implement `std::marker::Send` because this value is used across an await
  --> $DIR/issue-64130-non-send-future-diags.rs:15:5
   |
LL |     let g = x.lock().unwrap();
   |         - has type `std::sync::MutexGuard<'_, u32>`
LL |     baz().await;
   |     ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
   | - `g` is later dropped here
```

r? @nikomatsakis
Remove legacy grammar

Revival of rust-lang#50835 & rust-lang#55545

On the #wg-grammar discord there was agreement that enough progress has been made to be able to remove the legacy grammar.

r? @Centril @qmx

cc @rust-lang/wg-grammar
A small amount of tidying-up factored out from PR rust-lang#64648

As requested by @Mark-Simulacrum, I put this in a separate commit to make it easier to review. (As far as I can tell, no violations of the policy here, and they are simply in a separate PR because they're not directly related to the import of that PR.)

r? @Mark-Simulacrum
…it, r=petrochenkov

Silence unreachable code lint from await desugaring

Fixes rust-lang#61798.

This PR silences the unreachable code lint when it originates from within an await desugaring.
…__code-clarity, r=estebank

Improve code clarity

No commit except 55b5428 address performance, just making the existing code more clear.

r? @estebank
Deduplicate closure type errors

Closure typing obligations flow in both direcitons to properly infer
types. Because of this, we will get 2 type errors whenever there's
an unfulfilled obligation. To avoid this, we deduplicate them in the
`InferCtxt`.
@Centril
Copy link
Contributor Author

Centril commented Oct 1, 2019

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Oct 1, 2019

📌 Commit 46bf6ad has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 1, 2019
@bors
Copy link
Contributor

bors commented Oct 1, 2019

⌛ Testing commit 46bf6ad with merge 702b45e...

bors added a commit that referenced this pull request Oct 1, 2019
Rollup of 10 pull requests

Successful merges:

 - #63674 (syntax: Support modern attribute syntax in the `meta` matcher)
 - #63931 (Stabilize macros in some more positions)
 - #64887 (syntax: recover trailing `|` in or-patterns)
 - #64895 (async/await: improve not-send errors)
 - #64896 (Remove legacy grammar)
 - #64907 (A small amount of tidying-up factored out from PR #64648)
 - #64928 (Add tests for some issues)
 - #64930 (Silence unreachable code lint from await desugaring)
 - #64935 (Improve code clarity)
 - #64937 (Deduplicate closure type errors)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Oct 1, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 702b45e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 1, 2019
@bors bors merged commit 46bf6ad into rust-lang:master Oct 1, 2019
@Centril Centril deleted the rollup-66mj5o0 branch October 1, 2019 11:55
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants