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 5 pull requests #66180

Merged
merged 23 commits into from
Nov 7, 2019
Merged

Rollup of 5 pull requests #66180

merged 23 commits into from
Nov 7, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Nov 7, 2019

Successful merges:

Failed merges:

r? @ghost

eddyb and others added 23 commits November 3, 2019 10:17
As we might want to add `IntoIterator` impls for arrays in the future,
and since that introduces a breaking change, this lint warns and
suggests using `iter()` instead (which is shorter and more explicit).
We also sever syntax's dependency on rustc_target as a result.
This should slightly improve pipe-lining.

Moreover, some cleanup is done in related code.
Revert two unapproved changes to rustc_typeck.

There was a breakdown in process (rust-lang#59004 (comment), rust-lang#58894 (comment)) and two changes were made to `rustc_typeck`'s "collect" queries, for rustdoc, that were neither needed *nor* correct.
I'm reverting them here, and will fix up rustdoc *somehow*, if necessary.

cc @rust-lang/compiler How do we ensure this doesn't happen again?

r? @nikomatsakis or @oli-obk
Use structured suggestions for missing associated items

When encountering an `impl` that is missing associated items required by its `trait`, use structured suggestions at an appropriate place in the `impl`.
…chenkov

syntax: ABI-oblivious grammar

This PR has the following effects:

1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal.

2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate.

3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place.

4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat.

cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :)

r? @varkor
…petrochenkov

A scheme for more macro-matcher friendly pre-expansion gating

Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated:

```rust
macro_rules! m {
    ($e:expr) => { 0 }; // This fails on the input below due to `, foo`.
    (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`.
}

fn main() {
    assert_eq!(1, m!(box 42, foo));
}
```

Closes rust-lang#65846.

r? @petrochenkov
cc @Mark-Simulacrum
…t, r=matthewjasper

Add future incompatibility lint for `array.into_iter()`

This is for rust-lang#65819. This lint warns when calling `into_iter` on an array directly. That's because today the method call resolves to `<&[T] as IntoIterator>::into_iter` but that would change when adding `IntoIterator` impls for arrays. This problem is discussed in detail in rust-lang#65819.

We still haven't decided how to proceed exactly, but it seems like adding a lint is a good idea regardless?

Also: this is the first time I implement a lint, so there are probably a lot of things I can improve. I used a different strategy than @scottmcm describes [here](rust-lang#65819 (comment)) since I already started implementing this before they commented.

### TODO

- [x] Decide if we want this lint -> apparently [we want](rust-lang#65819 (comment))
- [x] Open a lint-tracking-issue and add the correct issue number in the code -> rust-lang#66145
@Centril
Copy link
Contributor Author

Centril commented Nov 7, 2019

@bors r+ p=5 rollup=never

@bors
Copy link
Contributor

bors commented Nov 7, 2019

📌 Commit c9eae9e 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 Nov 7, 2019
@Centril Centril added the rollup A PR which is a rollup label Nov 7, 2019
@bors
Copy link
Contributor

bors commented Nov 7, 2019

⌛ Testing commit c9eae9e with merge 50f8aad...

bors added a commit that referenced this pull request Nov 7, 2019
Rollup of 5 pull requests

Successful merges:

 - #59789 (Revert two unapproved changes to rustc_typeck.)
 - #65752 (Use structured suggestions for missing associated items)
 - #65884 (syntax: ABI-oblivious grammar)
 - #65974 (A scheme for more macro-matcher friendly pre-expansion gating)
 - #66017 (Add future incompatibility lint for `array.into_iter()`)

Failed merges:

 - #66056 (rustc_metadata: Some reorganization of the module structure)

r? @ghost
@bors
Copy link
Contributor

bors commented Nov 7, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 50f8aad to master...

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.

5 participants