-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE error in Rust compiler: ty::Const::eval called on a non-valtree-compatible type #118285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oo this looks like #118098 but it's much smaller and doesn't need any features. |
searched nightlies: from nightly-2023-01-01 to nightly-2023-11-20 bisected with cargo-bisect-rustc v0.6.7Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2023-01-01 --end=2023-11-20 --regress=ice cc @RalfJung |
@rustbot claim |
After that error, something is still trying to create a valtree from a function pointer, it seems. I'd say that's a bug, my PR just turns it into an ICE -- but silencing the ICE does not fix the bug. Certain errors need to stop rustc from doing any further work with the faulty code. Cc @rust-lang/project-const-generics |
Can we turn it into a Constkind::Error instead of ICEing? |
I mean we could I guess, though it seems suspicious to me that we even call this function after the type checker already determined that this is not valid as a const generic. |
We check the type of const parameters separately from when we compute them. Not doing so results in query cycles iirc 🤔 so it's probably best to |
fix an ICE when a valtree failed to evaluate Fixes rust-lang#118285 r? `@lcnr`
Code
Meta
rustc --version --verbose
:The same problem is reproduced by rustc 1.76.0-nightly (37b2813 2023-11-24).
Error output
Backtrace
The text was updated successfully, but these errors were encountered: