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

Remove useless clean::Variant struct #81033

Merged
merged 2 commits into from
Jan 16, 2021
Merged

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Jan 15, 2021

It had exactly one field and no special behavior, so there was no point in having it.

r? @CraftSpider

@jyn514 jyn514 added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 15, 2021
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
skip untracked path cpu-usage.csv during rustfmt invocations
skip untracked path src/doc/book/ during rustfmt invocations
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/src/librustdoc/html/render/mod.rs at line 3264:
             document_non_exhaustive(w, variant);
             use crate::clean::VariantKind;
             use crate::clean::VariantKind;
-            if let clean::VariantItem(VariantKind::Struct(ref s)) = *variant.kind
-            {
+            if let clean::VariantItem(VariantKind::Struct(ref s)) = *variant.kind {
                 let variant_id = cx.derive_id(format!(
                     "{}.{}.fields",
                     ItemType::Variant,
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2018" "--unstable-features" "--skip-children" "--check" "/checkout/src/librustdoc/html/render/mod.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
Build completed unsuccessfully in 0:00:22

Copy link
Contributor

@CraftSpider CraftSpider left a comment

Choose a reason for hiding this comment

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

One question about naming, but not a necessary change. Otherwise looks good to me.

src/librustdoc/clean/types.rs Outdated Show resolved Hide resolved
@jyn514
Copy link
Member Author

jyn514 commented Jan 15, 2021

@bors r=CraftSpider rollup

Thanks for the review!

@bors
Copy link
Contributor

bors commented Jan 15, 2021

📌 Commit 638d4aaafb30052baa8905c6473de44d12e7c8bf has been approved by CraftSpider

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 15, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 15, 2021
Rollup of 5 pull requests

Successful merges:

 - rust-lang#80254 (Don't try to add nested predicate to Rustdoc auto-trait `ParamEnv`)
 - rust-lang#80834 (Remove unreachable panics from VecDeque::{front/back}[_mut])
 - rust-lang#80944 (Use Option::map_or instead of `.map(..).unwrap_or(..)`)
 - rust-lang#81008 (Don't ICE when computing a layout of a generator tainted by errors)
 - rust-lang#81023 (Remove doctree::Variant)

Failed merges:

 - rust-lang#81033 (Remove useless `clean::Variant` struct)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Jan 15, 2021

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

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 15, 2021
It had exactly one field and no special behavior, so there was no point.
There's no `Variant`, so it seems silly to have `Kind`.
@jyn514
Copy link
Member Author

jyn514 commented Jan 15, 2021

@bors r=CraftSpider rollup

@bors
Copy link
Contributor

bors commented Jan 15, 2021

📌 Commit d11855a has been approved by CraftSpider

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 15, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 16, 2021
…laumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#77693 (Add test for rust-lang#59352)
 - rust-lang#80515 (Improve JS performance by storing length before comparing to it in loops)
 - rust-lang#81030 (Update mdbook)
 - rust-lang#81033 (Remove useless `clean::Variant` struct)
 - rust-lang#81049 (inline: Round word-size cost estimates up)
 - rust-lang#81054 (Drop a few unneeded borrows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 97b736c into rust-lang:master Jan 16, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 16, 2021
@jyn514 jyn514 deleted the nested-variant branch February 25, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. 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