about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
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
2017-08-28Auto merge of #44114 - daboross:patch-1, r=dtolnaybors-2/+4
Clarify that VecDeque::swap can panic The previous documentation mentioned this, but ambiguously used the term "fail". This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything. If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.
2017-08-28Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-31/+25
2017-08-27Clarify that VecDeque::swap can panicDavid Ross-2/+4
The previous documentation mentioned this, but ambiguously used the term "fail". This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-5/+0
2017-08-26Remove Splice struct return value from String::spliceMatt Ickstadt-107/+24
2017-08-26Rollup merge of #44090 - GuillaumeGomez:str-doc, r=steveklabnikCorey Farwell-1/+2
Add missing link in string doc r? @rust-lang/docs
2017-08-26Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnikCorey Farwell-23/+23
Fix inconsistent doc headings This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574. r? @steveklabnik
2017-08-25Add missing link in string docGuillaume Gomez-1/+2
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-2/+0
Fixes #41701.
2017-08-25Merge remote-tracking branch 'origin/master' into genAlex Crichton-66/+612
2017-08-25Auto merge of #44031 - scottmcm:swap_with_slice, r=alexcrichtonbors-1/+26
Add [T]::swap_with_slice The safe version of a method from `ptr`, like `[T]::copy_from_slice` is. Tracking issue: https://github.com/rust-lang/rust/issues/44030
2017-08-24Fix inconsistent doc headingslukaramu-23/+23
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
2017-08-23Auto merge of #42565 - murarth:rc-from-slice, r=aturonbors-65/+586
Implement From<&[T]> and others for Arc/Rc (RFC 1845) * Implements `From<`{`&[T]`, `&str`, `String`, `Box<T> where T: ?Sized`, `Vec<T>`}`>` for `Arc`/`Rc` * Removes `rustc_private`-marked methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from` Tracking issue: #40475
2017-08-21Add [T]::swap_with_sliceScott McMurray-1/+26
The safe version of a method from ptr, like [T]::copy_from_slice
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-33/+42
2017-08-19Implement `From<&[T]>` and others for `Arc`/`Rc`Murarth-65/+586
Implements RFC 1845, adding implementations of: * `From<&[T]>` for `Rc<[T]>` * `From<&str>` for `Rc<str>` * `From<String>` for `Rc<str>` * `From<Box<T: ?Sized>>` for `Rc<T>` * `From<Vec<T>>` for `Rc<[T]>` * and likewise for `Arc<_>` Also removes now-obsolete internal methods `Rc::__from_array` and `Rc::__from_str`, replacing their use with `Rc::from`.
2017-08-18Add missing links for String module and typeGuillaume Gomez-32/+41
2017-08-18Add missing url for fmt moduleGuillaume Gomez-1/+1
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-6/+6
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-6/+6
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-38/+391
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-38/+38
r=Mark-Simulacrum use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-38/+38
Like #43008 (f668999), but _much more aggressive_.