Skip to content
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

ICE: Placeholder const in deep rejection #10

Closed
compiler-errors opened this issue Mar 29, 2023 · 0 comments · Fixed by rust-lang/rust#109740
Closed

ICE: Placeholder const in deep rejection #10

compiler-errors opened this issue Mar 29, 2023 · 0 comments · Fixed by rust-lang/rust#109740
Labels
has-fix A fix is up

Comments

@compiler-errors
Copy link
Owner

compiler-errors commented Mar 29, 2023

struct Wrapper<T, const N: usize>([T; N]);

trait Foo {}
fn needs_foo<F: Foo>() {}

impl<T> Foo for [T; 1] {}

fn test<T, const N: usize>() {
    needs_foo::<[T; N]>();
}
error: internal compiler error: compiler/rustc_middle/src/ty/fast_reject.rs:375:17: unexpected obl const: Const { ty: usize, kind: Placeholder(Placeholder { universe: U0, name: 0 }) }

We shouldn't ICE for placeholder consts here since we canonicalize parameters

@compiler-errors compiler-errors added the needs-fix An easy fix needs to be put up and applied label Mar 29, 2023
@compiler-errors compiler-errors added has-fix A fix is up and removed needs-fix An easy fix needs to be put up and applied labels Mar 30, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 30, 2023
…ct-placeholder-consts, r=lcnr

Don't ICE on placeholder consts in deep reject

Since we canonicalize const params into placeholder consts, we need to be able to handle them during deep reject.

r? `@lcnr` (though maybe `@oli-obk` can look at this one too, if he wants 😸)

Fixes compiler-errors/next-solver-hir-issues#10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-fix A fix is up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant