Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing checks for doc(cfg_hide(...)) #102954

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

GuillaumeGomez
Copy link
Member

Part of #43781.

The doc(cfg_hide(...)) attribute can only be used at the crate level and takes a list of attributes as argument.

r? @Manishearth

@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 12, 2022
@rustbot
Copy link
Collaborator

rustbot commented Oct 12, 2022

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rustbot rustbot added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Oct 12, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 12, 2022
@bors
Copy link
Contributor

bors commented Oct 12, 2022

☔ The latest upstream changes (presumably #102948) made this pull request unmergeable. Please resolve the merge conflicts.

@GuillaumeGomez
Copy link
Member Author

Fixed the conflict.

Copy link
Member

@Manishearth Manishearth left a comment

Choose a reason for hiding this comment

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

before stabilizing we probably should support it on items too, though

@@ -934,6 +934,22 @@ impl CheckAttrVisitor<'_> {
is_valid
}

/// Check that the `#![doc(cfg_hide(...))]` attribute is well formatted. Returns `true` if
Copy link
Member

Choose a reason for hiding this comment

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

issue: please document what the rules for it being well formatted are

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Oct 14, 2022

I updated the docs. Allowing it on items sounds like a good idea even though I'm not completely sure why you would want to hide a cfg specifically on one item and not on all but I'm sure there will be a use case for it. 😆 Better discuss it first before making changes.

@Manishearth
Copy link
Member

@bors r+

@GuillaumeGomez because you're using internal cfgs or something weird for your module. This is quite common.

@bors
Copy link
Contributor

bors commented Oct 14, 2022

📌 Commit 6f0c247 has been approved by Manishearth

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 14, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 15, 2022
…s, r=Manishearth

Add missing checks for `doc(cfg_hide(...))`

Part of  rust-lang#43781.

The `doc(cfg_hide(...))` attribute can only be used at the crate level and takes a list of attributes as argument.

r? `@Manishearth`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 15, 2022
…s, r=Manishearth

Add missing checks for `doc(cfg_hide(...))`

Part of  rust-lang#43781.

The `doc(cfg_hide(...))` attribute can only be used at the crate level and takes a list of attributes as argument.

r? ``@Manishearth``
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 15, 2022
Rollup of 6 pull requests

Successful merges:

 - rust-lang#102773 (Use semaphores for thread parking on Apple platforms)
 - rust-lang#102884 (resolve: Some cleanup, asserts and tests for lifetime ribs)
 - rust-lang#102954 (Add missing checks for `doc(cfg_hide(...))`)
 - rust-lang#102998 (Drop temporaries created in a condition, even if it's a let chain)
 - rust-lang#103003 (Fix `suggest_floating_point_literal` ICE)
 - rust-lang#103041 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 59e0af6 into rust-lang:master Oct 15, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 15, 2022
@GuillaumeGomez GuillaumeGomez deleted the cfg-hide-attr-checks branch October 15, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants