Skip to content

Add experimental unnamed_enum_variants feature gate#157274

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kupiakos:open-enums-feature-gate
Jun 4, 2026
Merged

Add experimental unnamed_enum_variants feature gate#157274
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kupiakos:open-enums-feature-gate

Conversation

@kupiakos

@kupiakos kupiakos commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

This parses the basic syntax and defines a feature gate for the unnamed enum variants lang experiment, tracking issue #156628.

cc @joshtriplett, @scottmcm, @tmandry

@rustbot

rustbot commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

@rustbot rustbot added 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Jun 1, 2026
@rustbot

rustbot commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

r? @Kivooeo

rustbot has assigned @Kivooeo.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 17 candidates

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please separate the rust-analyzer changes into a PR for rust-lang/rust-analyzer.

View changes since this 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 Jun 1, 2026
@rustbot

rustbot commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@kupiakos

kupiakos commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

I've opened a PR for the rust-analyzer bits and will rebase this PR once those changes are pushed over to rust-lang/rust.

In the meantime, the rest of the PR should be able to receive feedback as-is.

@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 Jun 1, 2026
@ChayimFriedman2

ChayimFriedman2 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

You can remove the r-a changes from this PR. The other changes are not dependent on them. And also, I don't want to merge the r-a PR until the rustc PR is merged.

@kupiakos kupiakos force-pushed the open-enums-feature-gate branch from e39a747 to e6b4102 Compare June 1, 2026 22:01
@kupiakos

kupiakos commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@ChayimFriedman2 Ah, I'd mistakenly thought that the r-a parser was actually being utilized by rustc here based on the rustc dev guide. But indeed this change isn't dependent on r-a. I've removed the r-a bits from this PR entirely as requested.

@Kivooeo Kivooeo added S-waiting-on-crater Status: Waiting on a crater run to be completed. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-crater Status: Waiting on a crater run to be completed. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2026
@Kivooeo

Kivooeo commented Jun 4, 2026

Copy link
Copy Markdown
Member

(wrong PR ^^)

@Kivooeo

Kivooeo commented Jun 4, 2026

Copy link
Copy Markdown
Member

Quick question: is there a discussion on Zulip or anywhere else I can found input from t-lang about this experiment?

@kupiakos

kupiakos commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@Kivooeo The tracking issue references the design meeting, where a lang experiment was approved. It's associated with an accepted 2026 project goal with its own tracking issue. There's some input on the RFC as well.

@Kivooeo

Kivooeo commented Jun 4, 2026

Copy link
Copy Markdown
Member

Thanks! I will review today

@Kivooeo Kivooeo left a comment

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.

Looks good to me. Scope is just parsing the syntax + the feature gate, with lowering intentionally bailing via an error until the real implementation lands

View changes since this review

@Kivooeo

Kivooeo commented Jun 4, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e6b4102 has been approved by Kivooeo

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 4, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 4, 2026
@rust-bors

rust-bors Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: Kivooeo
Duration: 3h 18m 12s
Pushing 0cf9681 to main...

@rust-bors rust-bors Bot merged commit 0cf9681 into rust-lang:main Jun 4, 2026
13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 49b19d3 (parent) -> 0cf9681 (this PR)

Test differences

Show 6 test diffs

Stage 1

  • [ui] tests/ui/feature-gates/feature-gate-unnamed-enum-variants.rs: [missing] -> pass (J0)
  • [ui] tests/ui/unnamed-enum-variants/unimplemented.rs: [missing] -> pass (J0)

Stage 2

  • [ui] tests/ui/feature-gates/feature-gate-unnamed-enum-variants.rs: [missing] -> pass (J1)
  • [ui] tests/ui/unnamed-enum-variants/unimplemented.rs: [missing] -> pass (J1)

Additionally, 2 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 0cf96812614b8250543d749629867b36f2757f4d --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-gcc-core-tests: 7m 48s -> 14m 49s (+90.1%)
  2. dist-sparcv9-solaris: 57m 39s -> 1h 33m (+62.1%)
  3. dist-various-1: 49m 11s -> 1h 17m (+56.8%)
  4. dist-x86_64-msvc-alt: 2h 10m -> 2h 55m (+34.3%)
  5. pr-check-1: 26m 12s -> 34m 32s (+31.8%)
  6. dist-ohos-aarch64: 1h 1m -> 1h 17m (+25.9%)
  7. dist-x86_64-apple: 2h 13m -> 1h 39m (-25.8%)
  8. dist-loongarch64-musl: 1h 31m -> 1h 53m (+23.8%)
  9. dist-arm-linux-musl: 1h 21m -> 1h 41m (+23.4%)
  10. dist-i686-msvc: 1h 50m -> 2h 15m (+22.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (0cf9681): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.8%, secondary -2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
-2.4% [-4.2%, -1.6%] 8
All ❌✅ (primary) 0.8% [-1.5%, 3.1%] 2

Cycles

Results (secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.8% [2.2%, 5.7%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-6.1% [-7.6%, -5.0%] 3
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 511.14s -> 512.762s (0.32%)
Artifact size: 398.59 MiB -> 400.63 MiB (0.51%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer 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