Skip to content

When finding an invalid outer doc comment, suggest turning it into a comment #67553

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

Closed
estebank opened this issue Dec 23, 2019 · 0 comments · Fixed by #68669
Closed

When finding an invalid outer doc comment, suggest turning it into a comment #67553

estebank opened this issue Dec 23, 2019 · 0 comments · Fixed by #68669
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `//!self.allow_ty_infer()`
    --> src/librustc_typeck/astconv.rs:2461:21
     |
2460 |                     false
     |                          - expected one of `.`, `;`, `?`, `}`, or an operator
2461 |                     //!self.allow_ty_infer()
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^ unexpected token

should be

error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `//!self.allow_ty_infer()`
    --> src/librustc_typeck/astconv.rs:2461:21
     |
2460 |                     false
     |                          - expected one of `.`, `;`, `?`, `}`, or an operator
2461 |                     //!self.allow_ty_infer()
     |                     ---^^^^^^^^^^^^^^^^^^^^^ unexpected token
     |                     |
     |                     help: if you wanted a regular comment, add a space before the exclamation mark: `// !`
@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. labels Dec 23, 2019
@JohnTitor JohnTitor added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Dec 24, 2019
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jan 30, 2020
suggest adding space in accidental doc comments

Fixes rust-lang#67553.

r? @estebank
@bors bors closed this as completed in b3e63f2 Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-newcomer-roadblock Diagnostics: Confusing error or lint; hard to understand for new users. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants