Closed
Description
Code
#![allow(incomplete_features)]
#![feature(const_generics)]
#![feature(const_evaluatable_checked)]
struct F<const S: &'static str>;
impl<const S: &'static str> X for F<{ S }> {
const W: usize = 3;
fn d(r: &[u8; Self::W]) -> F<{ S }> {
let x: [u8; Self::W] = [0; Self::W];
F
}
}
pub trait X {
const W: usize;
fn d(r: &[u8; Self::W]) -> Self;
}
Meta
rustc --version --verbose
:
rustc 1.55.0-nightly (406d4a9cc 2021-06-21)
binary: rustc
commit-hash: 406d4a9cc3b9601cf98a07c6c83e0227d64f5d48
commit-date: 2021-06-21
host: x86_64-unknown-linux-gnu
release: 1.55.0-nightly
LLVM version: 12.0.1
Error output
error: internal compiler error: broken MIR in DefId(0:10 ~ lol[3197]::{impl#0}::d) (NoSolution): could not prove Binder(WellFormed([u8; _]), [])
|
= note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:253:27
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1023:13
Backtrace
stack backtrace:
0: rust_begin_unwind
at /rustc/406d4a9cc3b9601cf98a07c6c83e0227d64f5d48/library/std/src/panicking.rs:515:5
1: std::panicking::begin_panic_fmt
at /rustc/406d4a9cc3b9601cf98a07c6c83e0227d64f5d48/library/std/src/panicking.rs:457:5
2: rustc_errors::HandlerInner::flush_delayed
3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
7: rustc_span::with_source_map
8: rustc_interface::interface::create_compiler_and_run
9: scoped_tls::ScopedKey<T>::set
Metadata
Metadata
Assignees
Labels
Area: const generics (parameters and arguments)Category: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(generic_const_exprs)]`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.