Closed
Description
#![feature(const_generics)]
#![allow(incomplete_features)]
pub trait Trait {
type Associated;
}
pub struct Foo<T, A = <T as Trait>::Associated, const N: u8>(T, A);
impl<T: Trait, const N: u8> Foo<T, N> {
}
fn main() {
}
results in:
error: internal compiler error: potentially unconstrained type parameters weren't evaluated
--> potentially-unconstrained.rs:10:1
|
10 | / impl<T: Trait, const N: u8> Foo<T, N> {
11 | | }
| |_^
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:345:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.42.0-nightly (c5840f9d2 2020-01-03) running on x86_64-unknown-linux-gnu
Heck, this seems like an unfortunate design-level thing; the ICE aside, is there a way to specify a const generic parameter while using the default?
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.`#![feature(const_generics)]`Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.ICE tracked in rust-lang/glacier.This issue requires a nightly compiler in some way.