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 |
|
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 comment has been minimized.
This comment has been minimized.
|
@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 |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
Just one! I win at crater golf! |
There was a problem hiding this comment.
r=me after lang FCP
Crater results look reasonable to me, only 1 crate broken, which is already fixed by @mejrs (thanks!) in Martan03/termint#13
|
Always happy to go straight to error for things that are clearly bugs that weren't supposed to work, so glad crater said we could :) |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
1c5fe3f to
6539813
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. |
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