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

Implement IntoFuture type inference #12982

Merged
merged 3 commits into from
Aug 18, 2022
Merged

Conversation

jridgewell
Copy link
Contributor

@jridgewell jridgewell commented Aug 9, 2022

One of my projects is using IntoFuture 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 into a match into_future(foo) {}, with every Future impl getting a default IntoFuture implementation. I'm not sure if we want to disable the old future_trait paths, since this only recently stabilize.

crates/hir/src/lib.rs Outdated Show resolved Hide resolved
crates/hir/src/lib.rs Show resolved Hide resolved
crates/hir/src/source_analyzer.rs Outdated Show resolved Hide resolved
@Veykril
Copy link
Member

Veykril commented Aug 18, 2022

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Aug 18, 2022

📌 Commit cebf957 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 18, 2022

⌛ Testing commit cebf957 with merge 1da9156...

@bors
Copy link
Contributor

bors commented Aug 18, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 1da9156 to master...

@bors bors merged commit 1da9156 into rust-lang:master Aug 18, 2022
@jridgewell jridgewell deleted the into_future branch August 18, 2022 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants