{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/442","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/442/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/442/events","html_url":"https://github.com/rust-lang/rfcs/issues/442","id":47812518,"number":442,"title":"Support multiple blanket impls with differing bounds for traits","user":{"login":"soltanmm","id":4889063,"avatar_url":"https://avatars.githubusercontent.com/u/4889063?v=3","gravatar_id":"","url":"https://api.github.com/users/soltanmm","html_url":"https://github.com/soltanmm","followers_url":"https://api.github.com/users/soltanmm/followers","following_url":"https://api.github.com/users/soltanmm/following{/other_user}","gists_url":"https://api.github.com/users/soltanmm/gists{/gist_id}","starred_url":"https://api.github.com/users/soltanmm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soltanmm/subscriptions","organizations_url":"https://api.github.com/users/soltanmm/orgs","repos_url":"https://api.github.com/users/soltanmm/repos","events_url":"https://api.github.com/users/soltanmm/events{/privacy}","received_events_url":"https://api.github.com/users/soltanmm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-11-05T08:50:34Z","updated_at":"2015-04-10T13:44:47Z","closed_at":"2015-04-10T13:44:47Z","body":"This currently fails to compile:\r\n\r\n    trait Trait { fn asdf() {} }\r\n\r\n    trait A {}\r\n    trait B {}\r\n    \r\n    impl<T> Trait for T where T: A {}\r\n    impl<T> Trait for T where T: B {}\r\n\r\nwith error:\r\n\r\n    <anon>:8:1: 8:34 error: conflicting implementations for trait `Trait` [E0119]\r\n    <anon>:8 impl<T> Trait for T where T: A {}\r\n             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    <anon>:9:1: 9:34 note: note conflicting implementation here\r\n    <anon>:9 impl<T> Trait for T where T: B {}\r\n             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    error: aborting due to previous error\r\n\r\n[*Rust Playpen Link*](http://is.gd/GJbq8i)\r\n\r\nNaturally, this error makes sense. A type can `impl` both traits `A` and `B`. I was hoping that such a check could be deferred, though, thus resolving these 'conflicts' later when something actually asking for `Trait` pops up. Ex. a type that `impl`s only `A` would get the blanket `impl` for `A`, and if multiple `impl`s apply (e.g. the type `impl`s both `A` and `B`) then the compiler errors out.\r\n\r\nSome ideas\r\n---\r\n\r\nIt was suggested on IRC that one may allow both blanket `impl`s to apply by using UFCS path syntax to disambiguate trait bounds and narrow down the possibly applicable `impl`s to a single one. Ex. a type that `impl`s both `A` and `B` could get both blanket `impl`s but be disambiguated when calling via `<Type as A>::asdf()`.\r\n\r\nBut really I'd be totally cool with only one blanket `impl` applying to any one type at any time."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/91562994","html_url":"https://github.com/rust-lang/rfcs/issues/442#issuecomment-91562994","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/442","id":91562994,"user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T13:44:46Z","updated_at":"2015-04-10T13:44:46Z","body":"This issue is subsumed by the more general https://github.com/rust-lang/rfcs/issues/1053, so I'm going to close it."}}