{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/22240","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/22240/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/22240/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/22240/events","html_url":"https://github.com/rust-lang/rust/issues/22240","id":57519003,"number":22240,"title":"Audit integer types in the standard library","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},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/P-backcompat-libs","name":"P-backcompat-libs","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"aturon","id":709807,"avatar_url":"https://avatars.githubusercontent.com/u/709807?v=3","gravatar_id":"","url":"https://api.github.com/users/aturon","html_url":"https://github.com/aturon","followers_url":"https://api.github.com/users/aturon/followers","following_url":"https://api.github.com/users/aturon/following{/other_user}","gists_url":"https://api.github.com/users/aturon/gists{/gist_id}","starred_url":"https://api.github.com/users/aturon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aturon/subscriptions","organizations_url":"https://api.github.com/users/aturon/orgs","repos_url":"https://api.github.com/users/aturon/repos","events_url":"https://api.github.com/users/aturon/events{/privacy}","received_events_url":"https://api.github.com/users/aturon/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rust-lang/rust/milestones/22","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":36,"closed_issues":28,"state":"open","created_at":"2015-01-06T21:40:55Z","updated_at":"2015-02-19T21:58:39Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2015-02-12T21:02:38Z","updated_at":"2015-02-20T05:10:05Z","closed_at":null,"body":"Below is a list of modules that contain text matching the regular expression `\\bu?int\\b` and which are intended to be stable. In some cases, these terms only appear in comments (which should still be fixed). In some cases, I have simply put `..` after a directory to indicate all files within that directory. Please sign up for modules in comments below and I will endeavor to keep this list up to date with who is working on what (if you have sufficient privileges, feel free to edit the comment directly).\r\n\r\n### Guidelines to follow\r\n\r\nThese are the guidelines that we intend to follow in the standard library. These guidelines are not intended as universal guidelines to be used outside the standard library (though of course one might choose to do so).\r\n\r\n0. Use unsigned values if the value should always be greater than or equal to zero, and signed values otherwise.\r\n1. For indices, pointers, or other values which are tied to a data structure whose size is proportional to the size of memory, use `usize` or `isize`.\r\n2. For cases where the acceptable domain of a value *perfectly fits* a fixed number of bits, use the appropriate fixed-size type. For example, a method like `write_u16` would take a `u16` argument.\r\n3. Otherwise, use `i32/u32` if the value has a narrow range and `i64/u64` otherwise.\r\n\r\nExamples:\r\n* Vector indices and hashmap lengths use `usize`.\r\n* The size of a file would be `u64`, as the maximum size of a file is not tied to addressable memory.\r\n* Something like `write_u16` takes a `u16` (shocker, I know!)\r\n* The radix of an integer would use `u32`.\r\n  * You might expect `u8`, since a radix higher than 256 is not useful, but the domain of useful radices is actually much smaller than `u8`, so using `u8` isn't providing a meaningful guarantee, and will simply increase friction.\r\n\r\n### Module listing\r\n\r\n* [x] libcollections/.. -- [Gankro](https://github.com/rust-lang/rust/issues/22240#issuecomment-74153425)\r\n* [x] libcore/mem.rs -- @pnkfelix #22401 \r\n* [x] libcore/ops.rs -- @nikomatsakis #22294 \r\n* [x] libcore/result.rs -- @nikomatsakis #22294 \r\n* [x] libcore/finally.rs -- @nikomatsakis #22294 \r\n* [x] libcore/marker.rs -- @nikomatsakis (no ints/uints)\r\n* [ ] libcore/borrow.rs -- @pnkfelix #22485\r\n* [ ] libcore/fmt/..\r\n* [x] libcore/char.rs -- petrochenkov #22339 \r\n* [x] libcore/option.rs -- @nikomatsakis #22294 \r\n* [ ] libcore/default.rs -- @pnkfelix #22485\r\n* [x] libcore/ptr.rs -- @nikomatsakis #22294 \r\n* [x] libcore/clone.rs @brson ok. no use of ints\r\n* [ ] libcore/cmp.rs -- @pnkfelix #22485\r\n* [x] libcore/str/.. -- petrochenkov #22339 \r\n* [x] libcore/nonzero.rs -- @pnkfelix #22401 \r\n* [x] libcore/cell.rs -- @pnkfelix #22401 \r\n* [ ] libcore/intrinsics.rs -- @pnkfelix #22485\r\n* [ ] libcore/num/.. @brson pow is covered by https://github.com/rust-lang/rust/pull/22087\r\n* [ ] libcore/lib.rs @GuillaumeGomez\r\n* [x] libcore/atomic.rs @brson. ok. everything is ptr size. bool is implemented as usize, but intentionally.\r\n* [ ] libcore/hash/..\r\n* [ ] libcore/panicking.rs @GuillaumeGomez #22507\r\n* [ ] libcore/macros.rs\r\n* [x] libcore/raw.rs @brson. ok. one usize representing slice length\r\n* [x] libcore/slice.rs @brson. ok. all usizes for indexes or ranges\r\n* [x] ~~libstd/sys/common/..~~ - not public\r\n* [x] ~~libstd/sys/windows/..~~ - not public\r\n* [x] ~~libstd/sys/unix/..~~ - not public\r\n* [x] libstd/collections/mod.rs -- [Gankro](https://github.com/rust-lang/rust/issues/22240#issuecomment-74153425)\r\n* [x] libstd/ascii.rs -- petrochenkov #22339 \r\n* [ ] libstd/thread.rs -- @GuillaumeGomez\r\n* [x] ~~libstd/os.rs~~ - will be `#[deprecated]`\r\n* [ ] libstd/num/..\r\n* [ ] libstd/lib.rs -- @GuillaumeGomez\r\n* [ ] libstd/thread_local/..\r\n* [ ] libstd/failure.rs \r\n* [x] ~~libstd/io/buffered.rs~~ - will be `#[deprecated]`\r\n* [ ] libstd/sync/..\r\n* [x] libunicode/.. #22339 \r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/75190582","html_url":"https://github.com/rust-lang/rust/issues/22240#issuecomment-75190582","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/22240","id":75190582,"user":{"login":"Gankro","id":1136864,"avatar_url":"https://avatars.githubusercontent.com/u/1136864?v=3","gravatar_id":"","url":"https://api.github.com/users/Gankro","html_url":"https://github.com/Gankro","followers_url":"https://api.github.com/users/Gankro/followers","following_url":"https://api.github.com/users/Gankro/following{/other_user}","gists_url":"https://api.github.com/users/Gankro/gists{/gist_id}","starred_url":"https://api.github.com/users/Gankro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gankro/subscriptions","organizations_url":"https://api.github.com/users/Gankro/orgs","repos_url":"https://api.github.com/users/Gankro/repos","events_url":"https://api.github.com/users/Gankro/events{/privacy}","received_events_url":"https://api.github.com/users/Gankro/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T05:10:04Z","updated_at":"2015-02-20T05:10:04Z","body":"Doing `std/num/..`"}}