Attempting to build this code generates an ICE (play):
struct DataWrapper<'a> {
data: &'a [u8; Self::SIZE],
}
impl DataWrapper<'_> {
const SIZE: usize = 14;
}
The error message, on my machine:
$ rustc src/main.rs --verbose
error: internal compiler error: src/librustc_mir/borrow_check/universal_regions.rs:762: cannot convert `ReEarlyBound(0, 'a)` to a region vid
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:905:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
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.41.0 running on x86_64-unknown-linux-gnu
error: aborting due to previous error
Looks like it's related to #56445, but the construction that triggers it is different enough that it seems worth posting.
Attempting to build this code generates an ICE (play):
The error message, on my machine:
Looks like it's related to #56445, but the construction that triggers it is different enough that it seems worth posting.