Conversation
63a2f0f to
f705d49
Compare
This comment has been minimized.
This comment has been minimized.
f705d49 to
11ac310
Compare
This comment has been minimized.
This comment has been minimized.
11ac310 to
478a22c
Compare
This comment has been minimized.
This comment has been minimized.
478a22c to
65407a3
Compare
This comment has been minimized.
This comment has been minimized.
65407a3 to
9b15145
Compare
This comment has been minimized.
This comment has been minimized.
9b15145 to
dd5debd
Compare
This comment has been minimized.
This comment has been minimized.
dd5debd to
1953f77
Compare
This comment has been minimized.
This comment has been minimized.
1953f77 to
3888e00
Compare
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
3888e00 to
8c0900d
Compare
This comment has been minimized.
This comment has been minimized.
8c0900d to
9fdd707
Compare
|
@JonathanBrouwer this is ready for review now |
…onathanbrouwer rework handling of doc attributes on macro calls rust-lang#160904 but with the fcw changes removed r? @JonathanBrouwer
Rollup merge of #161514 - mejrs:move_doc_feature_gating, r=jonathanbrouwer rework handling of doc attributes on macro calls #160904 but with the fcw changes removed r? @JonathanBrouwer
This comment has been minimized.
This comment has been minimized.
708eacf to
20a64c9
Compare
This comment has been minimized.
This comment has been minimized.
20a64c9 to
e42b6b2
Compare
|
We discussed this in the lang meeting today. Those present were happy to approve this, and also to go straight to a hard error, crater permitting. @rfcbot fcp merge lang |
|
@tmandry has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
Thanks @mejrs, @JonathanBrouwer. @rfcbot reviewed |
|
I'll go ahead and crater this asap, I'd rather not have the complexity of emitting the lint anyway |
e42b6b2 to
1c5fe3f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Error on non-literal expressions in doc attributes on macro calls
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
View all comments
Recently I discovered that, since Rust 1.94, doc attributes on macro invocations can have arbitrary expressions in them:
As part of the attribute parsing rework this was accidentally allowed. Note that doc attributes (or any doc comment) on macro invocations do nothing, because documentation for macro invocations is not rendered - this emits a lint saying macros must produce doc comments as part of their expansion.
With this PR, it now emits a FCW, like #57571. As this is so niche it's probable this could go straight to an error but there's quite a crater queue so I'd rather do this now and try turning it into an error later.
Note that
#[doc = mac!()]is included in this. While this is allowed everywhere else as normally attribute parsing only sees it after its expansion, it is not expanded here, but we do need to check attributes here since we can't check them later as they're lost by then.I don't think it is worth trying to make particular case work - this would involve checking that the expression would expand to a string literal:
This change would also make it consistent with all other key-value attributes. For an example, the following are allowed
but this is not:
r? @JonathanBrouwer