-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Description
This code causes rustc's stack to overflow:
trait Hash<H: Hasher> { }
trait Hasher<H: Hash> { }
trait StreamHash<H: StreamHasher>: Hash<H> { }
trait StreamHasher<H: StreamHash>: Hasher<H> { }
fn main() {
}
As a workaround, you can break up the recursion with another trait:
trait Hash { }
trait Hasher<H: Hash> { }
trait Stream { }
trait StreamHash<S: Stream>: Hash { }
trait StreamHasher<H: StreamHash<Self>>: Stream + Hasher<H> { }
fn main() { }
Metadata
Metadata
Assignees
Labels
I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.