-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE with const generics canonicalisation: "assertion failed: !out_value.has_type_flags(TypeFlags::KEEP_IN_LOCAL_TCX)" #65623
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
It's this debug assertion that's failing: rust/src/librustc/infer/canonical/canonicalizer.rs Lines 545 to 548 in 7bf377f
Debug assertions are not turned on on released artifacts, but your local |
Ohhh, that explains the weirdness. Should have thought of that myself. Thanks! But anyway, it's still a bug I assume. And I couldn't find another const generic bug with this error message. |
The test case is sufficient with debug assertions (I can reproduce locally). Sorry, I've been meaning to look into this for ages. Having a minimal test case is helpful. |
@varkor No problem, I'm happy for every minute you spend working on const generics ^_^ |
Sounds like inference variables are leaking out of somewhere. |
@eddyb: I had a quick look, and didn't spot any obvious asymmetries, but there surely must be for this error to occur… |
The first has an analogue in: https://github.com/rust-lang/rust/blob/1470dc9c94f8c3405d470578b3aec125502f2377/src/librustc/ty/flags.rs#L112-L114 |
I think the problem is here: rust/src/librustc/infer/canonical/canonicalizer.rs Lines 700 to 706 in 7979016
We are creating a new canonical variable for the const value but are returning the type unchanged. So if the type has inference variables in it they will leak through. |
@varkor So |
Opened #65655 for that. |
…st-placeholder, r=eddyb Correct handling of type flags with `ConstValue::Placeholder` This fixes a mistake, but not rust-lang#65623. r? @eddyb
…st-placeholder, r=eddyb Correct handling of type flags with `ConstValue::Placeholder` This fixes a mistake, but not rust-lang#65623. r? @eddyb
Uh oh!
There was an error while loading. Please reload this page.
I started to further investigate the bug blocking #62959. The following is a minimised test case:
Results in (with debug assertions enabled):
Here with the backtrace:
I would love to investigate further, but I am too confused and the panic message doesn't tell me anything useful either. But please tell me if I can do anything else to help you solve the bug. I'd love to have it fixed so that I can continue working on #62959.
CC @varkor @eddyb
The text was updated successfully, but these errors were encountered: