summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2017-09-20Auto merge of #44355 - Xaeroxe:optimize_drain_filter, r=alexcrichtonbors-1/+7
Optimize drain_filter This PR cuts out two copies from each iteration of `drain_filter` by exchanging the swap operation for a copy_nonoverlapping function call instead. Since the data being swapped is not needed anymore we can just overwrite it instead.
2017-09-18alloc: Implement rfold for VecDeque iteratorsUlrik Sverdrup-0/+17
2017-09-18Add requested commentJacob Kiesel-0/+3
2017-09-18Rollup merge of #44640 - budziq:stabilize_splice, r=dtolnayAlex Crichton-8/+7
Stabilized vec_splice and modified splice tracking issue This stabilizes the vec_splice (Vec part of splice RFC) Fixes #32310.
2017-09-17Rollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichtonTim Neumann-33/+71
Implement `Arc`/`Rc` raw pointer conversions for `?Sized` * Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
2017-09-17Updated tracking issue for String::splice and its unstable-book entryMichal Budzynski-1/+1
2017-09-17stabilized vec_splice (fixes #32310)Michal Budzynski-7/+6
2017-09-16Rollup merge of #44273 - bluss:rc-downcast, r=alexcrichtonAlex Crichton-0/+61
Implement <Rc<Any>>::downcast * Implement `<Rc<Any>>::downcast::<T>` * New unstable method. Works just like Box\<Any\>, but for Rc. * Any has two cases for its methods: Any and Any + Send; Rc is never Send, so that case is skipped for Rc. * Motivation for being a method with self is to match Box and there is no user-supplied type; the inner type is Any and downcast does not conflict with any method of Any. * Arc was skipped because Any itself has no downcast for the case that makes most sense: Any + Send + Sync
2017-09-16Implement `Arc`/`Rc` raw pointer conversions for `?Sized`Murarth-33/+71
* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}
2017-09-15alloc: Add tracking issue for rc_downcastUlrik Sverdrup-1/+1
2017-09-14Rollup merge of #44572 - frewsxcv:frewsxcv-from-utf16-lossy, r=QuietMisdreavusCorey Farwell-0/+7
Clarify return type of `String::from_utf16_lossy`. Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-14Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfacklerCorey Farwell-8/+6
Remove unneeded `loop`. None
2017-09-14Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnikCorey Farwell-0/+1
Fix example in transmute; add safety requirement to Vec::from_raw_parts This fixes the second bullet point on #44281 and also removes some incorrect information.
2017-09-14Rollup merge of #44534 - adlerd:drain_filter_doctest, r=blussCorey Farwell-3/+6
Fix drain_filter doctest. Fixes #44499. Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.
2017-09-14Rollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcvCorey Farwell-0/+13
Add an example of std::str::encode_utf16 Closes #44419
2017-09-14Rollup merge of #44497 - tommyip:doc_example, r=frewsxcvCorey Farwell-0/+11
Add doc example to str::from_boxed_utf8_unchecked Fixes #44463.
2017-09-14Rollup merge of #44485 - 42triangles:master, r=frewsxcvCorey Farwell-0/+11
Added an example for `std::str::into_boxed_bytes()` This solves issue #44423.
2017-09-14Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcvCorey Farwell-1/+16
Add doc example to String::as_mut_str Fixes #44429.
2017-09-14Clarify return type of `String::from_utf16_lossy`.Corey Farwell-0/+7
Fixes https://github.com/rust-lang/rust/issues/32874
2017-09-13Remove unneeded `loop`.Corey Farwell-8/+6
2017-09-13Fix example in transmute; add safety requirement to Vec::from_raw_partsHavvy-0/+1
2017-09-12Fix drain_filter doctest.David Adler-3/+6
2017-09-12Auto merge of #44015 - kennytm:hasher, r=alexcrichtonbors-2/+64
impl Hasher for {&mut Hasher, Box<Hasher>} **Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution. **Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
2017-09-12Add an example of std::str::encode_utf16rwakulszowa-0/+13
Closes #44419
2017-09-12Auto merge of #44344 - jonhoo:entry_or_default, r=BurntSushibors-0/+27
Add or_default to Entry APIs As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
2017-09-12Disable the new Hasher tests on Emscripten.kennytm-0/+3
2017-09-12impl Hasher for {&mut Hasher, Box<Hasher>}kennytm-2/+61
2017-09-11Try using ref to raw conversionJacob Kiesel-2/+2
2017-09-11Add doc example to str::from_boxed_utf8_uncheckedTommy Ip-0/+11
Fixes #44463.
2017-09-11Removed trailing whitespace42triangles-1/+1
2017-09-11Added an example for `std::str::into_boxed_bytes()`42triangles-0/+11
2017-09-10Add doc example to String::as_mut_strTommy Ip-1/+16
Fixes #44429.
2017-09-10Rollup merge of #44467 - toidiu:ak-44382, r=frewsxcvGuillaume Gomez-7/+16
documentation update to demonstrate mutability #44467 - demonstrate correct implementation returns `Some` - demonstrate out of bounds returns `None` - demonstrate mutability
2017-09-10Rollup merge of #44457 - napen123:master, r=frewsxcvGuillaume Gomez-0/+28
Add doc examples for str::as_bytes_mut Fixes #44427
2017-09-09documentation update to demonstrate mutabilitytoidiu-7/+16
2017-09-09Add doc examples for str::as_bytes_mutEthan Dagner-0/+28
Fixes #44427
2017-09-09Add doc example to String::as_strTommy Ip-0/+10
Fixes #44428.
2017-09-05Fix ownership issuesJacob Kiesel-1/+3
2017-09-05Remove unneeded copyJacob Kiesel-1/+2
2017-09-05Avoid weird or_insert_with exampleJon Gjengset-3/+1
2017-09-05Add or_default to Entry APIsJon Gjengset-0/+29
2017-09-04Make slice::split_at_mut example demonstrate mutabilityNiels Egberts-20/+25
Moved the examples from split_at_mut to split_at so the example at split_at_mut can just demonstrate mutability.
2017-09-03alloc: Implement downcast Rc<Any> -> Rc<T>Ulrik Sverdrup-0/+61
Implement downcast the like it exists for Box. The implementation avoids using into_raw/from_raw, because the pointer arithmetic which should cancel does not seem to optimize out at the moment. Since Rc<T> is never Send, only Rc<Any> and not Rc<Any + Send> implements downcast.
2017-08-30Rollup merge of #44160 - AndyGauge:api-docs-macros, r=steveklabnikAlex Crichton-7/+22
API docs: macros. Standard Documentation Checklist Fixes #29381 r? @steveklabnik
2017-08-30Rollup merge of #44044 - mattico:string-splice-return, r=dtolnayAlex Crichton-107/+24
Remove Splice struct return value from String::splice The implementation is now almost identical to the one in the RFC. Fixes #44038 cc #32310
2017-08-29broken links resolvedAndy Gauge-2/+2
2017-08-29API docs: macros. Part of #29329 Standard Library Documentation Checklist.Andy Gauge-7/+22
2017-08-29Auto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushibors-0/+34
std: Mark allocation functions as nounwind This commit flags all allocation-related functions in liballoc as "this can't unwind" which should largely resolve the size-related issues found on #42808. The documentation on the trait was updated with such a restriction (they can't panic) as well as some other words about the relative instability about implementing a bullet-proof allocator. Closes #42808
2017-08-28Auto merge of #43076 - Zoxc:gen, r=arielb1bors-1/+13
Generator support This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved. This is not yet ready to be merged. Things to do: - [x] Make closure arguments on generators an error - [x] Spot FIXMEs - [x] Pass make tidy - [x] Write tests - [x] Document the current syntax and semantics for generators somewhere - [x] Use proper error message numbers - [x] ~~Make the implicit argument type default to `()`~~
2017-08-28std: Mark allocation functions as nounwindAlex Crichton-0/+34
This commit flags all allocation-related functions in liballoc as "this can't unwind" which should largely resolve the size-related issues found on #42808. The documentation on the trait was updated with such a restriction (they can't panic) as well as some other words about the relative instability about implementing a bullet-proof allocator. Closes #42808