about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
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-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-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-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