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

Stabilize into_future #98718

Merged
merged 1 commit into from
Jul 8, 2022
Merged

Stabilize into_future #98718

merged 1 commit into from
Jul 8, 2022

Conversation

yoshuawuyts
Copy link
Member

#67644 has been labeled with S-tracking-ready-to-stabilize - which mentions someone needs to file a stabilization PR. So hence this PR! ✨ Thanks!

Closes #67644

r? @joshtriplett

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 30, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jun 30, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 30, 2022
@rust-log-analyzer

This comment has been minimized.

@ehuss
Copy link
Contributor

ehuss commented Jun 30, 2022

Can you open a PR to the reference to update the await documentation to include the desugarring that uses IntoFuture here: https://github.com/rust-lang/reference/blob/master/src/expressions/await-expr.md?

I think it would look something similar to the for desuggaring for IntoIterator.

Thanks!

@yoshuawuyts
Copy link
Member Author

@ehuss definitely, happy to do that once this has been merged!

@yoshuawuyts
Copy link
Member Author

@rust-lang/libs-api can we merge this?

@yaahc
Copy link
Member

yaahc commented Jul 7, 2022

we can indeed

@bors r+

@bors
Copy link
Contributor

bors commented Jul 7, 2022

📌 Commit 992cfc1 has been approved by yaahc

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 7, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 8, 2022
…r=yaahc

Stabilize `into_future`

rust-lang#67644 has been labeled with [S-tracking-ready-to-stabilize](https://github.com/rust-lang/rust/labels/S-tracking-ready-to-stabilize) - which mentions someone needs to file a stabilization PR. So hence this PR! ✨ Thanks!

Closes rust-lang#67644

r? `@joshtriplett`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 8, 2022
…askrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#95635 (sess: stabilize `--terminal-width` as `--diagnostic-width`)
 - rust-lang#98718 (Stabilize `into_future`)
 - rust-lang#98795 (A few cleanups)
 - rust-lang#98798 (Fix caching bug in `download-rustc = true`)
 - rust-lang#99019 (Add doc comments in `rustc_middle::mir`)
 - rust-lang#99026 (Add test for and fix rust-lang/rust-clippy#9131)

Failed merges:

 - rust-lang#98957 ( don't allow ZST in ScalarInt )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9c6bcb6 into rust-lang:master Jul 8, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 8, 2022
@yoshuawuyts yoshuawuyts deleted the stabilize-into-future branch July 8, 2022 12:03
@dtolnay dtolnay added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 8, 2022
bors added a commit to rust-lang/rust-analyzer that referenced this pull request Aug 18, 2022
Implement IntoFuture type inference

One of my projects is using [IntoFuture](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) to make our async code a little less verbose. However, rust-analyzer can't infer the output type of an await expression if the value uses `IntoFuture` to convert into another type. So we're getting `{unknown}` types everywhere since switching.

`foo.await` itself [desugars](https://github.com/rust-lang/rust/blob/e4417cf020fbcd6182c11637bc6b8694434bd81a/compiler/rustc_ast_lowering/src/expr.rs#L644-L658) into a `match into_future(foo) {}`, with every `Future` impl getting a [default](https://github.com/rust-lang/rust/blob/e4417cf020fbcd6182c11637bc6b8694434bd81a/library/core/src/future/into_future.rs#L131-L139) `IntoFuture` implementation. I'm not sure if we want to disable the old `future_trait` paths, since this only recently [stabilize](rust-lang/rust#98718).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for IntoFuture
9 participants