{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/21476","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/21476/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21476/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/21476/events","html_url":"https://github.com/rust-lang/rust/issues/21476","id":55059253,"number":21476,"title":"ICE when using nested associated types + generics + unboxed closures","user":{"login":"reem","id":4745181,"avatar_url":"https://avatars.githubusercontent.com/u/4745181?v=3","gravatar_id":"","url":"https://api.github.com/users/reem","html_url":"https://github.com/reem","followers_url":"https://api.github.com/users/reem/followers","following_url":"https://api.github.com/users/reem/following{/other_user}","gists_url":"https://api.github.com/users/reem/gists{/gist_id}","starred_url":"https://api.github.com/users/reem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reem/subscriptions","organizations_url":"https://api.github.com/users/reem/orgs","repos_url":"https://api.github.com/users/reem/repos","events_url":"https://api.github.com/users/reem/events{/privacy}","received_events_url":"https://api.github.com/users/reem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-associated-items","name":"A-associated-items","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-closures","name":"A-closures","color":"d7e102"},{"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-01-21T18:41:21Z","updated_at":"2015-01-29T15:42:44Z","closed_at":null,"body":"repro here: http://is.gd/05ui2C\r\n\r\nCode and error with backtrace for convenience:\r\n\r\n```rust\r\n#![feature(unboxed_closures)]\r\n\r\nstruct Wrapper<T>(T);\r\nstruct WriterTo<T>(*mut T);\r\n\r\nimpl<T> FnMut(&[u8]) -> usize for WriterTo<T> {\r\n    extern \"rust-call\" fn call_mut(&mut self, (buf,): (&[u8],)) -> usize {\r\n        18\r\n    }\r\n}\r\n\r\ntrait WriteStream {\r\n   type Writer: FnMut(&[u8]) -> usize;\r\n   \r\n   fn on_write<W: FnMut(&mut Self::Writer)>(self, W);\r\n}\r\n\r\nimpl<T> WriteStream for Wrapper<T> {\r\n   type Writer = WriterTo<T>;\r\n   \r\n   fn on_write<W: FnMut(&mut WriterTo<T>)>(self, listener: W) {}\r\n}\r\n\r\nfn main() {}\r\n```\r\n\r\n```\r\nerror: internal compiler error: unexpected panic\r\nnote: the compiler unexpectedly panicked. this is a bug.\r\nnote: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html\r\nnote: run with `RUST_BACKTRACE=1` for a backtrace\r\nthread 'rustc' panicked at 'assertion failed: !generic_bounds.has_escaping_regions()', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc_typeck/check/mod.rs:1783\r\n\r\nstack backtrace:\r\n   1:        0x11181327c - sys::backtrace::write::h14b069da2ef97dc52Tt\r\n   2:        0x11183573f - failure::on_fail::h71d81df55b2a5af2YVz\r\n   3:        0x1117a1e8e - rt::unwind::begin_unwind_inner::h23a847da6a50bc517Dz\r\n   4:        0x10e00e03c - rt::unwind::begin_unwind::h7079710808834068848\r\n   5:        0x10e06350a - check::FnCtxt<'a, 'tcx>::add_obligations_for_parameters::h56b6a300b79749cfLvm\r\n   6:        0x10e09a43e - check::wf::CheckTypeWellFormedVisitor<'ccx, 'tcx>::check_item_well_formed::h4a879e2013b1ed6feRi\r\n   7:        0x10e181b0e - check_crate::unboxed_closure.31127\r\n   8:        0x10e17d195 - check_crate::h35beb10adedc521fBpy\r\n   9:        0x10dee377e - driver::phase_3_run_analysis_passes::h1e81668679a08bb8WFa\r\n  10:        0x10decf38e - driver::compile_input::h28b09001b27669f9Cba\r\n  11:        0x10df956d6 - run_compiler::h5d50c8d9c8190ef1l9b\r\n  12:        0x10df92a23 - thunk::F.Invoke<A, R>::invoke::h9173009492870309023\r\n  13:        0x10df91888 - rt::unwind::try::try_fn::h6996328782175136424\r\n  14:        0x11189f229 - rust_try_inner\r\n  15:        0x11189f216 - rust_try\r\n  16:        0x10df91ec6 - thunk::F.Invoke<A, R>::invoke::h11250675684554245921\r\n  17:        0x111822911 - sys::thread::thread_start::h5aaa20b8e513da74tGw\r\n  18:     0x7fff94b542fc - _pthread_body\r\n  19:     0x7fff94b54279 - _pthread_body\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/72046129","html_url":"https://github.com/rust-lang/rust/issues/21476#issuecomment-72046129","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/21476","id":72046129,"user":{"login":"mkaufmann","id":654092,"avatar_url":"https://avatars.githubusercontent.com/u/654092?v=3","gravatar_id":"","url":"https://api.github.com/users/mkaufmann","html_url":"https://github.com/mkaufmann","followers_url":"https://api.github.com/users/mkaufmann/followers","following_url":"https://api.github.com/users/mkaufmann/following{/other_user}","gists_url":"https://api.github.com/users/mkaufmann/gists{/gist_id}","starred_url":"https://api.github.com/users/mkaufmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkaufmann/subscriptions","organizations_url":"https://api.github.com/users/mkaufmann/orgs","repos_url":"https://api.github.com/users/mkaufmann/repos","events_url":"https://api.github.com/users/mkaufmann/events{/privacy}","received_events_url":"https://api.github.com/users/mkaufmann/received_events","type":"User","site_admin":false},"created_at":"2015-01-29T15:42:44Z","updated_at":"2015-01-29T15:42:44Z","body":"I just tested this with the current rust version. It now gives the following error\r\n> test.rs:8:25: 8:30 error: associated type bindings are not allowed here [E0229]\r\n\r\nCan be closed?"}}