{"action":"closed","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/36434","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/36434/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/36434/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/36434/events","html_url":"https://github.com/rust-lang/rust/issues/36434","id":176516549,"number":36434,"title":"Can associated items be self-referential?","user":{"login":"amluto","id":202764,"avatar_url":"https://avatars.githubusercontent.com/u/202764?v=3","gravatar_id":"","url":"https://api.github.com/users/amluto","html_url":"https://github.com/amluto","followers_url":"https://api.github.com/users/amluto/followers","following_url":"https://api.github.com/users/amluto/following{/other_user}","gists_url":"https://api.github.com/users/amluto/gists{/gist_id}","starred_url":"https://api.github.com/users/amluto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amluto/subscriptions","organizations_url":"https://api.github.com/users/amluto/orgs","repos_url":"https://api.github.com/users/amluto/repos","events_url":"https://api.github.com/users/amluto/events{/privacy}","received_events_url":"https://api.github.com/users/amluto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-13T00:12:04Z","updated_at":"2016-09-13T15:46:06Z","closed_at":"2016-09-13T15:46:06Z","body":"Consider this code:\r\n\r\n```\r\ntrait Future {\r\n    type Item;\r\n}\r\n\r\ntrait Stream {\r\n    type Item;\r\n}\r\n\r\nimpl<S: Sized> Future for Stream<Item = S> {\r\n    type Item = Option<(S, Box<Self::Item>)>;\r\n}\r\n```\r\n\r\nIt fails to compile with:\r\n```\r\nerror: overflow evaluating the requirement `<Stream<Item=S> + 'static as Future>::Item` [E0275]\r\n```\r\n\r\nThis isn't quite the case described by E0275 -- this isn't recursively referencing more and more types -- `Self::Item` has what I would consider to be a concrete type, even if it's awkward to write down.\r\n\r\nAnyway, there are two questions here:\r\n\r\n1. If this kind of code isn't intended to be supported, should the E0275 explanation be updated or should the error message be improved?\r\n\r\n2. I think it would be really neat if this type of code were supported.  Then I could have a Future that streams out values without needing to treat a stream as a special case.  Would this make any sense from a language POV?"}}
{"actor":{"display_login":"amluto"}}