-
Notifications
You must be signed in to change notification settings - Fork 13k
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
subst ICE when building specialization graph with generic_const_exprs
#106473
Comments
Thank you Michael for minimizing this. It would have taken me more than a week... It's not just #![allow(incomplete_features)]
#![feature(generic_const_exprs)]
const DEFAULT: u32 = 1;
struct CoV<const U: usize = DEFAULT>
where
[(); U]:;
type V= CoV<DEFAULT>; I understand that, at least for now, this is a low priority (I hope it will rise up once I complete a CoAllocator MVP and have benchmarks). The only workaround that I see possible is to replace all occurrences of |
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
const DEFAULT: u32 = 1;
struct CoV<const U: usize = DEFAULT>
where
[(); U]:; Please double-check the ICE error message if it should be treated separately, or whether it would be likely to be fixable together with the two ICE examples listed above.
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
#[allow(dead_code)]
struct CoV<const U: usize = 1>
where
[(); U]:; https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=26a2846ba3c2ea5ca81aaa4de6c3c910 And the original example (first one minimized in this issue) builds well with a hard-coded constant value, too: #![allow(incomplete_features)]
#![feature(generic_const_exprs)]
struct V<const U: usize = 1>
where
[(); U]:;
trait Tr {}
impl Tr for V {}
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
const fn v_default() -> usize {
1
}
struct V<const U: usize = {v_default()}>
where
[(); U]:; Other failing variations:
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
struct Def {}
impl Def {
const fn v_default() -> usize {
1
}
}
struct V<const U: usize = {Def::v_default()}>
where
[(); U]:;
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
struct V<const U: usize = {if cfg!(coop_alloc) {1} else {2}}>
where
[(); U]:;
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
struct V<const U: usize = {if true {1} else {2}}>
where
[(); U]:;
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
macro_rules! co_vec_default {
() => {
1
}
}
struct V<const U: usize = {co_vec_default!()}>
where
[(); U]:;
trait Tr {}
impl Tr for V {}
Thank you for your help. |
closing in favor of #106994 |
I'm pretty sure this is a minimization of the ICE in #105573, cc @peter-kehl.
playground:
The text was updated successfully, but these errors were encountered: