about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-06-16Auto merge of #26313 - steveklabnik:fix_str_docs, r=alexcrichtonbors-10/+10
Because these structures are created by a macro, the doc comments don't quite work: the leading /// isn't stripped. Instead, just use #[doc] so that they render correctly.
2015-06-15Fix up Split docsSteve Klabnik-10/+10
Because these structures are created by a macro, the doc comments don't quite work: the leading /// isn't stripped. Instead, just use #[doc] so that they render correctly.
2015-06-15Auto merge of #25359 - thepowersgang:result-expect-2, r=alexcrichtonbors-0/+20
As it says in the title. I've added an `expect` method to `Result` that allows printing both an error message (e.g. what operation was attempted), and the error value. This is separate from the `unwrap` and `ok().expect("message")` behaviours.
2015-06-15libcore/Result - RFC#1119 Add an 'expect' method to ResultJohn Hodge-0/+20
2015-06-14Update mod.rsWei-Ming Yang-2/+2
`FormatError` is not exist anymore.
2015-06-13doc: make char::from_u32 example more briefTshepang Lekhonkhobe-11/+2
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-10/+10
Pull request for #26188.
2015-06-11Auto merge of #26212 - Manishearth:rollup, r=Manishearthbors-0/+2
- Successful merges: #26181, #26184, #26189, #26191, #26195, #26202 - Failed merges:
2015-06-11Auto merge of #26177 - jooert:fix26169, r=alexcrichtonbors-54/+71
Closes #26169. r? @steveklabnik
2015-06-11Rollup merge of #26189 - bluss:iter-once-clone, r=GankroManish Goregaokar-0/+2
core: impl Clone for option::IntoIter and iter::Once
2015-06-11Auto merge of #26154 - pmarcelll:master, r=Gankrobors-0/+4
Various methods in both libcore/char.rs and librustc_unicode/char.rs were previously marked with #[inline], now every method is marked in char's impl blocks. Partially fixes #26124. EDIT: I'm not familiar with pull reqests (yet), apparently Github added my second commit to thit PR... Fixes #26124
2015-06-11Auto merge of #25839 - bluss:str-split-at-impl, r=alexcrichtonbors-0/+13
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str). Also a minor cleanup in the collections::str module. Remove redundant slicing of self.
2015-06-10Auto merge of #24689 - SimonSapin:formatter-write-char, r=alexcrichtonbors-4/+16
This is the logical next step after #24661, but I’m less sure about this one. r? @alexcrichton
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-10/+10
2015-06-10Have std::fmt::Formatter implement std::fmt::Write.Simon Sapin-7/+15
2015-06-10core: impl Clone for option::IntoIter and iter::OnceUlrik Sverdrup-0/+2
2015-06-10Add a write_char method to std::fmt::Formatter.Simon Sapin-4/+8
This is the logical next step after #24661, but I’m less sure about this one.
2015-06-10Improve examples for atomic types.Johannes Oertel-54/+71
Swap arguments of `assert_eq!` calls, insert additional assertions here and there. Closes #26169.
2015-06-10Add str::split_atUlrik Sverdrup-0/+13
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str).
2015-06-09Add missing #[inline] to methods related to char.marcell-0/+4
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-6/+6
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-06-08Auto merge of #25823 - oli-obk:static_to_const_lint, r=alexcrichtonbors-4/+1
r? @eddyb
2015-06-07change some statics to constantsOliver 'ker' Schneider-4/+1
2015-06-07Auto merge of #26066 - steveklabnik:docs_on_a_plane, r=alexcrichtonbors-19/+4
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-06-06Remove many unneeded feature annotations in the docsSteve Klabnik-19/+4
When things get stabilized, they don't always have their docs updated to remove the gate.
2015-06-04Doc-comment fix; trait names are capitalizedCorey Farwell-2/+2
2015-06-03Improve `try!` docs to make clearer it returns `Result`.Carol Nichols-1/+3
The API documentation is not explicit enough that because `try!` returns `Err` early for you, you can only use it in functions that return `Result`. The book mentions this, but if you come across `try!` outside of the book and look it up in the docs, this restriction on the return type of the function is not particularly clear.
2015-06-02Auto merge of #25867 - petrochenkov:ucellv, r=alexcrichtonbors-1/+8
Now when const functions are implemented and used, the `value` field of `UnsafeCell` can be made deprecated (and then private as intended).
2015-06-02Rollup merge of #25920 - tshepang:option-map-example, r=GankroManish Goregaokar-3/+5
2015-06-01doc: improve Option::map exampleTshepang Lekhonkhobe-3/+5
2015-06-01Auto merge of #25923 - tshepang:patch-1, r=Gankrobors-1/+1
2015-05-31doc: fix displayed messageTshepang Lekhonkhobe-1/+1
2015-05-31doc: improve map_or and map_or_elseTshepang Lekhonkhobe-6/+8
2015-05-30Deprecate UnsafeCell::valuepetrochenkov-1/+8
2015-05-30Auto merge of #25817 - XMPPwocky:once_cleanedup, r=alexcrichtonbors-0/+94
Closes #24443.
2015-05-29Rollup merge of #25861 - tringenbach:master, r=steveklabnikSteve Klabnik-6/+48
This adds an example from mem::swap, and provides some suggested uses of this function. This is my attempt to summarize the answers to a question I asked on reddit http://www.reddit.com/r/rust/comments/37jcul/what_is_forget_for/ and add the answers to the documentation so that no one else has to google or ask the question again.
2015-05-29Implement RFC 771: std::iter::onceNathaniel Theis-0/+94
2015-05-29Improve mem::forget documentationTim Ringenbach-6/+48
This adds an example from mem::swap, and provides some suggested uses of this function. Change wording on comment on forget line to be more specific as to why we need to call forget. This breaks the examples up into three pieces. The last piece isn't compiling for some reason.
2015-05-29Auto merge of #25830 - steveklabnik:debug_docs, r=alexcrichtonbors-0/+44
2015-05-29Auto merge of #25747 - SimonSapin:map_ref, r=alexcrichtonbors-4/+152
For slightly complex data structures like `rustc_serialize::json::Json`, it is often convenient to have helper methods like `Json::as_string(&self) -> Option<&str>` that return a borrow of some component of `&self`. However, when `RefCell`s are involved, keeping a `Ref` around is required to hold a borrow to the insides of a `RefCell`. But `Ref` so far only references the entirety of the contents of a `RefCell`, not a component. But there is no reason it couldn’t: `Ref` internally contains just a data reference and a borrow count reference. The two can be dissociated. This adds a `map_ref` function that creates a new `Ref` for some other data, but borrowing the same `RefCell` as an existing `Ref`. Example: ```rust struct RefCellJson(RefCell<Json>); impl RefCellJson { fn as_string(&self) -> Option<Ref<str>> { map_ref(self.borrow(), |j| j.as_string()) } } ``` r? @alexcrichton
2015-05-29Add map and filter_map associated functions to std::cell::Ref and RefMutSimon Sapin-1/+132
See design discussion in https://github.com/rust-lang/rust/pull/25747
2015-05-28Auto merge of #25744 - SimonSapin:cell-eq, r=alexcrichtonbors-2/+8
`core::cell::Cell<T>` and `core::cell::RefCell<T>` currently implement `PartialEq` when `T` does, and just defer to comparing `T` values. There is no reason the same shouldn’t apply to `Eq`. This enables `#[derive(Eq, PartialEq)]` on e.g. structs that have a `RefCell` field. r? @alexcrichton I’m unsure what to do with `#[stable]` attributes on `impl`s. `impl`s generated by `#[derive]` don’t have them.
2015-05-28Move std::cell::clone_ref to a clone associated function on std::cell::RefSimon Sapin-3/+20
... and generalize the bounds on the value type.
2015-05-28Improve Debug documentationSteve Klabnik-0/+44
2015-05-28Auto merge of #25843 - shepmaster:remove-public-int-and-uint, r=huonwbors-8/+0
2015-05-27Remove mentions of int / uint from the isize / usize docsJake Goulding-8/+0
2015-05-28Rollup merge of #25726 - nham:cell_docs, r=alexcrichtonManish Goregaokar-4/+4
Currently part of the description of the `into_inner` method of `UnsafeCell` seems backwards.
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-30/+24
2015-05-27Remove #[cfg(stage0)] items.Eduard Burtescu-81/+6
2015-05-25Auto merge of #25698 - mdinger:flat_map, r=steveklabnikbors-10/+9
I'm not sure why `core` is on but it's blocking the playpen. Doesn't seem to be needed but I'm not sure. It's not on the playpen template and playpen works on release and nightly. Seems easier to understand without `take()`.