{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/26955","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/26955/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/26955/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/26955/events","html_url":"https://github.com/rust-lang/rust/pull/26955","id":94413284,"number":26955,"title":"WIP: Add RawVec to unify raw Vecish code","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},"labels":[],"state":"open","locked":false,"assignee":{"login":"huonw","id":1203825,"avatar_url":"https://avatars.githubusercontent.com/u/1203825?v=3","gravatar_id":"","url":"https://api.github.com/users/huonw","html_url":"https://github.com/huonw","followers_url":"https://api.github.com/users/huonw/followers","following_url":"https://api.github.com/users/huonw/following{/other_user}","gists_url":"https://api.github.com/users/huonw/gists{/gist_id}","starred_url":"https://api.github.com/users/huonw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huonw/subscriptions","organizations_url":"https://api.github.com/users/huonw/orgs","repos_url":"https://api.github.com/users/huonw/repos","events_url":"https://api.github.com/users/huonw/events{/privacy}","received_events_url":"https://api.github.com/users/huonw/received_events","type":"User","site_admin":false},"milestone":null,"comments":20,"created_at":"2015-07-10T23:33:20Z","updated_at":"2015-07-16T11:07:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/26955","html_url":"https://github.com/rust-lang/rust/pull/26955","diff_url":"https://github.com/rust-lang/rust/pull/26955.diff","patch_url":"https://github.com/rust-lang/rust/pull/26955.patch"},"body":"Per the top level comment:\r\n\r\nA low-level utility for more ergonomically allocating, reallocating, and deallocating a\r\na buffer of memory on the heap without having to worry about all the corner cases\r\ninvolved. This type is excellent for building your own data structures like Vec and VecDeque.\r\nIn particular:\r\n\r\n* Produces heap::EMPTY on zero-sized types\r\n* Produces heap::EMPTY on zero-length allocations\r\n* Catches all overflows in capacity computations (promotes them to \"capacity overflow\" panics)\r\n* Guards against 32-bit systems allocating more than isize::MAX bytes\r\n* Guards against overflowing your length\r\n* Aborts on OOM\r\n* Avoids freeing heap::EMPTY\r\n* Contains a ptr::Unique and thus endows the user with all related benefits\r\n\r\nThis type does not in anyway inspect the memory that it manages. When dropped it *will*\r\nfree its memory, but it *won't* try to Drop its contents. It is up to the user of RawVec\r\nto handle the actual things *stored* inside of a RawVec.\r\n\r\nNote that a RawVec always forces its capacity to be usize::MAX for zero-sized types.\r\nThis enables you to use capacity growing logic catch the overflows in your length\r\nthat might occur with zero-sized types.\r\n\r\nHowever this means that you need to be careful when roundtripping this type\r\nwith a `Box<[T]>`: `cap()` won't yield the len. However `with_capacity`,\r\n`shrink_to_fit`, and `from_box` will actually set RawVec's private capacity\r\nfield. This allows zero-sized types to not be special-cased by consumers of\r\nthis type.\r\n\r\nEdit: \r\nfixes #18726 and fixes #23842"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/121927251","html_url":"https://github.com/rust-lang/rust/pull/26955#issuecomment-121927251","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/26955","id":121927251,"user":{"login":"Manishearth","id":1617736,"avatar_url":"https://avatars.githubusercontent.com/u/1617736?v=3","gravatar_id":"","url":"https://api.github.com/users/Manishearth","html_url":"https://github.com/Manishearth","followers_url":"https://api.github.com/users/Manishearth/followers","following_url":"https://api.github.com/users/Manishearth/following{/other_user}","gists_url":"https://api.github.com/users/Manishearth/gists{/gist_id}","starred_url":"https://api.github.com/users/Manishearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Manishearth/subscriptions","organizations_url":"https://api.github.com/users/Manishearth/orgs","repos_url":"https://api.github.com/users/Manishearth/repos","events_url":"https://api.github.com/users/Manishearth/events{/privacy}","received_events_url":"https://api.github.com/users/Manishearth/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T11:07:29Z","updated_at":"2015-07-16T11:07:29Z","body":"This breaks the debuginfo tests, I think the pretty printers need to be updated so that they can understand the new `Vec`/`String`.\r\n\r\ncc @michaelwoerister "}}