-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Emit a warning on generic parameters with doc comments #91397
Conversation
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
2c4dab6
to
76f40e3
Compare
76f40e3
to
bd894a0
Compare
📌 Commit bd894a0 has been approved by |
fn doc_comment_on_generic<#[doc = "x"] T>(val: T) {} | ||
//~^ ERROR: unused doc comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's also worth adding tests for
fn doc_comment_on_generic<
/// x
T>(val: T) {}
//~^^ ERROR: unused doc comment
and
fn doc_comment_on_generic</** foo */ T>(val: T) {}
//~^ ERROR: unused doc comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, GitHub didn't show me that this was already approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to test those, anyway - rustc represents them both as #[doc]
under the hood. There are plenty of other tests that would fail if that weren't the case.
…askrgr Rollup of 4 pull requests Successful merges: - rust-lang#91294 (Visit type in process_projection_elem.) - rust-lang#91340 (Bump compiler_builtins to 0.1.55 to bring in fixes for targets lackin…) - rust-lang#91366 (Only show notable traits if both types are the same) - rust-lang#91397 (Emit a warning on generic parameters with doc comments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes #90610