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

rustdoc: Don't strip items with inherited visibility in AliasedNonLocalStripper #125300

Merged
merged 2 commits into from
May 20, 2024

Conversation

compiler-errors
Copy link
Member

Enum variants return None in Item::visibility, which fails the comparison to Some(Visibility::Public). This means that all enums in type aliases are being stripped, leading to this in the rustc_middle docs:

image

This regressed in #124939 (comment).

This switches the AliasedNonLocalStripper to not strip items with None as their visibility.

@rustbot
Copy link
Collaborator

rustbot commented May 20, 2024

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 20, 2024
@compiler-errors
Copy link
Member Author

cc @Urgau

Copy link
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

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

LGTM, make sense to me.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Thanks a bunch, Michael! <3

@fmease
Copy link
Member

fmease commented May 20, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 20, 2024

📌 Commit 090dbb1 has been approved by fmease

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 May 20, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 20, 2024
…ed-viz, r=fmease

rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`

Enum variants return `None` in `Item::visibility`, which fails the comparison to `Some(Visibility::Public)`. This means that all enums in type aliases are being stripped, leading to this in the `rustc_middle` docs:

<img width="474" alt="image" src="https://github.com/rust-lang/rust/assets/3674314/83704d94-a571-4c28-acbd-ca51c4efd46e">

This regressed in rust-lang#124939 (comment).

This switches the `AliasedNonLocalStripper` to not strip items with `None` as their visibility.
fmease added a commit to fmease/rust that referenced this pull request May 20, 2024
…ed-viz, r=fmease

rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`

Enum variants return `None` in `Item::visibility`, which fails the comparison to `Some(Visibility::Public)`. This means that all enums in type aliases are being stripped, leading to this in the `rustc_middle` docs:

<img width="474" alt="image" src="https://github.com/rust-lang/rust/assets/3674314/83704d94-a571-4c28-acbd-ca51c4efd46e">

This regressed in rust-lang#124939 (comment).

This switches the `AliasedNonLocalStripper` to not strip items with `None` as their visibility.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#125219 (Update `unexpected_cfgs` lint for Cargo new `check-cfg` config)
 - rust-lang#125255 (Make `EvalCtxt` generic over `InferCtxtLike`)
 - rust-lang#125283 (Use a single static for all default slice Arcs.)
 - rust-lang#125300 (rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`)
 - rust-lang#125309 (Fix `tests/debuginfo/strings-and-strs`.)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#125255 (Make `EvalCtxt` generic over `InferCtxtLike`)
 - rust-lang#125283 (Use a single static for all default slice Arcs.)
 - rust-lang#125300 (rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`)
 - rust-lang#125309 (Fix `tests/debuginfo/strings-and-strs`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3a50315 into rust-lang:master May 20, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
Rollup merge of rust-lang#125300 - compiler-errors:dont-strip-inherited-viz, r=fmease

rustdoc: Don't strip items with inherited visibility in `AliasedNonLocalStripper`

Enum variants return `None` in `Item::visibility`, which fails the comparison to `Some(Visibility::Public)`. This means that all enums in type aliases are being stripped, leading to this in the `rustc_middle` docs:

<img width="474" alt="image" src="https://github.com/rust-lang/rust/assets/3674314/83704d94-a571-4c28-acbd-ca51c4efd46e">

This regressed in rust-lang#124939 (comment).

This switches the `AliasedNonLocalStripper` to not strip items with `None` as their visibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

5 participants