Closed
Description
A generic destructor with more than one type parameter (one more than the struct in this case), causes an ICE. A bound like <T: Iterator<T>>
(for example) compiles, while <A, T: Iterator<A>>
does not.
#![feature(unsafe_destructor)]
struct Test<T>(T);
#[unsafe_destructor]
impl <A, T: Iterator<A>> Drop for Test<T> {
fn drop(&mut self) { }
}
fn main() {
let x = Test(2i);
let _ = x;
}
ICE:
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 1 but the index is 1', /build/rust-git/src/rust/src/librustc/middle/subst.rs:420
See also previous issue #4252 and its fix #12403
31 aug 2014: updated test code to compile with current rust, and updated to new different ICE msg.