Skip to content

fix inference variables leaking into HIR const literal lowering logic#153557

Open
Human9000-bit wants to merge 1 commit intorust-lang:mainfrom
Human9000-bit:issue-153525
Open

fix inference variables leaking into HIR const literal lowering logic#153557
Human9000-bit wants to merge 1 commit intorust-lang:mainfrom
Human9000-bit:issue-153525

Conversation

@Human9000-bit
Copy link
Contributor

@Human9000-bit Human9000-bit commented Mar 8, 2026

Inference variables could leak into further const lowering logic

It ICEs when query system tries to cache lit_to_const() after its execution and panics, because inference variables are not hashable for some reason

Fixes #153524
Fixes #153525

@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2026

HIR ty lowering was modified

cc @fmease

@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 Mar 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2026

r? @dingxiangfei2009

rustbot has assigned @dingxiangfei2009.
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 69 candidates
  • Random selection from 16 candidates

@Human9000-bit

This comment has been minimized.

@Human9000-bit Human9000-bit marked this pull request as draft March 8, 2026 08:14
@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 Mar 8, 2026
@rust-log-analyzer

This comment has been minimized.

@BoxyUwU
Copy link
Member

BoxyUwU commented Mar 8, 2026

r? BoxyUwU

@rustbot rustbot assigned BoxyUwU and unassigned dingxiangfei2009 Mar 8, 2026
@Human9000-bit Human9000-bit marked this pull request as ready for review March 8, 2026 15:00
@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 Mar 8, 2026
@Human9000-bit Human9000-bit changed the title fix inference variables leaking into HIR const lowering logic fix inference variables leaking into HIR const literal lowering logic Mar 8, 2026
@rust-log-analyzer

This comment has been minimized.

let tcx = self.tcx();

if ty.has_infer() {
let e = self.dcx().span_err(span, "inference variables are not supported in constants");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am sure this is pretty suboptimal error message. Could we think about a correct one?

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.

[ICE]: type variables should not be hashed [ICE]: const variables should not be hashed

5 participants