about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-18 07:37:47 +0000
committerbors <bors@rust-lang.org>2022-08-18 07:37:47 +0000
commit1da9156b0d0eca01aaea06e2ae246c16dacf3053 (patch)
treed951431938d32111b1f9d3bae6a4e2cfa0a2072b /compiler/rustc_interface/src/errors.rs
parentae57b697e2d78a0eecd9d6609891b4cfd5853007 (diff)
parentcebf95718c32b1024a6845992bee96c50f830f3a (diff)
downloadrust-1da9156b0d0eca01aaea06e2ae246c16dacf3053.tar.gz
rust-1da9156b0d0eca01aaea06e2ae246c16dacf3053.zip
Auto merge of #12982 - jridgewell:into_future, r=Veykril
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](https://github.com/rust-lang/rust/pull/98718).
Diffstat (limited to 'compiler/rustc_interface/src/errors.rs')
0 files changed, 0 insertions, 0 deletions