{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22716","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22716/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22716/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22716/events","html_url":"https://github.com/rust-lang/rust/issues/22716","id":58602953,"number":22716,"title":"enumerate should be generic over the integer","user":{"login":"vks","id":33460,"avatar_url":"https://avatars.githubusercontent.com/u/33460?v=3","gravatar_id":"","url":"https://api.github.com/users/vks","html_url":"https://github.com/vks","followers_url":"https://api.github.com/users/vks/followers","following_url":"https://api.github.com/users/vks/following{/other_user}","gists_url":"https://api.github.com/users/vks/gists{/gist_id}","starred_url":"https://api.github.com/users/vks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vks/subscriptions","organizations_url":"https://api.github.com/users/vks/orgs","repos_url":"https://api.github.com/users/vks/repos","events_url":"https://api.github.com/users/vks/events{/privacy}","received_events_url":"https://api.github.com/users/vks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-libs","name":"A-libs","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-needs-decision","name":"I-needs-decision","color":"e11d21"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/P-backcompat-libs","name":"P-backcompat-libs","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/rust-lang/rust/milestones/22","html_url":"https://github.com/rust-lang/rust/milestones/1.0%20beta","labels_url":"https://api.github.com/repos/rust-lang/rust/milestones/22/labels","id":924511,"number":22,"title":"1.0 beta","description":"","creator":{"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},"open_issues":40,"closed_issues":50,"state":"open","created_at":"2015-01-06T21:40:55Z","updated_at":"2015-03-24T19:50:58Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-02-23T15:40:46Z","updated_at":"2015-03-24T20:22:22Z","closed_at":null,"body":"Currently `enumerate` uses `usize` for counting. This is necessary when iterating over slices (probably the most common scenario). However, in general an iterator is not necessarily related to memory, so it may make more sense to use other integer types.\r\n\r\nIt seems sensible to make `enumerate` generic over the integer type used for counting. This is backwards compatible, so it shouldn't break existing code.\r\n\r\n```rust\r\npub struct Enumerate<I, T: Int> {\r\n    iter: I,\r\n    count: T\r\n}\r\n```\r\n\r\nWould it be possible to make this change although `enumerate` is marked as stable?"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/85677355","html_url":"https://github.com/rust-lang/rust/issues/22716#issuecomment-85677355","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22716","id":85677355,"user":{"login":"alexcrichton","id":64996,"avatar_url":"https://avatars.githubusercontent.com/u/64996?v=3","gravatar_id":"","url":"https://api.github.com/users/alexcrichton","html_url":"https://github.com/alexcrichton","followers_url":"https://api.github.com/users/alexcrichton/followers","following_url":"https://api.github.com/users/alexcrichton/following{/other_user}","gists_url":"https://api.github.com/users/alexcrichton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexcrichton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexcrichton/subscriptions","organizations_url":"https://api.github.com/users/alexcrichton/orgs","repos_url":"https://api.github.com/users/alexcrichton/repos","events_url":"https://api.github.com/users/alexcrichton/events{/privacy}","received_events_url":"https://api.github.com/users/alexcrichton/received_events","type":"User","site_admin":false},"created_at":"2015-03-24T20:22:22Z","updated_at":"2015-03-24T20:22:22Z","body":"Ok after some more discussion the conclusion is that we probably don't want to make `enumerate` generic over integer types due to worries about inference and overcomplexity. This does seems like a worthwhile A-docs bug though, so I'm going to apply that label to ensure that we mention the `zip` alternative in the docs.\r\n"}}