Closed

Description
#![feature(specialization)]
trait Foo {
fn foo(&self);
}
trait Bar {
fn bar(&self);
}
impl<T> Bar for T where T: Foo {
fn bar(&self) {}
}
impl<T> Foo for T where T: Bar {
fn foo(&self) {}
}
impl Foo for u64 {}
fn main() {
}
Compiling this code results in:
thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
There is no backtrace.
If I disable specialization feature, rustc reports an error:
error[E0119]: conflicting implementations of trait `Foo` for type `u64`
Rustc details:
rustc 1.17.0-nightly (0648517fa 2017-02-03)
binary: rustc
commit-hash: 0648517faf1e2cf37c8b6770cbd0180a816ed9a0
commit-date: 2017-02-03
host: x86_64-unknown-linux-gnu
release: 1.17.0-nightly
LLVM version: 3.9
Metadata
Metadata
Assignees
Labels
Area: Trait impl specializationCategory: This is a bug.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.`#![feature(specialization)]`Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Relevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.