summary refs log tree commit diff
path: root/library/alloc
AgeCommit message (Collapse)AuthorLines
2020-11-07remove needs_dropThe8472-8/+4
2020-10-03Rollup merge of #75377 - canova:map_debug_impl, r=dtolnayJonas Schievink-7/+51
Fix Debug implementations of some of the HashMap and BTreeMap iterator types HashMap's `ValuesMut`, BTreeMaps `ValuesMut`, IntoValues and `IntoKeys` structs were printing both keys and values on their Debug implementations. But they are iterators over either keys or values. Irrelevant values should not be visible. With this PR, they only show relevant fields. This fixes #75297. [Here's an example code.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0c79356ed860e347a0c1a205616f93b7) This prints this on nightly: ``` ValuesMut { inner: IterMut { range: [(1, "hello"), (2, "goodbye")], length: 2 } } IntoKeys { inner: [(1, "hello"), (2, "goodbye")] } IntoValues { inner: [(1, "hello"), (2, "goodbye")] } [(2, "goodbye"), (1, "hello")] ``` After the patch this example prints these instead: ``` ["hello", "goodbye"] ["hello", "goodbye"] [1, 2] ["hello", "goodbye"] ``` I didn't add test cases for them, since I couldn't see any tests for Debug implementations anywhere. But please let me know if I should add it to a specific place. r? @dtolnay
2020-10-01BTreeMap: use Unique::from to avoid a cast where type information existsStein Somers-1/+1
2020-10-01Auto merge of #77383 - pickfire:patch-6, r=Mark-Simulacrumbors-3/+4
Fix typo in vec doc "tries to reserves" Superseeds #77192
2020-10-01Fix typo in vec doc "tries to reserves"Ivan Tham-3/+4
2020-10-01Rollup merge of #77315 - exrook:rename-allocerror, r=joshtriplettDylan DPC-17/+17
Rename AllocErr to AllocError Implements rust-lang/wg-allocators#57
2020-09-30Rollup merge of #77340 - pickfire:patch-9, r=kennytmJonas Schievink-1/+1
Alloc vec use imported path mem::ManuallyDrop::new -> ManuallyDrop::new cc @the8472
2020-09-30Rollup merge of #77338 - pickfire:patch-7, r=jyn514Jonas Schievink-1/+1
Fix typo in alloc vec comment cc @the8472
2020-09-30Rollup merge of #77233 - ssomers:btree_size_matters, r=Mark-SimulacrumJonas Schievink-0/+9
BTreeMap: keep an eye out on the size of the main components r? @Mark-Simulacrum
2020-09-29Alloc vec use imported pathIvan Tham-1/+1
mem::ManuallyDrop::new -> ManuallyDrop::new
2020-09-29Fix typo in alloc vec commentIvan Tham-1/+1
2020-09-29Auto merge of #77253 - jyn514:crate-link, r=Manishearthbors-1/+1
Resolve `crate` in intra-doc links properly across crates Closes https://github.com/rust-lang/rust/issues/77193; see https://github.com/rust-lang/rust/issues/77193#issuecomment-699065946 for an explanation of what's going on here. ~~This also fixes the BTreeMap docs that have been broken for a while; see the description on the second commit for why and how.~~ Nope, see the second commit for why the link had to be changed. r? `@Manishearth` cc `@dylni` `@dylni` note that this doesn't solve your original problem - now _both_ `with_code` and `crate::with_code` will be broken links. However this will fix a lot of other broken links (in particular I think https://docs.rs/sqlx/0.4.0-beta.1/sqlx/query/struct.Query.html is because of this bug). I'll open another issue for resolving additional docs in the new scope.
2020-09-28Rename AllocErr to AllocErrorJacob Hughes-17/+17
2020-09-28Rollup merge of #76454 - poliorcetics:ui-to-unit-test-1, r=matkladRalf Jung-1/+409
UI to unit test for those using Cell/RefCell/UnsafeCell Helps with #76268. I'm working on all files using `Cell` and moving them to unit tests when possible. r? @matklad
2020-09-27Use relative links instead of intra-doc linksJoshua Nelson-1/+1
Previously, `BTreeMap` tried to link to `crate::collections`, intending for the link to go to `std/collections/index.html`. But `BTreeMap` is defined in `alloc`, so after the fix in the previous commit, the links instead went to `alloc/collections/index.html`, which has almost no information. This changes it to link to `index.html`, which only works when viewing from `std::collections::BTreeMap`, the most common place to visit the docs. Fixing it to work from anywhere would require the docs for `std::collections` to be duplicated in `alloc::collections`, which in turn would require HashMap to be `alloc` for intra-doc links to work (https://github.com/rust-lang/rust/issues/74481).
2020-09-27Rollup merge of #77184 - pickfire:patch-4, r=kennytmJonas Schievink-1/+1
Rust vec bench import specific rand::RngCore Using `RngCore` import for side effects is clearer than `*` which may bring it unnecessary more stuff than needed, it is also more explicit doing so. @pickfire change `LEN = 16384` (and pos) and `once` instead of `[0].iter()` after this. @rustbot modify labels: +C-cleanup +A-testsuite
2020-09-26BTreeMap: keep an eye out on the size of the main componentsStein Somers-0/+9
2020-09-25Auto merge of #77201 - matthewjasper:rename-get-unchecked, r=spastorinobors-3/+9
Rename Iterator::get_unchecked Closes #76479 r? `@pnkfelix`
2020-09-25review: fix nits and move panic safety tests to the correct placeAlexis Bourget-13/+11
2020-09-25Rename Iterator::get_uncheckedMatthew Jasper-1/+1
It's possible for method resolution to pick this method over a lower priority stable method, causing compilation errors. Since this method is permanently unstable, give it a name that is very unlikely to be used in user code.
2020-09-25Improve <vec::IntoIter>::get_unchecked` safety commentMatthew Jasper-2/+8
2020-09-25Rollup merge of #77189 - pickfire:patch-5, r=Mark-SimulacrumJonas Schievink-1/+0
Remove extra space from vec drawing
2020-09-25Rollup merge of #77005 - ssomers:btree_cleanup_3, r=Mark-SimulacrumJonas Schievink-110/+99
BtreeMap: refactoring around edges Parts chipped off a more daring effort, that the btree benchmarks judge to be performance-neutral. r? @Mark-Simulacrum
2020-09-25Remove extra space from vec drawingIvan Tham-1/+0
2020-09-25Rust vec bench import specific rand::RngCoreIvan Tham-1/+1
2020-09-25BTreeMap: various tweaksStein Somers-61/+50
2020-09-25BTreeMap: introduce edge methods similar to those of keys and valuesStein Somers-24/+34
2020-09-25BTreeMap: refactor correct_childrens_parent_linksStein Somers-26/+16
2020-09-25Rollup merge of #77079 - poliorcetics:more-self-in-docs, r=jyn514Jonas Schievink-2/+2
Use `Self` in docs when possible Fixes #76542. I used `rg '\s*//[!/]\s+fn [\w_]+\(&?self, ' .` in `library/` to find instances, I found some with that and some by manually checking. @rustbot modify labels: C-enhancement T-doc
2020-09-25Rollup merge of #77050 - follower:patch-1, r=oli-obkJonas Schievink-1/+1
Typo fix: "satsify" -> "satisfy"
2020-09-25Rollup merge of #77044 - pickfire:patch-4, r=jyn514Jonas Schievink-3/+3
Liballoc bench vec use mem take not replace
2020-09-23Rollup merge of #77017 - GuillaumeGomez:vec-missing-examples-iter, r=Dylan-DPCDylan DPC-0/+31
Add missing examples on Vec iter types r? @Dylan-DPC
2020-09-23Rollup merge of #76993 - blitzerr:alloc-ref, r=AmanieuDylan DPC-18/+19
Changing the alloc() to accept &self instead of &mut self Fixes: [#55](https://github.com/rust-lang/wg-allocators/issues/55) This is the first cut. It only makes the change for `alloc` method.
2020-09-22a few more &mut self -> self changesblitzerr-4/+4
2020-09-23Use Self in allocAlexis Bourget-2/+2
2020-09-22Update library functions with stability attributesDylan MacKenzie-0/+6
This may not be strictly minimal, but all unstable functions also need a `rustc_const_unstable` attribute.
2020-09-22removing &mut self for other methods of AllocRefblitzerr-5/+5
2020-09-22Add missing examples on Vec iter typesGuillaume Gomez-0/+31
2020-09-22Typo fix: "satsify" -> "satisfy"follower-1/+1
2020-09-22Liballoc bench vec use mem take not replaceIvan Tham-3/+3
2020-09-21Rollup merge of #72734 - pickfire:liballoc, r=KodrAusecstatic-morse-15/+13
Reduce duplicate in liballoc reserve error handling Not sure if it affects compilation time.
2020-09-21replaced cell::update with cell::[g|s]etblitzerr-5/+1
2020-09-21Added feature flag to use cell_updateblitzerr-0/+4
2020-09-21Changing the alloc() to accept &self instead of &mut selfblitzerr-9/+10
2020-09-21Move vec-cycle-wrapped testAlexis Bourget-0/+41
2020-09-21Move vec-cycle testAlexis Bourget-0/+39
2020-09-21Move deref-lval testAlexis Bourget-0/+9
2020-09-21move format! interface testsAlexis Bourget-1/+322
2020-09-21Rollup merge of #76983 - ssomers:btree_extra_test, r=Mark-SimulacrumRalf Jung-6/+25
BTreeMap: extra testing & fixed comments r? @Mark-Simulacrum
2020-09-21Rollup merge of #76981 - pickfire:patch-5, r=Mark-SimulacrumRalf Jung-14/+14
liballoc bench use imported path Bencher test is already in scope, no need to use the full path