Add invalid doc comment help message#36964
Conversation
|
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
src/libsyntax/feature_gate.rs
Outdated
There was a problem hiding this comment.
I would instead make a version of this function (say, feature_err) that returns the err instead of calling err.emit(), and have this function just do feature_err(...).emit(). Then the existing callers of this function don't need to change for the None argument, and the stmt_expr_attributes one can do let err = feature_err(...); err.help(...); err.emit();.
src/libsyntax/config.rs
Outdated
There was a problem hiding this comment.
I would say something like
`///` is for documentation comments. For a plain comment, use `//`.
There was a problem hiding this comment.
Won't this help trigger for all misplaced attributes? It should only trigger for misplaced doc attributes.
|
☔ The latest upstream changes (presumably #36945) made this pull request unmergeable. Please resolve the merge conflicts. |
2da209d to
aad86c0
Compare
|
Updated. |
|
We now need a reviewer. cc @jonathandturner :p |
src/libsyntax/config.rs
Outdated
There was a problem hiding this comment.
Oh, I forgot to bring this up again.
This help should only be generated for misplaced doc comments, but this will generate it for any misplaced attributes at all.
There was a problem hiding this comment.
@solson - sounds like an interesting point. @GuillaumeGomez ?
There was a problem hiding this comment.
Didn't think of testing in other cases. Good point! I'll check a bit later.
src/libsyntax/feature_gate.rs
Outdated
There was a problem hiding this comment.
Nit: indentation is off here
aad86c0 to
93417fa
Compare
|
Updated. |
|
@bors r+ rollup |
|
📌 Commit 93417fa has been approved by |
…athandturner Add invalid doc comment help message Fixes rust-lang#36946. Any opinion on the message?
…athandturner Add invalid doc comment help message Fixes rust-lang#36946. Any opinion on the message?
Fixes #36946.
Any opinion on the message?