about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2016-08-13impl Debug + Display for !Andrew Cann-0/+23
2016-08-12fix small typos in std::convert documentationMatthew Piziak-4/+4
Fix subject-verb agreement in copypasta: "`AsRef` dereference" to "`AsRef` dereferences". Formalize "eg" to "e.g." Italicization of common Latin abbreviations seems to be going out of style in written English, so I left it plain.
2016-08-11Rollup merge of #35562 - birkenfeld:as-mut-doc, r=steveklabnikJonathan Turner-2/+2
Remove redundant `&mut ref mut` in doc for Result::as_mut() While a good example of how `&mut ref mut` is a no-op, I don't think we should show that here :) See https://users.rust-lang.org/t/mnemonic-for-reading-qualifiers/6853 r? @steveklabnik
2016-08-11Rollup merge of #35279 - cengizIO:master, r=brsonJonathan Turner-8/+37
Provide a cleaner documentation for 'write!' Hello! This is my attempt to fix #35110 Any feedback is more than welcome! Cheers!
2016-08-11Use an existing constant name as an example.Andrii Dmytrenko-1/+1
2016-08-10Remove redundant `&mut ref mut` in doc for Result::as_mut()Georg Brandl-2/+2
2016-08-09Auto merge of #35425 - apasel422:refcell, r=alexcrichtonbors-9/+116
Implement `RefCell::{try_borrow, try_borrow_mut}` CC #35070 r? @alexcrichton
2016-08-08Auto merge of #34762 - creativcoder:slice-ext, r=alexcrichtonbors-8/+8
extend lifetime on binary_search_by_key of SliceExt trait Fixes #34683.
2016-08-08Implement `RefCell::{try_borrow, try_borrow_mut}`Andrew Paseltiner-9/+116
2016-08-09extend lifetime on binary_search_by_key of SliceExt traitRahul Sharma-8/+8
2016-08-06Fix overflow checking in unsigned pow()Caleb Jones-15/+11
The pow() method for unsigned integers produced 0 instead of trapping overflow for certain inputs. Calls such as 2u32.pow(1024) produced 0 when they should trap an overflow. This also adds tests for the correctly handling overflow in unsigned pow(). For issue number #34913
2016-08-06Indicate tracking issue for `exact_size_is_empty` unstability.Corey Farwell-1/+1
2016-08-06Rollup merge of #35281 - apasel422:repr, r=GuillaumeGomezEduard-Mihai Burtescu-8/+8
Clean up `std::raw` docs There is no longer a `Repr` trait, so mentioning a missing impl of it was potentially confusing. r? @steveklabnik
2016-08-05Clean up `std::raw` docsAndrew Paseltiner-8/+8
There is no longer a `Repr` trait, so mentioning a missing impl of it was potentially confusing.
2016-08-05Implement From for Cell, RefCell and UnsafeCellMarco A L Barbosa-0/+22
2016-08-05Rollup merge of #35042 - Havvy:copy_error_doc, r=GuillaumeGomezGuillaume Gomez-0/+6
Add Derive not possible question to Copy This adds a question and answer to the Q&A section of the Copy docs. Specifically, it asks the question I asked while reading the docs, and gives its answer. cc @steveklabnik
2016-08-03Auto merge of #34520 - Manishearth:fix-unsafecell-docs, r=steveklabnikbors-0/+19
Clarify UnsafeCell docs; fix #34496 None
2016-08-04Be more explicit about duck typingCengiz Can-20/+24
2016-08-04Use consistent spelling for word 'implementor'Cengiz Can-4/+4
2016-08-04Provide a cleaner documentation for 'write!'Cengiz Can-6/+31
2016-08-02core: fix `cargo build` for targets with "max-atomic-width": 0Jorge Aparicio-0/+2
This crate was failing to compile due to dead_code/unused_imports warnings. This commits disables these two lints for these targets.
2016-08-01Add Derive not possible question to CopyRyan Scheel (Havvy)-0/+6
This adds a question and answer to the Q&A section of the Copy docs. Specifically, it asks the question I asked while reading the docs, and gives its answer.
2016-07-30Rollup merge of #35058 - jethrogb:no_panic_abs, r=alexcrichtonManish Goregaokar-0/+84
Add non-panicking abs() functions to all signed integer types. Currently, calling abs() on one of the signed integer types might panic (in debug mode at least) because the absolute value of the largest negative value can not be represented in that signed type. Unlike all other integer operations, there is currently not a non-panicking version on this function. This seems to just be an oversight in the design, therefore just adding it now.
2016-07-29Rollup merge of #35072 - munyari:assert_debug, r=steveklabnikGuillaume Gomez-0/+18
Update docs for assert! and debug_assert! Refer to #34455
2016-07-29Rollup merge of #35062 - frewsxcv:chars-as-str, r=GuillaumeGomezGuillaume Gomez-0/+13
Add documentation example for `str::Chars::as_str`. None
2016-07-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-11/+744
Escape fewer Unicode codepoints in `Debug` impl of `str` Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` `0x20` This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-28Add non-panicking abs() functions to all signed integer types.Jethro Beekman-0/+84
Currently, calling abs() on one of the signed integer types might panic (in debug mode at least) because the absolute value of the largest negative value can not be represented in that signed type. Unlike all other integer operations, there is currently not a non-panicking version on this function. This seems to just be an oversight in the design, therefore just adding it now.
2016-07-28Add documentation example for `str::Chars::as_str`.Corey Farwell-0/+13
2016-07-28Rename `char::escape` to `char::escape_debug` and add tracking issueTobias Bucher-14/+14
2016-07-27Mention debug_assert! in assert! docPanashe M. Fundira-1/+2
2016-07-27Revert section about panic! in assert! docPanashe M. Fundira-3/+2
2016-07-27Correct minor typo in debug_assert docPanashe M. Fundira-1/+1
2016-07-27Update docs for assert! and debug_assert!Panashe M. Fundira-2/+20
2016-07-26Rollup merge of #34732 - durka:patch-27, r=steveklabnikSteve Klabnik-3/+4
document DoubleEndedIterator::next_back document DoubleEndedIterator::next_back fixes #34726
2016-07-26Rollup merge of #34609 - ubsan:transmute_docs, r=steveklabnikSteve Klabnik-5/+188
Add more docs - mostly warnings - to std::mem::transmute
2016-07-26Restore `char::escape_default` and add `char::escape` insteadTobias Bucher-3/+39
2016-07-26Clarify UnsafeCell docs; fix #34496Manish Goregaokar-0/+19
2016-07-24Rollup merge of #34976 - GuillaumeGomez:build_hasher_doc, r=steveklabnikManish Goregaokar-0/+10
Add BuildHasher example r? @steveklabnik
2016-07-23Fix indentation in src/libcore/lib.rsTobias Bucher-9/+9
2016-07-23Escape fewer Unicode codepoints in `Debug` impl of `str`Tobias Bucher-2/+699
Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` (`0x20`) This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/
2016-07-22Add BuildHasher exampleggomez-0/+10
2016-07-21Auto merge of #34544 - ↵bors-7/+11
3Hren:issue/xx/reinterpret-format-precision-for-strings, r=alexcrichton feat: reinterpret `precision` field for strings This commit changes the behavior of formatting string arguments with both width and precision fields set. Documentation says that the `width` field is the "minimum width" that the format should take up. If the value's string does not fill up this many characters, then the padding specified by fill/alignment will be used to take up the required space. This is true for all formatted types except string, which is truncated down to `precision` number of chars and then all of `fill`, `align` and `width` fields are completely ignored. For example: `format!("{:/^10.8}", "1234567890);` emits "12345678". In the contrast Python version works as the expected: ```python >>> '{:/^10.8}'.format('1234567890') '/12345678/' ``` This commit gives back the `Python` behavior by changing the `precision` field meaning to the truncation and nothing more. The result string *will* be prepended/appended up to the `width` field with the proper `fill` char. __However, this is the breaking change, I admit.__ Feel free to close it, but otherwise it should be mentioned in the `std::fmt` documentation somewhere near of `fill/align/width` fields description.
2016-07-21Fix nitsubsan-8/+7
2016-07-21Rollup merge of #34828 - seanmonstar:into-opton, r=alexcrichtonGuillaume Gomez-0/+8
core: impl From<T> for Option<T> First, the semantics of this `impl` seem spot on. If I have a value `T`, and I wish to make a `Option<T>`, then `Option::from(val)` should always give `Some(val)`. Second, this allows improvement for several APIs that currently take `Option<T>` as arguments. Consider: ```rust fn set_read_timeout(&mut self, timeout: Option<u32>) { // ... } x.set_read_timeout(Some(30)); x.set_read_timeout(Some(10)); x.set_read_timeout(None); ``` With this `impl`: ```rust fn set_read_timeout<T: Into<Option<u32>>>(&mut self, timeout: T) { let timeout = timeout.into(); // ... } x.set_read_timeout(30); x.set_read_timeout(10); x.set_read_timeout(Some(10)); // backwards compatible x.set_read_timeout(None); ``` The change to those methods aren't included, but could be modified later. r? @sfackler
2016-07-20core: impl From<T> for Option<T>Sean McArthur-0/+8
2016-07-19Auto merge of #34898 - sanxiyn:rollup, r=sanxiynbors-0/+10
Rollup of 5 pull requests - Successful merges: #34807, #34853, #34875, #34884, #34889 - Failed merges:
2016-07-18Auto merge of #34879 - petrochenkov:fnptr, r=alexcrichtonbors-2/+11
Implement traits for variadic function pointers Closes https://github.com/rust-lang/rust/issues/34874 cc https://github.com/rust-lang/rust/pull/28268 r? @alexcrichton
2016-07-18Auto merge of #34357 - tbu-:pr_exact_size_is_empty, r=brsonbors-2/+28
Add `is_empty` function to `ExactSizeIterator` All other types implementing a `len` functions have `is_empty` already.
2016-07-18Fix doctest of `ExactSizeIterator::is_empty`Tobias Bucher-1/+3
2016-07-18Rollup merge of #34875 - frewsxcv:std-slice-struct, r=GuillaumeGomezSeo Sanghyeon-0/+10
Indicate where `std::slice` structs originate from. None