Skip to content

rework handling of doc attributes on macro calls - #161514

Open
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:move_doc_feature_gating
Open

rework handling of doc attributes on macro calls#161514
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:move_doc_feature_gating

Conversation

@mejrs

@mejrs mejrs commented Aug 22, 2026

Copy link
Copy Markdown
Member

#160904 but with the fcw changes removed

r? @JonathanBrouwer

@rustbot

rustbot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 22, 2026
error[E0658]: this subset of the `doc` attribute is meant for internal use only
--> $DIR/feature-gate-rustdoc_internals.rs:11:3
|
LL | #[doc(fake_variadic)]

@JonathanBrouwer JonathanBrouwer Aug 22, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this point to fake_variadic rather than doc?

View changes since the review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2026
}

// FIXME accidentally allowed on Stable Rust
if target == Target::MacroCall && is_doc_non_lit_expr(attr) {

@JonathanBrouwer JonathanBrouwer Aug 22, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an independent change from the feature gate changes, I'd prefer this to be in an independent commit if it's not too much of a hassle

View changes since the review

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if my commits can stand on their own, so I'd rather not do this.

Moving the feature parsing also requires changes to how OmitDoc is used, in order to correctly feature gate

    #[doc(fake_variadic)]
    //~^ ERROR this subset of the `doc` attribute is meant for internal use only [E0658]
    println!();

I think it would be simpler to just do it all in one commit.

@mejrs
mejrs force-pushed the move_doc_feature_gating branch from 639ab86 to 6c8b490 Compare August 22, 2026 22:16
@rust-log-analyzer

This comment has been minimized.

@mejrs
mejrs force-pushed the move_doc_feature_gating branch from 6c8b490 to 34bac0b Compare August 22, 2026 22:32
@mejrs

mejrs commented Aug 23, 2026

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants