Stabilize into_future#98718
Stabilize into_future#98718bors merged 1 commit intorust-lang:masterfrom yoshuawuyts:stabilize-into-future
into_future#98718Conversation
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
This comment has been minimized.
This comment has been minimized.
|
Can you open a PR to the reference to update the I think it would look something similar to the Thanks! |
|
@ehuss definitely, happy to do that once this has been merged! |
|
@rust-lang/libs-api can we merge this? |
|
we can indeed @bors r+ |
…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`
…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
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).
#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