about summary refs log tree commit diff
path: root/src/libcore/result.rs
AgeCommit message (Collapse)AuthorLines
2016-09-11Improve Result docggomez-36/+59
2016-09-03Indicate where `core::result::IntoIter` is created.Corey Farwell-1/+7
2016-08-24Use `#[prelude_import]` in `libcore`.Jeffrey Seyfried-7/+1
2016-08-18Add a FusedIterator trait.Steven Allen-0/+10
This trait can be used to avoid the overhead of a fuse wrapper when an iterator is already well-behaved. Conforming to: RFC 1581 Closes: #35602
2016-08-10Remove redundant `&mut ref mut` in doc for Result::as_mut()Georg Brandl-2/+2
2016-06-29Improve code example for try!Jupp Müller-1/+4
This change improves the code example for try!, avoiding to use try! in the example code that shows what code constructs try! can replace.
2016-04-11Rollup merge of #32854 - GuillaumeGomez:result_doc, r=steveklabnikSteve Klabnik-3/+44
Add some missing commas and missing titles/formatting Fixes #29373. r? @steveklabnik
2016-04-09Add some missing commas and missing titles/formattingGuillaume Gomez-3/+44
2016-03-20libcore: add Debug implementations to most missing typesSean McArthur-0/+3
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-1/+1
Fixes #9447
2016-02-23Register new snapshotsAaron Turon-2/+2
2016-01-22Move cold panic functions in Option and ResultUlrik Sverdrup-21/+9
Move functions out of their impl blocks; avoids unnecessary monomorphization by type parameters that are irrelevant to the message output.
2016-01-22Use cold functions for panic formatting Option::expect, Result::unwrap etcUlrik Sverdrup-6/+23
Option::expect, Result::unwrap, unwrap_err, expect These methods are marked inline, but insert a big chunk of formatting code, as well as other error path related code, such as deallocating a std::io::Error if you have one. We can explicitly separate out that code path into a function that is never inline, since the panicking case should always be rare.
2016-01-14Require stability annotations on fields of tuple variantsVadim Petrochenkov-2/+2
2015-12-10Auto merge of #30182 - alexcrichton:remove-deprecated, r=aturonbors-53/+0
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-53/+0
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-10fix missing Panics tag and missing periodLetheed-0/+2
2015-11-20Rename #[deprecated] to #[rustc_deprecated]Vadim Petrochenkov-2/+2
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+1
2015-11-12Auto merge of #29544 - Ryman:reduce_doc_warnings, r=steveklabnikbors-0/+6
Did this alphabetically, so I didn't see [how `std` was doing things](https://dxr.mozilla.org/rust/source/src/libstd/lib.rs#215) till I was nearly finished. If you prefer to add crate-level-whitelists like std instead of test-level, I can rebase with that strategy. A number of these commits can probably be dropped as the crates don't have much to test, and are deprecated. Let me know which if any to drop! (can also squash after review if desired) r? @steveklabnik
2015-11-12libcore: deny warnings in doctestsKevin Butler-0/+6
2015-11-12Fix article in Result.map and Result.map_err documentationDanilo Bargen-2/+2
2015-11-06Remove stability annotations from trait impl itemsVadim Petrochenkov-3/+0
Remove `stable` stability annotations from inherent impls
2015-11-01Stop using ok().expect() in Result docsFlorian Hartwig-4/+3
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-0/+2
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-09-16Simplify sample code for {Option, Result}::iter_mutAdolfo Ochagavía-1/+1
Fixes #28431
2015-09-11std: Stabilize/deprecate features for 1.4Alex Crichton-3/+4
The FCP is coming to a close and 1.4 is coming out soon, so this brings in the libs team decision for all library features this cycle. Stabilized APIs: * `<Box<str>>::into_string` * `Arc::downgrade` * `Arc::get_mut` * `Arc::make_mut` * `Arc::try_unwrap` * `Box::from_raw` * `Box::into_raw` * `CStr::to_str` * `CStr::to_string_lossy` * `CString::from_raw` * `CString::into_raw` * `IntoRawFd::into_raw_fd` * `IntoRawFd` * `IntoRawHandle::into_raw_handle` * `IntoRawHandle` * `IntoRawSocket::into_raw_socket` * `IntoRawSocket` * `Rc::downgrade` * `Rc::get_mut` * `Rc::make_mut` * `Rc::try_unwrap` * `Result::expect` * `String::into_boxed_slice` * `TcpSocket::read_timeout` * `TcpSocket::set_read_timeout` * `TcpSocket::set_write_timeout` * `TcpSocket::write_timeout` * `UdpSocket::read_timeout` * `UdpSocket::set_read_timeout` * `UdpSocket::set_write_timeout` * `UdpSocket::write_timeout` * `Vec::append` * `Vec::split_off` * `VecDeque::append` * `VecDeque::retain` * `VecDeque::split_off` * `rc::Weak::upgrade` * `rc::Weak` * `slice::Iter::as_slice` * `slice::IterMut::into_slice` * `str::CharIndices::as_str` * `str::Chars::as_str` * `str::split_at_mut` * `str::split_at` * `sync::Weak::upgrade` * `sync::Weak` * `thread::park_timeout` * `thread::sleep` Deprecated APIs * `BTreeMap::with_b` * `BTreeSet::with_b` * `Option::as_mut_slice` * `Option::as_slice` * `Result::as_mut_slice` * `Result::as_slice` * `f32::from_str_radix` * `f64::from_str_radix` Closes #27277 Closes #27718 Closes #27736 Closes #27764 Closes #27765 Closes #27766 Closes #27767 Closes #27768 Closes #27769 Closes #27771 Closes #27773 Closes #27775 Closes #27776 Closes #27785 Closes #27792 Closes #27795 Closes #27797
2015-08-27core: Implement IntoIterator for Option and Result referencesGeorg Brandl-0/+20
Fixes #27996.
2015-08-15core: Fill out issues for unstable featuresAlex Crichton-2/+4
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-33/+1
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-07-29Rollup merge of #27326 - steveklabnik:doc_show_use, r=GankroSteve Klabnik-1/+2
In spirit with https://internals.rust-lang.org/t/should-we-keep-including-obvious-imports-in-code-examples/2217, show the feature flags we're using in examples. (also one instance of 'use')
2015-07-27Show appropriate feature flags in docsSteve Klabnik-1/+2
2015-07-25Reference issue #27277 on Result::expectJohn Hodge-1/+1
2015-06-17std: Deprecate result::foldAlex Crichton-0/+3
This function has seen very little use and it seems better to explore this functionality through iterator adaptors instead of specialized functions.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-1/+1
2015-06-17core: Split apart the global `core` featureAlex Crichton-2/+3
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-15libcore/Result - RFC#1119 Add an 'expect' method to ResultJohn Hodge-0/+20
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-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-22/+0
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-19/+24
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-26/+0
Cleaning out more deprecated items
2015-04-20Improve doc for `Result::unwrap()`York Xiang-2/+2
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-19/+24
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-16Fix broken links in the docsFlorian Hartwig-2/+2
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-8/+8
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14rollup merge of #24303: alexcrichton/remove-deprecatedAlex Crichton-70/+52
This commit removes these long deprecated modules. Such a nice diff stat!
2015-04-14core: Update all Result docsAlex Crichton-70/+52
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-8/+8
2015-04-06Alter libcore::result example to utilize closure paramCorey Farwell-1/+1
Since it doesn't utilize the parameter, it's not very idiomatic since it could just use the `Result::or` method. So this changes the example to utilize the parameter. As far as I can tell, all the numbers in this example are completely arbitrary.
2015-04-06Remove unnecessary returns in API examplesCorey Farwell-3/+3