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

[beta] Rollup backports #59235

Merged
merged 25 commits into from Mar 16, 2019
Merged

[beta] Rollup backports #59235

merged 25 commits into from Mar 16, 2019

Conversation

pietroalbini
Copy link
Member

Cherry-picked:

Rolled up:

r? @ghost

ehuss and others added 25 commits March 15, 2019 10:26
Previously, a promoted that contains a function item wouldn't have the
function items bounds propagated to
the main function body.
Type annotations are shared between the MIR of a function and the
promoted constants for that function, so keep them in the type checker
when we check the promoted MIR.
…Trait check.

Note that the two previous visitors were omitting slightly different
recursive calls, so I need two flags to properly emulate them.
Instead of a sticky-boolean flag that would downgrade errors to
warnings during further recursion into the type (which is overly broad
because we were not missing errors at arbitrarily deep levels), this
instead tracks state closer to what the original bug actually was.

In particular, the actual original bug was that we were failing to
record the existence of an outer `impl Trait` solely when it occurred
as an *immediate child* during the walk of the child types in
`visit_generic_args`.

Therefore, the correct way to precisely model when that bug would
manifest itself (and thus downgrade the error-to-warning accordingly)
is to track when those outer `impl Trait` cases were previously
unrecorded.

That's what this code does, by storing a flag with the recorded outer
`impl Trait` indicating at which point in the compiler's control flow
it had been stored.

I will note that this commit passes the current test suite. A
follow-up commit will also include tests illustrating the cases that
this commit gets right (and were handled incorrectly by the previous
sticky boolean).
@pietroalbini
Copy link
Member Author

@bors r+ p=500

@bors
Copy link
Contributor

bors commented Mar 16, 2019

📌 Commit 0e9e6ec has been approved by pietroalbini

@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 Mar 16, 2019
@bors
Copy link
Contributor

bors commented Mar 16, 2019

⌛ Testing commit 0e9e6ec with merge 7473869...

bors added a commit that referenced this pull request Mar 16, 2019
[beta] Rollup backports

Cherry-picked:

* Include bounds from promoted constants in NLL #57202
* Warning period for detecting nested impl trait #58608
* Don't promote function calls to nonpromotable things #58784
* Make migrate mode work at item level granularity #58788
* Expand where negative supertrait specific error is shown #58861
* Expand where negative supertrait specific error is shown #58861

Rolled up:

* [BETA] Update cargo #59217

r? @ghost
@bors
Copy link
Contributor

bors commented Mar 16, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: pietroalbini
Pushing 7473869 to beta...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 16, 2019
@bors bors merged commit 0e9e6ec into rust-lang:beta Mar 16, 2019
@pietroalbini pietroalbini deleted the beta-rollup branch March 17, 2019 15:40
@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.

None yet

8 participants