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

ICE possibly related to empty trait and type alias #25349

Closed
ragnard opened this issue May 12, 2015 · 2 comments
Closed

ICE possibly related to empty trait and type alias #25349

ragnard opened this issue May 12, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@ragnard
Copy link

ragnard commented May 12, 2015

I got a consistent ICE on a piece of code. I'm a rust newbie so I can't characterise the code well, but I've manage to narrow it down to the following:

use std::collections::HashMap;

trait Empty { }

struct S;
impl Empty for S { }

type U = HashMap<String, Empty>;

trait F {
    fn f(self, u: U);
}

impl F for S {
    fn f(self, u: U) { }
}

Error message:

src/lib.rs:1:1: 1:1 error: internal compiler error: Encountered errors `[FulfillmentError(Obligation(predicate=Binder(TraitPredicate(core::marker::Sized)),depth=2),Unimplemented)]` fulfilling during trans
src/lib.rs:1 use std::collections::HashMap;
             ^
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 'Box<Any>', /tmp/nix-build-rustc-1.0.0-dev-g0cf99c3.drv-0/rust-0cf99c3/src/libsyntax/diagnostic.rs:149

Meta

rustc 1.0.0-dev (built 2015-04-28)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-04-28
host: x86_64-unknown-linux-gnu
release: 1.0.0-dev

Stacktrace: If I run with RUST_BACKTRACE=1 I don't get a stacktrace, only "Illegal Instruction":

$ RUST_BACKTRACE=1 rustc src/lib.rs --crate-name rust_ice --crate-type lib -g -C metadata=0fbc93cfda687298 -C extra-filename=-0fbc93cfda687298 --out-dir /home/ragge/projects/github/ragnard/rust-ice/target/debug --emit=dep-info,link -L dependency=/home/ragge/projects/github/ragnard/rust-ice/target/debug -L dependency=/home/ragge/projects/github/ragnard/rust-ice/target/debug/deps
src/lib.rs:5:1: 5:10 warning: struct is never used: `S`, #[warn(dead_code)] on by default
src/lib.rs:5 struct S;
             ^~~~~~~~~
src/lib.rs:15:16: 15:17 warning: unused variable: `u`, #[warn(unused_variables)] on by default
src/lib.rs:15     fn f(self, u: U) { }
                             ^
src/lib.rs:1:1: 1:1 error: internal compiler error: Encountered errors `[FulfillmentError(Obligation(predicate=Binder(TraitPredicate(core::marker::Sized)),depth=2),Unimplemented)]` fulfilling during trans
src/lib.rs:1 use std::collections::HashMap;
             ^
Illegal instruction

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label May 13, 2015
@arielb1
Copy link
Contributor

arielb1 commented Jul 20, 2015

cc #25388

@arielb1
Copy link
Contributor

arielb1 commented Aug 14, 2015

Fixed by #27641.

@arielb1 arielb1 closed this as completed Aug 14, 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

3 participants