Closed
Description
Broken on both stable and the nightly. Affects a real use case with present() in gfx-rs.
trait Device {
type Resources;
}
struct Foo<R>(R);
impl<D: Device> Foo<D::Resources> {
fn present(&self, _dev: &D) {}
}
fn main() {
struct Res;
struct Dev;
impl Device for Dev {
type Resources = Res;
}
struct Win;
let foo = Foo(Res);
let dev = Dev;
foo.present(&dev);
}
Gives me:
<anon>:19:9: 19:22 error: type `Foo<main::Res>` does not implement any method in scope named `present`
<anon>:19 foo.present(&dev);
^~~~~~~~~~~~~
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 5 but the index is 5', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libcollections/vec.rs:1322
playpen: application terminated with error code 101