Skip to content

Fix(consts): Don't suggest outer array length for nested mismatch in const - #166343

Open
Suryansh-Dey wants to merge 2 commits into
rust-lang:mainfrom
Suryansh-Dey:fix-help
Open

Suryansh-Dey wants to merge 2 commits into
rust-lang:mainfrom
Suryansh-Dey:fix-help

Conversation

@Suryansh-Dey

@Suryansh-Dey Suryansh-Dey commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #166336

Bug and Fix

Mentioned here

Simply added an if guard in match statement to only matches when the type error is on the const's whole initializer.

Test:

run ./x test tests/ui/consts/
Both commit pass in their own test

After Fix

image

Passes with buggy output as expected output

image

@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 Nov 22, 2026
@rustbot

rustbot commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

r? @jackh726

rustbot has assigned @jackh726.
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 79 candidates
  • Random selection from 20 candidates

@Suryansh-Dey

Suryansh-Dey commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

r? @oli-obk
Is this my approach correct? I am ready for changes

@rustbot rustbot assigned BoxyUwU and unassigned jackh726 Nov 24, 2026
@rustbot

rustbot commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot assigned oli-obk and unassigned BoxyUwU Nov 24, 2026

This branch has not been deployed

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested array w/ incorrect size suggests changing wrong const generic

5 participants