When dereferencing a boxed Iterator trait object I get an internal compiler error (only on nightly).
Here is a minimal example: (playground link)
fn ice(x: Box<dyn Iterator<Item=()>>) {
*x
}
fn main() {}
This should result in a type error, as indeed it does if I swap out dyn Iterator<Item=()> with dyn std::fmt::Debug.
Instead, it results in the following error when compiled with nightly (rustc src/main.rs):
thread 'rustc' panicked at 'index out of bounds: the len is 527 but the index is 527', /rustc/e2f221c75932de7a29845c8d6f1f73536ad00c41/src/libcore/slice/mod.rs:2455:10
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.33.0-nightly (e2f221c75 2019-01-15) running on x86_64-unknown-linux-gnu
Meta
Output from rustc --version --verbose:
rustc 1.33.0-nightly (e2f221c75 2019-01-15)
binary: rustc
commit-hash: e2f221c75932de7a29845c8d6f1f73536ad00c41
commit-date: 2019-01-15
host: x86_64-unknown-linux-gnu
release: 1.33.0-nightly
LLVM version: 8.0
When dereferencing a boxed
Iteratortrait object I get an internal compiler error (only on nightly).Here is a minimal example: (playground link)
This should result in a type error, as indeed it does if I swap out
dyn Iterator<Item=()>withdyn std::fmt::Debug.Instead, it results in the following error when compiled with nightly (
rustc src/main.rs):Meta
Output from
rustc --version --verbose: