{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/20417","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/20417/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/20417/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/20417/events","html_url":"https://github.com/rust-lang/rust/issues/20417","id":53235903,"number":20417,"title":"ICE - ambiguity from something other than a trait","user":{"login":"compressed","id":28634,"avatar_url":"https://avatars.githubusercontent.com/u/28634?v=3","gravatar_id":"","url":"https://api.github.com/users/compressed","html_url":"https://github.com/compressed","followers_url":"https://api.github.com/users/compressed/followers","following_url":"https://api.github.com/users/compressed/following{/other_user}","gists_url":"https://api.github.com/users/compressed/gists{/gist_id}","starred_url":"https://api.github.com/users/compressed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compressed/subscriptions","organizations_url":"https://api.github.com/users/compressed/orgs","repos_url":"https://api.github.com/users/compressed/repos","events_url":"https://api.github.com/users/compressed/events{/privacy}","received_events_url":"https://api.github.com/users/compressed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-02T03:23:04Z","updated_at":"2015-01-02T03:23:04Z","closed_at":null,"body":"This was working for me a few days ago, but seems to fail now due to an ICE.\r\n\r\n**Example**\r\n```rust\r\n#![feature(associated_types)]\r\n\r\n#[deriving(Show, Copy)]\r\npub enum AnimalError {\r\n    ErrAnimal,\r\n}\r\n\r\ntrait Animal {\r\n    type Sized? T;\r\n    fn new(t: &Self::T) -> Self;\r\n}\r\n\r\n#[deriving(Show)]\r\nstruct Dog {\r\n    name: String\r\n}\r\n\r\nimpl Animal for Dog {\r\n    type T = str;\r\n    fn new(s: &str) -> Dog {\r\n        Dog {name : s.to_string()}\r\n    }\r\n}\r\n\r\nimpl Animal for Result<Dog, AnimalError> {\r\n    type T = int;\r\n    fn new(i: &int) -> Result<Dog, AnimalError> {\r\n        Ok(Dog {name : format!(\"{}\",i).to_string()})\r\n    }\r\n}\r\n\r\nfn main() {\r\n    let d = Animal::new(&123).unwrap();\r\n}\r\n```\r\n\r\n**Trace**\r\n```\r\n❯❯❯ rustc --version                            ⏎\r\nrustc 0.13.0-nightly (10d99a973 2014-12-31 21:01:42 +0000)\r\n❯❯❯ RUST_BACKTRACE=1 rustc trait_ice.rs        ⏎\r\ntrait_ice.rs:33:13: 33:39 error: the type of this value must be known in this context\r\ntrait_ice.rs:33     let d = Animal::new(&123).unwrap();\r\n                            ^~~~~~~~~~~~~~~~~~~~~~~~~~\r\ntrait_ice.rs:33:13: 33:24 error: internal compiler error: ambiguity from something other than a trait: Binder(ProjectionPredicate(<_ as TraitRef(_, Animal)>::T, _))\r\ntrait_ice.rs:33     let d = Animal::new(&123).unwrap();\r\n                            ^~~~~~~~~~~\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 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:123\r\n\r\nstack backtrace:\r\n   1:        0x10b200515 - sys::backtrace::write::ha2004d7552d95a80Xut\r\n   2:        0x10b2252e3 - failure::on_fail::h158e51da7e7e7b42EDz\r\n   3:        0x10b18ae3a - rt::unwind::begin_unwind_inner::hdbcf34d1c8e0e91f8kz\r\n   4:        0x1090aab47 - rt::unwind::begin_unwind::h1979539420006791692\r\n   5:        0x1090aaadc - diagnostic::SpanHandler::span_bug::h44cd9decebbf80a0fPF\r\n   6:        0x108898e20 - middle::traits::error_reporting::report_fulfillment_error::hdc9cd6490335fdb3NXO\r\n   7:        0x108775002 - middle::traits::error_reporting::report_fulfillment_errors::h2c6ce23b95568e6eiXO\r\n   8:        0x1080a6222 - check::vtable::select_all_fcx_obligations_or_error::h545fc2f3572e6d4fPnb\r\n   9:        0x10816534a - check::check_bare_fn::h37e30ed3fcd2cd69zAj\r\n  10:        0x10815c84f - check::check_item::h07af1ef81fbd8851BTj\r\n  11:        0x1082edb90 - check_crate::unboxed_closure.39841\r\n  12:        0x1082e93f3 - check_crate::h8a17065eed9533a1gNx\r\n  13:        0x107b0aaf2 - driver::phase_3_run_analysis_passes::hfbea6efbabd5412eqva\r\n  14:        0x107af788c - driver::compile_input::hb95b6e80e64e2faewba\r\n  15:        0x107c291d3 - thunk::F.Invoke<A, R>::invoke::h12817112036656791171\r\n  16:        0x107c26330 - rt::unwind::try::try_fn::h17368462539297626619\r\n  17:        0x10b28d309 - rust_try_inner\r\n  18:        0x10b28d2f6 - rust_try\r\n  19:        0x107c26a76 - thunk::F.Invoke<A, R>::invoke::h213923948037817051\r\n  20:        0x10b211884 - sys::thread::thread_start::h3c81cbd736c98217Gkw\r\n  21:     0x7fff903fb2fc - _pthread_body\r\n  22:     0x7fff903fb279 - _pthread_body\r\n```"}}