{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25693","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25693/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25693/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25693/events","html_url":"https://github.com/rust-lang/rust/issues/25693","id":79199064,"number":25693,"title":"ICE: rustc overflows its stack on instanciation of enum","user":{"login":"dkreuter","id":15789,"avatar_url":"https://avatars.githubusercontent.com/u/15789?v=3","gravatar_id":"","url":"https://api.github.com/users/dkreuter","html_url":"https://github.com/dkreuter","followers_url":"https://api.github.com/users/dkreuter/followers","following_url":"https://api.github.com/users/dkreuter/following{/other_user}","gists_url":"https://api.github.com/users/dkreuter/gists{/gist_id}","starred_url":"https://api.github.com/users/dkreuter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkreuter/subscriptions","organizations_url":"https://api.github.com/users/dkreuter/orgs","repos_url":"https://api.github.com/users/dkreuter/repos","events_url":"https://api.github.com/users/dkreuter/events{/privacy}","received_events_url":"https://api.github.com/users/dkreuter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-ICE","name":"I-ICE","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-21T23:15:25Z","updated_at":"2015-05-26T16:01:01Z","closed_at":null,"body":"Also available at http://is.gd/7glmKz\r\n```rust\r\npub trait Paramters { type SelfRef; }\r\n\r\nstruct RP<'a> { _marker: std::marker::PhantomData<&'a ()> }\r\nstruct BP;\r\n\r\nimpl<'a> Paramters for RP<'a> { type SelfRef = &'a X<RP<'a>>; }\r\nimpl Paramters for BP { type SelfRef = Box<X<BP>>; }\r\n\r\npub struct Y;\r\npub enum X<P: Paramters> {\r\n    Nothing,\r\n    SameAgain(P::SelfRef, Y)\r\n}\r\n\r\nfn main() {\r\n    // fine\r\n    let bnil: Box<X<BP>> = Box::new(X::Nothing);\r\n    let bx: Box<X<BP>> = Box::new(X::SameAgain(bnil, Y));\r\n    // crashes rustc\r\n    let rnil: X<RP> = X::Nothing;\r\n    let rx: X<RP> = X::SameAgain(&rnil, Y);\r\n}\r\n```\r\nOutput:\r\n```\r\nthread 'rustc' has overflowed its stack\r\nIllegal instruction (core dumped)\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/105577180","html_url":"https://github.com/rust-lang/rust/issues/25693#issuecomment-105577180","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/25693","id":105577180,"user":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T16:01:01Z","updated_at":"2015-05-26T16:01:01Z","body":"This seems to enter a recursive cycle in `middle::implicator::Implicator`:\r\n```\r\naccumulate_from_ty\r\naccumulate_from_adt\r\naccumulate_from_assoc_types\r\naccumulate_from_ty\r\n```\r\n\r\n@nikomatsakis Should the implicator detect cycles and report them, or even let this code compile?"}}