Emit errors/warns on some wrong uses of rustdoc attributes#80300
Emit errors/warns on some wrong uses of rustdoc attributes#80300bors merged 4 commits intorust-lang:masterfrom
Conversation
|
I think this should probably go through FCP - I'll take a look at the code first so the review isn't intermingled with the policy change. |
This comment has been minimized.
This comment has been minimized.
b790ab6 to
febf1d5
Compare
This comment has been minimized.
This comment has been minimized.
febf1d5 to
9209218
Compare
|
Also, it could be interesting to add a macro like https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/macro.struct_span_err.html for warnings (but without error code). |
9209218 to
9a06773
Compare
I think that's https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.struct_span_lint_hir. |
This comment has been minimized.
This comment has been minimized.
fd06236 to
86abf85
Compare
This comment has been minimized.
This comment has been minimized.
46d72f8 to
fe46d75
Compare
This comment has been minimized.
This comment has been minimized.
fe46d75 to
b6f1c7f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b6f1c7f to
2848ea9
Compare
|
I don't have time to look at this. r? @Manishearth |
Manishearth
left a comment
There was a problem hiding this comment.
Overall looks great, would love to have more doc comments
|
@Manishearth Added a few doc comments in a separate commit. Let me know if you'd want anything else documented. |
|
@bors r+ thanks! |
|
📌 Commit 6e8d0db has been approved by |
|
⌛ Testing commit 6e8d0db with merge ac17b18a35f83579e5f75a8da8a7756f4abc9b17... |
This comment has been minimized.
This comment has been minimized.
|
💔 Test failed - checks-actions |
|
This is the only case of invalid |
|
@bors r+ |
|
📌 Commit 804ab9f has been approved by |
|
☀️ Test successful - checks-actions |
This PR adds a few diagnostics:
#[doc(inline)]/#[doc(no_inline)]are foundinvalid_doc_attributeslint (warn-by-default) which triggers:crateitem#[doc(inline)]/#[doc(no_inline)]is used on a non-useitemThe code could probably be improved but I wanted to get feedback first. Also, some of those changes could be considered breaking changes, so I don't know what the procedure would be?
And finally, for the warnings, they are currently hard warnings, maybe it would be better to introduce a lint?(EDIT: introduced theinvalid_doc_attributeslint)Closes #80275.
r? @jyn514