-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Nellshamrell/improve async error #86705
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
Changes from 2 commits
93ef6b3
0ec98df
686eaf4
0f05538
4eddf27
11dccad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ LL | | } | |
::: $DIR/auxiliary/issue-81839.rs:6:49 | ||
| | ||
LL | pub async fn answer_str(&self, _s: &str) -> Test { | ||
| ---- checked the `Output` of this `async fn`, found opaque type | ||
| ---- calling an async function returns a future | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like the diagnostic is saying that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we could highlight the entire function signature and say something like:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To better support macros, I think we should keep pointing to the return type, but mention the function name in the error message. This will produce a nicer message when the return type tokens are constructed separately (e.g. a type passed into a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the suggestion - any pointers on how to surface the function name in the error message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look conveniently accessible at the moment. Maybe @estebank has a suggestion on the cleanest way to get the name of the desugared async function? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In https://github.com/rust-lang/rust/pull/86705/files#diff-845d26194de711d60e1317dbe90812d5d7635f4f758222fd7e14bf550ffe895dL1522 we have the |
||
| | ||
= note: while checking the return type of the `async fn` | ||
= note: expected type `()` | ||
|
Uh oh!
There was an error while loading. Please reload this page.