about summary refs log tree commit diff
path: root/library/alloc
AgeCommit message (Collapse)AuthorLines
2020-10-17Move vec-macro-repeat testAlexis Bourget-0/+13
2020-10-17Rebase conflictsAlexis Bourget-0/+30
2020-10-17Move zero-sized-vec-push testAlexis Bourget-0/+17
2020-10-17Rollup merge of #77932 - ssomers:btree_cleanup_gdb, r=Mark-SimulacrumDylan DPC-1/+0
BTreeMap: improve gdb introspection of BTreeMap with ZST keys or values I accidentally pushed an earlier revision in #77788: it changes the index of tuples for BTreeSet from ""[{}]".format(i) to "key{}".format(i). Which doesn't seem to make the slightest difference on my linux box nor on CI. In fact, gdb doesn't make any distinction between "key{}" and "val{}" for a BTreeMap either, leading to confusing output if you test more. But easy to improve. r? @Mark-Simulacrum
2020-10-17Rollup merge of #77751 - vojtechkral:vecdeque-binary-search, r=scottmcm,dtolnayDylan DPC-1/+178
liballoc: VecDeque: Add binary search functions I am submitting rust-lang/rfcs#2997 as a PR as suggested by @scottmcm I haven't yet created a tracking issue - if there's a favorable feedback I'll create one and update the issue links in the unstable attribs.
2020-10-16Auto merge of #77997 - fusion-engineering-forks:to-string-no-shrink, ↵bors-1/+0
r=joshtriplett Remove shrink_to_fit from default ToString::to_string implementation. As suggested by `@scottmcm` on Zulip. shrink_to_fit() seems like the wrong thing to do here in most use cases of to_string(). Would be intereseting to see if it makes any difference in a timer run. r? `@joshtriplett`
2020-10-16liballoc: VecDeque: Simplify binary_search_by()Vojtech Kral-15/+4
2020-10-16liballoc: VecDeque: Add tracking issue for binary search fnsVojtech Kral-3/+3
2020-10-16Auto merge of #77850 - kornelski:resizedefault, r=dtolnaybors-44/+0
Remove deprecated unstable Vec::resize_default It's [been deprecated](https://github.com/rust-lang/rust/pull/57656) for 15 releases.
2020-10-16Remove shrink_to_fit from default ToString::to_string implementation.Mara Bos-1/+0
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2020-10-16Merge branch 'master' into box-allocTim Diekmann-40/+116
2020-10-16Rollup merge of #77935 - ssomers:btree_cleanup_1, r=Mark-SimulacrumDylan DPC-7/+62
BTreeMap: make PartialCmp/PartialEq explicit and tested Follow-up on a topic raised in #77612 r? @Mark-Simulacrum
2020-10-15Fix typo in documentationstrct-1/+1
2020-10-15Following #74010 by converting some newer cases of backticked O notations to ↵Ryan Scott-2/+2
be italicized
2020-10-15Made slice sort documentation consistent between stable and unstable versionsRyan Scott-7/+7
2020-10-14BTreeMap: making PartialCmp/PartialEq explicit and testedStein Somers-7/+62
2020-10-14BTreeMap: improve gdb introspection of BTreeMap with ZST keys or valuesStein Somers-1/+0
2020-10-14Rollup merge of #77870 - camelid:intra-doc-super, r=jyn514Dylan DPC-3/+3
Use intra-doc links for links to module-level docs r? @jyn514
2020-10-14Rollup merge of #77569 - ssomers:btree_cleanup_1, r=Mark-SimulacrumYuki Okushi-24/+28
BTreeMap: type-specific variants of node_as_mut and cast_unchecked Improves debug checking and shortens some expressions. Extracted from #77408
2020-10-13minor changes to pass the format checkStefan Lankes-1/+1
2020-10-13move __rg_oom to the libos to avoid duplicated symbolsStefan Lankes-1/+1
2020-10-13explicitly talk about integer literalsRalf Jung-3/+3
2020-10-12Use intra-doc links for links to module-level docsCamelid-3/+3
2020-10-12BTreeMap: refactor Entry out of map.rs into its own fileJacob Hughes-468/+480
btree/map.rs is approaching the 3000 line mark, splitting out the entry code buys about 500 lines of headroom
2020-10-12Remove deprecated unstable Vec::resize_defaultKornel-44/+0
2020-10-12clarify rules for ZST BoxesRalf Jung-0/+9
2020-10-11Rollup merge of #77738 - RalfJung:alloc-error-handler-comment, r=AmanieuYuki Okushi-5/+14
fix __rust_alloc_error_handler comment `__rust_alloc_error_handler` was added in the same `extern` block as the allocator functions, but the comment there was not actually correct for `__rust_alloc_error_handler`. So move it down to the rest of the default allocator handling with a fixed comment. At least the comment reflects my understanding of what happens, please check carefully. :) r? @Amanieu Cc @haraldh
2020-10-11Rollup merge of #77709 - pickfire:patch-1, r=jyn514Yuki Okushi-1/+2
Link Vec leak doc to Box
2020-10-10Improve vec leak wordingIvan Tham-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-10Alloc vec doc mention cannot undo leakIvan Tham-1/+2
2020-10-09liballoc: VecDeque: Add binary search functionsVojtech Kral-1/+189
2020-10-09rename __default_lib_allocator -> __default_alloc_error_handlerRalf Jung-1/+1
2020-10-09also extend global allocator commentRalf Jung-2/+3
2020-10-09fix __rust_alloc_error_handler commentRalf Jung-2/+10
2020-10-08Rollup merge of #77449 - ssomers:btree_drain_filter_size_hint, r=Mark-SimulacrumJonas Schievink-0/+4
BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic The `size_hint` of the `DrainFilter` iterator doesn't adjust as you iterate. This hardly seems important to me, but there has been a comparable PR #64383 in the past. I guess a scenario is that you first iterate half the map manually and keep most of the key/value pairs in the map, and then tell the predicate to drain most of the key/value pairs and `.collect` the iterator over the remaining half of the map. I am totally ambivalent whether this is better or not. r? @Mark-Simulacrum
2020-10-08Link Vec leak doc to BoxIvan Tham-1/+1
2020-10-08Rename LayoutErr to LayoutError outside of coreJacob Hughes-5/+5
2020-10-07Auto merge of #74194 - mbrubeck:slice-eq, r=sfacklerbors-1/+4
Add PartialEq impls for Vec <-> slice This is a follow-up to #71660 and rust-lang/rfcs#2917 to add two more missing vec/slice PartialEq impls: ``` impl<A, B> PartialEq<[B]> for Vec<A> where A: PartialEq<B> { .. } impl<A, B> PartialEq<Vec<B>> for [A] where A: PartialEq<B> { .. } ``` Since this is insta-stable, it should go through the `@rust-lang/libs` FCP process. Note that I used version 1.47.0 for the `stable` attribute because I assume this will not merge before the 1.46.0 branch is cut next week.
2020-10-07Support custom allocators in `Box`Tim Diekmann-149/+430
Remove `Box::leak_with_alloc` Add leak-test for box with allocator Rename `AllocErr` to `AllocError` in leak-test Add `Box::alloc` and adjust examples to use the new API
2020-10-06avoid unnecessary intermediate reference and improve safety commentsRalf Jung-6/+11
2020-10-05BTreeMap: derive type-specific variants of node_as_mut and cast_uncheckedStein Somers-24/+28
2020-10-05make IterMut Send/Sync againRalf Jung-0/+7
2020-10-05VecDeque: avoid more aliasing issues by working with raw pointers instead of ↵Ralf Jung-12/+31
references
2020-10-05VecDeque: fix incorrect &mut aliasing in IterMut::next/next_backRalf Jung-7/+24
2020-10-05Rollup merge of #77514 - scottmcm:less-once-chain-once, r=estebankDylan DPC-2/+4
Replace some once(x).chain(once(y)) with [x, y] IntoIter Now that we have by-value array iterators that are [already used](https://github.com/rust-lang/rust/blob/25c8c53dd994acb3f4f7c02fe6bb46076393f8b0/compiler/rustc_hir/src/def.rs#L305-L307)... For example, ```diff - once(self.type_ns).chain(once(self.value_ns)).chain(once(self.macro_ns)).filter_map(|it| it) + IntoIter::new([self.type_ns, self.value_ns, self.macro_ns]).filter_map(|it| it) ```
2020-10-05Rollup merge of #77471 - ssomers:btree_cleanup_3, r=Mark-SimulacrumDylan DPC-7/+7
BTreeMap: refactoring around edges, missed spots Tweaks from #77244 (and more) that are really inconsistencies in #77005. r? @Mark-Simulacrum
2020-10-05Rollup merge of #77395 - ssomers:btree_love_the_leaf_edge_comments, ↵Dylan DPC-22/+12
r=Mark-Simulacrum BTreeMap: admit the existence of leaf edges in comments The btree code is ambiguous about leaf edges (i.e., edges within leaf nodes). Iteration relies on them heavily, but some of the comments suggest there are no leaf edges (extracted from #77025) r? @Mark-Simulacrum
2020-10-04Rollup merge of #77445 - ssomers:btree_cleanup_7, r=Mark-SimulacrumJonas Schievink-27/+118
BTreeMap: complete the compile-time test_variance test case Some of the items added to the new `test_sync` belonged in the old `test_variance` as well. And fixed inconsistent paths to nearby modules. r? @Mark-Simulacrum
2020-10-04Auto merge of #76448 - haraldh:default_alloc_error_handler_reduced, r=Amanieubors-0/+47
Implement Make `handle_alloc_error` default to panic (for no_std + liballoc) Related: https://github.com/rust-lang/rust/issues/66741 Guarded with `#![feature(default_alloc_error_handler)]` a default `alloc_error_handler` is called, if a custom allocator is used and no other custom `#[alloc_error_handler]` is defined.
2020-10-04Rollup merge of #77447 - ssomers:btree_cleanup_8, r=Mark-SimulacrumYuki Okushi-2/+6
BTreeMap: document DrainFilterInner better r? @Mark-Simulacrum