Skip to content

[BETA]: parse array lengths without stripping const blocks#152237

Open
BoxyUwU wants to merge 1 commit intorust-lang:betafrom
BoxyUwU:beta_parse_array_lengths_normally
Open

[BETA]: parse array lengths without stripping const blocks#152237
BoxyUwU wants to merge 1 commit intorust-lang:betafrom
BoxyUwU:beta_parse_array_lengths_normally

Conversation

@BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Feb 6, 2026

Avoids rust-lang/rustfmt#6788

When parsing const { ... } in array lengths we were stripping the const block and just parsing a block expression which is wrong. This PR reverts the behaviour back to the (previously stable) logic of just parsing an anon const.

This PR breaks min_generic_const_args but that doesn't matter its an unstable feature :) I've just deleted the mGCA tests which were affected by this. A proper fix for this is in #152234 but I don't think that should be backported as it's too involved.

cc @rust-lang/rustfmt

r? oli-obk

@BoxyUwU BoxyUwU added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 6, 2026
@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. labels Feb 6, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

⚠️ Warning ⚠️

  • Pull requests are usually filed against the main branch for this repo, but this one is against beta. Please double check that you specified the right target!

@BoxyUwU BoxyUwU added beta-nominated Nominated for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Feb 6, 2026
@BoxyUwU BoxyUwU force-pushed the beta_parse_array_lengths_normally branch from 7745534 to 01703e3 Compare February 6, 2026 19:35
@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2026

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot added the T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. label Feb 6, 2026
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Feb 6, 2026

(added the rustfmt tests)

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED      SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    b72a662c47e3   6 days ago   790MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:57ef9cc45f72cc4258ee1baa8243bc3cd55c0a0e570b6768c37346247be35f0d
deleted: sha256:b72a662c47e31df2e7bf59368b2b83be239f02a1baa721393717711a1a719df9
deleted: sha256:3e13ccd80f19769f39008cfc6549938e1ea4905f47b028c1df2dd6085191386c
deleted: sha256:842807995a512b2c5a9b241a3aecdbe79af6b0642d96fa5460cfcf0c9d8be295
deleted: sha256:0f9074b9f46f4570eb7cb4b65fcb3c3d909f9b1d14ca66b30508117b6deda303
deleted: sha256:2ca99cb9251d19157c56b5d91c8961bb4b35196a5ca9b4ffdccbf24abbfe2a5f
---
............................................       (144/144)

======== tests/rustdoc-gui/search-filter.goml ========

[ERROR] line 48: Error: The CSS selector "#search-tabs .count.loading" still exists: for command `wait-for-false: "#search-tabs .count.loading"`
    at <file:///checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/test_docs/index.html?search=test>

======== tests/rustdoc-gui/search-result-display.goml ========

[WARNING] line 39: Delta is 0 for "x", maybe try to use `compare-elements-position` instead?

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

Labels

beta-nominated Nominated for backporting to the compiler in the beta channel. 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-rustfmt Relevant to the rustfmt 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