Skip to content

error: internal compiler error: find_associated_type_in_generics() #19151

@ZoeyR

Description

@ZoeyR

OS: Ubuntu 14.04 LTS
Rust version:

rustc 0.13.0-nightly (399ff259e 2014-11-20 00:27:07 +0000)
binary: rustc
commit-hash: 399ff259e18c1061aa4ea60856fcecb486d36624
commit-date: 2014-11-20 00:27:07 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly

Error:

cargo build
   Compiling rust-conway v0.0.1 (file:///home/ybilta/Development/rust/conway)
/home/ybilta/Development/rust/conway/src/world.rs:43:23: 43:39 error: ambiguous associated type; specify the type using the syntax `<Type as world::World>::WorldIter`
/home/ybilta/Development/rust/conway/src/world.rs:43     fn iter(&self) -> World::WorldIter;
                                                                           ^~~~~~~~~~~~~~~~
/home/ybilta/Development/rust/conway/src/world.rs:66:22: 66:58 error: wrong number of lifetime parameters: expected 1, found 0 [E0107]
/home/ybilta/Development/rust/conway/src/world.rs:66     type WorldIter = hash_map::Entries<(int, int), State>;
                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ybilta/Development/rust/conway/src/engine.rs:12:16: 12:38 error: associated types may not be referenced here
/home/ybilta/Development/rust/conway/src/engine.rs:12     world: Box<world::World + 'static>
                                                                     ^~~~~~~~~~~~~~~~~~~~~~
/home/ybilta/Development/rust/conway/src/engine.rs:22:39: 22:51 error: internal compiler error: find_associated_type_in_generics(): no self type
/home/ybilta/Development/rust/conway/src/engine.rs:22     fn world_ref<'w>(&'w self) -> &'w world::World;
                                                                                            ^~~~~~~~~~~~
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
task 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:121


Could not compile `rust-conway`.

Can be tested against this commit.
I realize the code is bad, but I felt I should report the error anyways

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions