-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Bad error message with async main #68523
Comments
Implementation notes:
cc @estebank who has dealt with |
This is a good first-contribution ticket I can help with. |
I will take you up on that offer Wednesday evening if that is good with you. |
@rustbot claim |
@estebank Though I realize it might be too late for today. But how should be chat? |
I'm on the street now, but if you have specific questions I can answer them when I get home. |
Work is going well. I should have a preliminary PR up early next week. |
I have two things that I have run into:
|
@Nokel81 could you push your code to a branch we can look at and comment inline? You should be extracting an existing span. |
|
Ping from triage. @estebank, could you follow up? |
I am still interested in working on this. |
I'm looking quickly over the branch, @Nokel81. @estebank or others may feel differently but my take: I don't think it's a good idea to return If we were going to use However, we could also just just include the span for the "yes, is async" variant. This is what the |
Thanks for the quick look over @nikomatsakis. I am wondering what should happen if an error occurs where it is required to be async but isn't (maybe I am thinking too hard in the future). I sort of like the span of the |
@Nokel81 we can solve that problem later, but in that scenario, having a "dummy span" on hand would not be especially useful anyway -- that is, though, I think the right question to be asking, which is why I suggested the span for the "fn" keyword (or perhaps the fn name). i.e., what would you want to highlight in such a case? |
but perhaps better to wait until indeed we have such a message to emit, which might help clarify things |
Makes sense, I'll see about transitioning my change set to that using |
If someone tries to do the following
async fn main() -> Result<(), Box<dyn std::error::Error>
the error message is not helpful (though it is technically correct).I think that it should point to the
async
keyword and say that standard rust does not supportasync
main.This issue has been assigned to @Nokel81 via this comment.
The text was updated successfully, but these errors were encountered: