Skip to content

Rustc Stack overflow checking "cyclic" bounds in traits #17267

Closed
@Ericson2314

Description

@Ericson2314

Minimal triggering program:

// any combo of Foo and Bar declarations crashes

trait Foo<A> where A: Bar<Self> {}
trait Bar<B> where B: Foo<Self> {}

//trait Foo<A: Bar<Self>> {}
//trait Bar<B: Foo<Self>> {}

// to avoid warning (but stack overflows after warning)
pub fn main() {}

Platform (though I doubt it matters):

# rustc --version
rustc 0.12.0-pre-nightly (ccae356ac 2014-09-12 23:30:54 +0000)
# uname -a    
Linux /*hostname*/ 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions