about summary refs log tree commit diff
path: root/src/libcore/option.rs
AgeCommit message (Collapse)AuthorLines
2015-05-31doc: fix displayed messageTshepang Lekhonkhobe-1/+1
2015-05-31doc: improve map_or and map_or_elseTshepang Lekhonkhobe-6/+8
2015-05-04Fix incorrect link in Option documentation.Lee Jeffery-1/+1
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-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-4/+4
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-21/+0
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.
2015-03-30Second attempt to fix #23713 based on follow-up comments in #23791.Julian Viereck-1/+1
2015-03-28Remove IteratorExtSteven Fackler-1/+1
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-1/+1
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-27rollup merge of #23791: jviereck/fix-23713Alex Crichton-1/+1
Fixes #23713.
2015-03-27Fix wording for Option<T>.unwrap. Fixes #23713Julian Viereck-1/+1
2015-03-27Test fixes and rebase conflicts, round 1Alex Crichton-1/+1
2015-03-27rollup merge of #23771: aturon/stab-straggle-1Alex Crichton-10/+7
Marks as `#[stable}`: * `ok_or` * `ok_or_else` * `iter_mut` * `cloned` Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to work only on `Option<&T>`. Thus, this is a: [breaking-change] r? @alexcrichton
2015-03-26Stabilize some stragglers in `std::option`Aaron Turon-10/+7
Marks as `#[stable}`: * `ok_or` * `ok_or_else` * `iter_mut` * `cloned` Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to work only on `Option<&T>`. Thus, this is a: [breaking-change]
2015-03-26syntax: Remove support for #[should_fail]Alex Crichton-2/+2
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-23rollup merge of #23598: brson/gateAlex Crichton-0/+4
Conflicts: src/compiletest/compiletest.rs src/libcollections/lib.rs src/librustc_back/lib.rs src/libserialize/lib.rs src/libstd/lib.rs src/libtest/lib.rs src/test/run-make/rustdoc-default-impl/foo.rs src/test/run-pass/env-home-dir.rs
2015-03-23Add generic conversion traitsAaron Turon-0/+17
This commit: * Introduces `std::convert`, providing an implementation of RFC 529. * Deprecates the `AsPath`, `AsOsStr`, and `IntoBytes` traits, all in favor of the corresponding generic conversion traits. Consequently, various IO APIs now take `AsRef<Path>` rather than `AsPath`, and so on. Since the types provided by `std` implement both traits, this should cause relatively little breakage. * Deprecates many `from_foo` constructors in favor of `from`. * Changes `PathBuf::new` to take no argument (creating an empty buffer, as per convention). The previous behavior is now available as `PathBuf::from`. * De-stabilizes `IntoCow`. It's not clear whether we need this separate trait. Closes #22751 Closes #14433 [breaking-change]
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+4
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-1/+1
2015-03-11Example -> ExamplesSteve Klabnik-23/+23
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-1/+1
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-1/+1
2015-02-18make FromIterator use IntoIteratorAlexis-3/+3
This breaks all implementors of FromIterator, as they must now accept IntoIterator instead of Iterator. The fix for this is generally trivial (change the bound, and maybe call into_iter() on the argument to get the old argument). Users of FromIterator should be unaffected because Iterators are IntoIterator. [breaking-change]
2015-02-17Rollup merge of #22111 - robinst:option-docs-flatmap, r=steveklabnikManish Goregaokar-0/+2
Some newcomers might look for a "flatMap" method on Option. Include the reference so that searching the page would find "and_then".
2015-02-17Rollup merge of #22294 - nikomatsakis:integer-audit, r=huonwManish Goregaokar-28/+28
cc https://github.com/rust-lang/rust/issues/22240
2015-02-15Change arbirary types from `usize` to `u32`.Niko Matsakis-13/+13
2015-02-15Include "flatmap" in docs of Option::and_thenRobin Stocker-0/+2
Some newcomers might look for a "flatMap" method on Option. Include the reference so that searching the page would find "and_then".
2015-02-13Audit integer type usage in `core::option`Niko Matsakis-28/+28
2015-02-13Add link to module-level Option documentation.Steve Klabnik-1/+1
2015-01-30std: Stabilize FromStr and parseAlex Crichton-2/+2
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-31/+31
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2015-01-25Moving away from deprecated i/u suffixes in libcoreAlfie John-31/+31
2015-01-23grandfathered -> rust1Brian Anderson-40/+40
2015-01-23Set unstable feature names appropriatelyBrian Anderson-6/+6
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-6/+6
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-46/+50
2015-01-13Remove unneeded box import in examplesChase Southwood-1/+0
2015-01-08Improvements to feature stagingBrian Anderson-2/+2
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07Test fixes and rebase conflictsAlex Crichton-2/+2
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-1/+1
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07fix the `&mut _` patternsJorge Aparicio-1/+1
2015-01-07std: Tweak String implementationsAlex Crichton-6/+6
This commit performs a pass over the implementations of the new `String` trait in the formatting module. Some implementations were removed as a conservative move pending an upcoming convention about `String` implementations, and some were added in order to retain consistency across the libraries. Specifically: * All "smart pointers" implement `String` now, adding missing implementations for `Arc` and `Rc`. * The `Vec<T>` and `[T]` types no longer implement `String`. * The `*const T` and `*mut T` type no longer implement `String`. * The `()` type no longer implements `String`. * The `Path` type's `Show` implementation does not surround itself with `Path {}` (a minor tweak). All implementations of `String` in this PR were also marked `#[stable]` to indicate that the types will continue to implement the `String` trait regardless of what it looks like.
2015-01-06More test fixesAlex Crichton-1/+1
2015-01-05Revert "Remove i suffix in docs"Alex Crichton-6/+6
This reverts commit f031671c6ea79391eeb3e1ad8f06fe0e436103fb. Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-05rollup merge of #20560: aturon/stab-2-iter-ops-sliceAlex Crichton-0/+9
Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-05Remove i suffix in docsSteve Klabnik-6/+6
2015-01-05Stabilization of impls and fallout from stabilizationAaron Turon-0/+9
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-2/+2