Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impls of traits with associated types don't work cross crate #20389

Closed
sfackler opened this issue Jan 1, 2015 · 3 comments · Fixed by #20404
Closed

Impls of traits with associated types don't work cross crate #20389

sfackler opened this issue Jan 1, 2015 · 3 comments · Fixed by #20404
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@sfackler
Copy link
Member

sfackler commented Jan 1, 2015

foo.rs:

#![feature(associated_types)]

pub trait T {
    type C;
}

main.rs:

#![feature(associated_types)]
extern crate foo;

struct Foo;

impl foo::T for Foo {
    type C = ();
}

fn main() {}
~ ❯ env RUST_BACKTRACE=1 rustc -L. test.rs
ERROR:rbml::reader: failed to find block with tag 2
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'explicit panic', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/librbml/lib.rs:253

stack backtrace:
   1:        0x104a5b1e5 - sys::backtrace::write::h4cebc8c3e368e8f0Upt
   2:        0x104a7fc33 - failure::on_fail::hd9de93a6058d1a7dwwz
   3:        0x1049e5e6a - rt::unwind::begin_unwind_inner::h00d5ebf844629bb50dz
   4:        0x1030c74db - rt::unwind::begin_unwind::h4125333724720779177
   5:        0x1030c60e4 - reader::get_doc::h76807416f04bf0f7bLa
   6:        0x1021729d4 - metadata::decoder::item_def_id::h2bfb567a68e455cbj6h
   7:        0x1021b95aa - metadata::decoder::get_impl_or_trait_item::h7f439d8f2829cb421Ui
   8:        0x1021661c4 - metadata::csearch::get_impl_or_trait_item::hf3d420b16148eb58e8k
   9:        0x101ffc311 - middle::ty::impl_or_trait_item::h2355a4845ecaf3fciw7
  10:        0x10216466b - middle::ty::trait_items::h2db0d9abf50e4ccdZu7
  11:        0x1019b9846 - check::check_item::hac3080059fe09f34SSj
  12:        0x101b4ce40 - check_crate::unboxed_closure.39832
  13:        0x101b48733 - check_crate::h127b3439cfd8ff83NLx
  14:        0x101363d52 - driver::phase_3_run_analysis_passes::hadc5fda84afbf325qva
  15:        0x101350b88 - driver::compile_input::h9d2d7dddc58375d9wba
  16:        0x101482843 - thunk::F.Invoke<A, R>::invoke::h1922614042677645733
  17:        0x10147f9a0 - rt::unwind::try::try_fn::h5185751407680132505
  18:        0x104ae75e9 - rust_try_inner
  19:        0x104ae75d6 - rust_try
  20:        0x1014800e6 - thunk::F.Invoke<A, R>::invoke::h18183949975069308340
  21:        0x104a6c544 - sys::thread::thread_start::h0fb21aaa7cc37e0dDfw
  22:     0x7fff8dd8c2fc - _pthread_body
  23:     0x7fff8dd8c279 - _pthread_body
rustc 0.13.0-nightly (7608dbad6 2014-12-31 10:06:21 -0800)
@sfackler sfackler added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-associated-items Area: Associated items (types, constants & functions) labels Jan 1, 2015
@sfackler
Copy link
Member Author

sfackler commented Jan 1, 2015

cc @nikomatsakis @nick29581

@sfackler sfackler changed the title Associated types don't work cross crate Impls of traits with associated types don't work cross crate Jan 1, 2015
@japaric
Copy link
Member

japaric commented Jan 1, 2015

This has already been fixed in #20374

@nikomatsakis
Copy link
Contributor

Good to have a test though. As I recall we didn't make one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants