explain doc comments in macros a bit#98882
Conversation
|
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
davidtwco
left a comment
There was a problem hiding this comment.
LGTM, r=me unless you want to address the comment first
There was a problem hiding this comment.
"which is what this macro attempted to match" seems confusing. It seems to be using "macro" to mean "the compiler's expansion of this macro". But I would normally expect it to mean "the matchers defined in the macro", which makes this confusing - if it matches, why didn't it compile?
I think just the first half (this is a doc comment) is clear enough, maybe keep only that?
There was a problem hiding this comment.
@jyn514, I wanted to stress that the macro sees the token stream # ! [ doc = and not /// doc comment, and that's why we get "unexpected ! token". is there a clearer way to express this?
There was a problem hiding this comment.
I don't find this message confusing, so I'll approve and if we come up with something better then we change it to that in a follow up.
c888b7c to
1f574de
Compare
|
re-requesting review for last commit @rustbot ready |
1f574de to
4a46f36
Compare
4a46f36 to
d2e5a92
Compare
|
@bors r=davidtwco |
Rollup of 5 pull requests Successful merges: - rust-lang#98882 (explain doc comments in macros a bit) - rust-lang#98907 (Deny float const params even when `adt_const_params` is enabled) - rust-lang#99091 (Do not mention private types from other crates as impl candidates) - rust-lang#99140 (Implement `SourceMap::is_span_accessible`) - rust-lang#99147 (Mention similarly named associated type even if it's not clearly in supertrait) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Open to suggestions on improving this... macro parsing is very foreign to me.
Should we have a structured suggestion to turn them into their regular non-doc comments?
Fixes #92846
Fixes #97850