{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/586","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/586/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/586/events","html_url":"https://github.com/rust-lang/rfcs/pull/586","id":54373812,"number":586,"title":"Negative bounds","user":{"login":"kennytm","id":103023,"avatar_url":"https://avatars.githubusercontent.com/u/103023?v=3","gravatar_id":"","url":"https://api.github.com/users/kennytm","html_url":"https://github.com/kennytm","followers_url":"https://api.github.com/users/kennytm/followers","following_url":"https://api.github.com/users/kennytm/following{/other_user}","gists_url":"https://api.github.com/users/kennytm/gists{/gist_id}","starred_url":"https://api.github.com/users/kennytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennytm/subscriptions","organizations_url":"https://api.github.com/users/kennytm/orgs","repos_url":"https://api.github.com/users/kennytm/repos","events_url":"https://api.github.com/users/kennytm/events{/privacy}","received_events_url":"https://api.github.com/users/kennytm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":13,"created_at":"2015-01-14T20:42:20Z","updated_at":"2015-02-02T15:46:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/586","html_url":"https://github.com/rust-lang/rfcs/pull/586","diff_url":"https://github.com/rust-lang/rfcs/pull/586.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/586.patch"},"body":"Executive summary:\r\n\r\n```rust\r\nimpl<T: Int + !Float> Average for T { ... }\r\nimpl<T: Float + !Int> Average for T { ... }\r\nimpl<T: Int + Float> Average for T { ... }\r\n```\r\n\r\n[Rendered](https://github.com/kennytm/rfcs/blob/neg-bounds/text/0000-negative-bounds.md)\r\n\r\ncc #442, #290, rust-lang/rust#19032."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/72479096","html_url":"https://github.com/rust-lang/rfcs/pull/586#issuecomment-72479096","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/586","id":72479096,"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-02-02T15:46:52Z","updated_at":"2015-02-02T15:46:52Z","body":"Gah. I haven't had time to really dig into this, but I have to and want to, because the inability to implement `Fn` traits widely is blocking some things I would really like to do -- and the only other alternative to negative bounds that I've found involves changes to coherence that effectively require the language to reconsider the correctness of every impl whenever any new impl is added, which seems like a non-starter (though I'm told this sort of exhaustive search *is* what Haskell does). In any case, this is all a long-winded way of something that I will make reading this in depth (and thinking about negative bounds) a priority today, which will hopefully lead to some more in-depth comments.\r\n\r\nHowever, one thing I did want to weigh in on: I am not in favor of adding any kind of negative region bounds at the moment. Region inference is complicated enough without trying to consider bounds of this kind. Now, granted, we could probably enforce these negative bounds as a kind of \"after-effect\", where we search over the results of inference (which will naturally try to infer the smallest region they can) and just check whether or not the negative bounds hold. But I'd still rather hold off absent a clear use-case, on the grounds of keeping future options open and limiting complexity."}}