-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Blank document comment in trait raises error different from with that in function. #56766
Comments
From https://doc.rust-lang.org/stable/error-index.html#E0585 , if I use blank document comment but not in the end, it doesn't raise E0585 error. fn test(){
///
println!("Hello world");
} so should we adjust the error message of E0585 or adjust the parser? |
When expecting an identifier, the parser will check if the non-identifier found was a documentation comment and emit E0585: rust/src/libsyntax/parse/parser.rs Lines 830 to 853 in 7489ee9
An option would be to modify rust/src/libsyntax/parse/parser.rs Lines 865 to 871 in 7489ee9
|
will do |
I don't have a lot of time right now, in case someone else wants to fix this you are free to go ahead. |
@estebank Can I take a shot at this? I'm new to rust. |
@saleemjaffer feel free to do so! If you look at the linked PR I believe @lcnr was in the right track. |
@est31 I was trying to change the I thought of checking if the current token is a So do we proceed this way or proceed in the direction of the linked PR? |
@saleemjaffer you can potentially modify the following and rust/src/libsyntax/parse/parser.rs Lines 1342 to 1351 in 7e001e5
but I feel that might be overkill. Why do you need ot modify the |
…er_error_msg, r=pnkfelix fixes rust-lang#56766 fixes rust-lang#56766
…er_error_msg, r=pnkfelix fixes rust-lang#56766 fixes rust-lang#56766
Rollup of 7 pull requests Successful merges: - #58507 (Add a -Z time option which prints only passes which runs once) - #58919 (Suggest using anonymous lifetime in `impl Trait` return) - #59041 (fixes #56766) - #59586 (Fixed URL in cargotest::TEST_REPOS) - #59595 (Update rustc-guide submodule) - #59601 (Fix small typo) - #59603 (stabilize ptr::hash) Failed merges: r? @ghost
If I use document comment that doesn't document anything in function,
it will raise error:
But if I use this in trait, the error confuses me.
The text was updated successfully, but these errors were encountered: