-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
pub/async/doc comment parse error #52790
Comments
cc @cramertj |
This can be fixed by handling The |
@estebank I'd like to work on this, how we should handle |
The issue here is just that we don't recognize out-of-order |
The work needs to happen in the parser in a couple of places (trait fn items and bare fns are parsed in different places). If you look at |
It would be before doing |
Hmm, I wasn't able to find |
@JohnTitor, yes, I was writing it off the top of my head, the correct code is the one you came up with :) |
@estebank Okay! But I don't know how change |
@estebank Uh, could I open a draft PR and ask you to review? |
I'll have to look at the code in detail, but you'll probably will have to make the returned
Of course! Go ahead :) |
The changes need to be made in
These are all the other things parsed in
Not sure how we should proceed. We could move the parsing of the modifiers into a separate function, make it check the order of the modifiers and also check for duplicates. That would, however, still not allow for things like Furthermore each branch would have to make sure that only modifiers are set that make sense for the particular branch. Seems like this would complicate things quite a bit. Should I proceed with that strategy or does anyone have a better suggestion? |
I would like to deal with this issue. But #76447 addresses the same issue. |
There is one last thing in the patch #76447 (comment), but it doesn't seemed to be near the stuff I do I believe, it may need some tweak. |
Triage: this no longer seems to be an issue. The code: /// Blah blah blah
/// Blah
async pub fn foo() -> impl Future<()> {todo!()} yields this error:
|
When the async and pub identifiers are swapped next to a doc comment:
a confusing error is returned:
instead of making it clear pub should be first
The text was updated successfully, but these errors were encountered: