Skip to content

ICE using external Trait Impl with associated default type #26636

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

Closed
mitaa opened this issue Jun 28, 2015 · 0 comments
Closed

ICE using external Trait Impl with associated default type #26636

mitaa opened this issue Jun 28, 2015 · 0 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mitaa
Copy link
Contributor

mitaa commented Jun 28, 2015

// main.rs
extern crate foo;
use foo::Foo;

fn main() {
    ().bar(5);
}
// foo.rs
pub trait Foo {
    type Input=usize;
    fn bar(&self, _: Self::Input) {}
}

impl Foo for () {}

This causes a ICE:

$ rustc foo.rs --crate-type lib && rustc main.rs --extern foo=libfoo.rlib
main.rs:5:5: 5:14 error: internal compiler error: cat_expr Errd
main.rs:5     ().bar(5);
              ^~~~~~~~~
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
thread 'rustc' panicked at 'Box<Any>', src/libsyntax\diagnostic.rs:176

If the trait is defined in the same crate it compiles without error.

Meta

$ rustc --version --verbose
rustc 1.3.0-dev (c1b8bd2d6 2015-06-28)
binary: rustc
commit-hash: c1b8bd2d6fd4a00522635112d3f7b28501552a65
commit-date: 2015-06-28
host: x86_64-pc-windows-gnu
release: 1.3.0-dev

Backtrace:

   1:         0x6f47a235 - sys::backtrace::write::h211dbb4bd6be973b5Cs
   2:         0x6f48385c - rt::unwind::register::h4693906be8813b77JAw
   3:         0x6f44570f - rt::unwind::begin_unwind_inner::h814f62215c9372bfSxw
   4:         0x703710fb - diagnostic::SpanHandler::span_bug::h6cdd59c3e6e257dfO4A
   5:         0x703710b3 - diagnostic::SpanHandler::span_bug::h6cdd59c3e6e257dfO4A
   6:          0x23c579a - session::Session::abort_if_errors::h725710f82abb4c311Fs
   7:         0x6d31fb65 - check::check_item_types::h5ff15bd0334d8c5ePGn
   8:         0x6d3d9bf2 - check_crate::hef15b03eccc64e04w0C
   9:         0x616a8b49 - driver::assign_node_ids_and_map::hb8bf19530013da614Da
  10:         0x616a6f94 - driver::assign_node_ids_and_map::hb8bf19530013da614Da
  11:         0x616a1489 - driver::assign_node_ids_and_map::hb8bf19530013da614Da
  12:         0x61682a66 - driver::compile_input::h99144611d4621d8bTba
  13:         0x6176484d - run_compiler::haae1b27de58cc46ew7b
  14:         0x617624d5 - run::h9b75af55a20c8851c7b
  15:         0x61761e19 - run::h9b75af55a20c8851c7b
  16:         0x6f4be5bc - rust_try
  17:         0x6f4be599 - rust_try
  18:         0x6f46d475 - rt::unwind::try::inner_try::ha4237d2b9396aba5Ltw
  19:         0x61761fd7 - run::h9b75af55a20c8851c7b
  20:         0x6f48150e - sys::process::Command::cwd::h505045109e6a418daiv
  21:         0x778259cd - BaseThreadInitThunk
@sanxiyn sanxiyn added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 29, 2015
arielb1 pushed a commit to arielb1/rust that referenced this issue Jun 30, 2015
bors added a commit that referenced this issue Jun 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants