summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2016-04-12std: Stabilize APIs for the 1.9 releaseAlex Crichton-51/+84
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-07Rollup merge of #32741 - tbu-:pr_remove_fixme_12808, r=blussManish Goregaokar-39/+35
Remove strange names created by lack of privacy-conscious name lookup The fixed issue that allowed this was #12808.
2016-04-07Rollup merge of #32757 - taralx:patch-1, r=brsonManish Goregaokar-12/+12
Fix typos in atomic compare_exchange. Failure ordering can't be Release, not (not) Acquire. Seems like a typo copy-pasted all over.
2016-04-07Rollup merge of #32699 - bluss:slice-memcmp, r=alexcrichtonManish Goregaokar-38/+143
Specialize equality for [T] and comparison for [u8] to use memcmp when possible Specialize equality for [T] and comparison for [u8] to use memcmp when possible Where T is a type that can be compared for equality bytewise, we can use memcmp. We can also use memcmp for PartialOrd, Ord for [u8]. Use specialization to call memcmp in PartialEq for slices for certain element types. This PR does not change the user visible API since the implementation uses an intermediate trait. See commit messages for more information. The memcmp signature was changed from `*const i8` to `*const u8` which is in line with how the memcmp function is defined in C (taking const void * arguments, interpreting the values as unsigned bytes for purposes of the comparison).
2016-04-06slice: Use doc(hidden) on private traitsUlrik Sverdrup-0/+4
This should avoid the trait impls showing up in rustdoc.
2016-04-06avoid "==" in assert! when one of the values is a boolTshepang Lekhonkhobe-2/+2
2016-04-05Fix typos in atomic compare_exchange.JP Sugarbroad-12/+12
2016-04-05Specialize equality for [T] and comparison for [u8]Ulrik Sverdrup-38/+139
Where T is a type that can be compared for equality bytewise, we can use memcmp. We can also use memcmp for PartialOrd, Ord for [u8] and by extension &str. This is an improvement for example for the comparison [u8] == [u8] that used to emit a loop that compared the slices byte by byte. One worry here could be that this introduces function calls to memcmp in contexts where it should really inline the comparison or even optimize it out, but llvm takes care of recognizing memcmp specifically.
2016-04-05Remove strange names created by lack of privacy-conscious name lookupTobias Bucher-39/+35
The fixed issue that allowed this was #12808.
2016-04-03Auto merge of #32672 - ollie27:patch-5, r=alexcrichtonbors-2/+2
Fix a couple of dead links on core::num::ParseFloatError docs
2016-04-01Fix a couple of dead links on core::num::ParseFloatError docsOliver Middleton-2/+2
2016-04-02Rollup merge of #32652 - VFLashM:refcell_ref_coercion, r=alexcrichtonManish Goregaokar-2/+8
Added missing refcell ref/refmut coercions to unsized Ref/RefMut should be coercible to unsized. This commit adds a unit test and two missing CoerceUnsized implementations.
2016-04-01Rollup merge of #32642 - Amanieu:doc_fixes, r=apasel422Manish Goregaokar-1/+1
Fix formatting in the documentation for AtomicIsize::compare_exchange_weak
2016-03-31Auto merge of #32550 - tbu-:pr_ref_cell_as_unsafe_cell, r=alexcrichtonbors-6/+2
Remove `unsafe` qualifier from `RefCell::as_unsafe_cell` This method is no longer unsafe because the field of `UnsafeCell` is no longer public.
2016-03-31added missing refcell ref/refmut coercions to unsizedВалерий Лашманов-2/+8
2016-03-31Fix formatting in the documentation for AtomicIsize::compare_exchange_weakAmanieu d'Antras-1/+1
2016-03-30Rollup merge of #32580 - durka:patch-17, r=steveklabnikSteve Klabnik-10/+10
verb agreement in core::convert docs
2016-03-29verb agreement in core::convert docsAlex Burka-10/+10
2016-03-29Auto merge of #32564 - frewsxcv:patch-27, r=alexcrichtonbors-1/+1
Prefer HTTPS when linking to 131002.net.
2016-03-28Auto merge of #32438 - kamalmarhubi:intoiterator-example, r=steveklabnikbors-6/+6
style: Use `iter` for IntoIterator parameter names This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-28Auto merge of #32461 - mitaa:rdoc-anchors, r=alexcrichtonbors-2/+2
rustdoc: Correct anchor for links to associated trait items fixes #28478 r? @alexcrichton
2016-03-28Prefer HTTPS when linking to 131002.net.Corey Farwell-1/+1
2016-03-28Add doc examples on pointer typesGuillaume Gomez-0/+85
2016-03-28style: Use `iter` for IntoIterator parameter namesKamal Marhubi-6/+6
This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-28Remove `unsafe` qualifier from `RefCell::as_unsafe_cell`Tobias Bucher-6/+2
This method is no longer unsafe because the field of `UnsafeCell` is no longer public.
2016-03-27Extend linkchecker with anchor checkingmitaa-2/+2
This adds checks to ensure that: * link anchors refer to existing id's on the target page * id's are unique within an html document * page redirects are valid
2016-03-26Rollup merge of #32456 - bluss:str-zero, r=alexcrichtonManish Goregaokar-1/+5
Hardcode accepting 0 as a valid str char boundary If we check explicitly for index == 0, that removes the need to read the byte at index 0, so it avoids a trip to the string's memory, and it optimizes out the slicing index' bounds check whenever it is (a constant) zero.
2016-03-24Auto merge of #32396 - nodakai:range-contains, r=alexcrichtonbors-6/+208
Add core::ops::Range*::contains() as per rust-lang/rust#32311
2016-03-24Rollup merge of #32464 - GuillaumeGomez:patch-6, r=steveklabnikSteve Klabnik-7/+3
Improve some Option code example Part of #29366. r? @steveklabnik
2016-03-24Rollup merge of #32416 - GuillaumeGomez:patch-3, r=steveklabnikSteve Klabnik-0/+23
Add doc example to clone trait Fixes #29346. r? @steveklabnik
2016-03-24Improve some Option code exampleGuillaume Gomez-7/+3
2016-03-24Add core::ops::Range*::contains() as per rust-lang/rust#32311NODA, Kai-6/+208
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-03-24Accept 0 as a valid str char boundaryUlrik Sverdrup-1/+4
Index 0 must be a valid char boundary (invariant of str that it contains valid UTF-8 data). If we check explicitly for index == 0, that removes the need to read the byte at index 0, so it avoids a trip to the string's memory, and it optimizes out the slicing index' bounds check whenever it is zero. With this change, the following examples all change from having a read of the byte at 0 and a branch to possibly panicing, to having the bounds checking optimized away. ```rust pub fn split(s: &str) -> (&str, &str) { s.split_at(0) } pub fn both(s: &str) -> &str { &s[0..s.len()] } pub fn first(s: &str) -> &str { &s[..0] } pub fn last(s: &str) -> &str { &s[0..] } ```
2016-03-23Mark str::split_at inlineUlrik Sverdrup-0/+1
2016-03-22sprinkle feature gates here and thereJorge Aparicio-0/+1
2016-03-22try! -> ?Jorge Aparicio-32/+32
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-84/+132
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-03-22Add doc example to clone traitGuillaume Gomez-0/+23
2016-03-21Rollup merge of #32322 - GuillaumeGomez:cmp_doc, r=steveklabnikSteve Klabnik-0/+35
Add doc examples Fixes #29347 r? @steveklabnik
2016-03-21Auto merge of #32054 - seanmonstar:impl-debug-core, r=alexcrichtonbors-34/+319
libcore: add Debug implementations to most missing types Also adds `#![deny(missing_debug_implementations)]` to the core crate. cc #31869
2016-03-20Update snapshots to 2016-03-18 (235d774).Eduard Burtescu-53/+39
2016-03-20libcore: add Debug implementations to most missing typesSean McArthur-34/+319
2016-03-19Auto merge of #32244 - Amanieu:compare_exchange_result, r=alexcrichtonbors-87/+134
Change compare_exchange to return a Result<T, T> As per the discussion in #31767 I also changed the feature name from `extended_compare_and_swap` to `compare_exchange`. r? @alexcrichton
2016-03-19Change compare_exchange to return a Result<T, T>Amanieu d'Antras-87/+134
2016-03-18Add intrinsics for float arithmetic with `fast` flag enabledUlrik Sverdrup-0/+26
`fast` a.k.a UnsafeAlgebra is the flag for enabling all "unsafe" (according to llvm) float optimizations. See LangRef for more information http://llvm.org/docs/LangRef.html#fast-math-flags Providing these operations with less precise associativity rules (for example) is useful to numerical applications. For example, the summation loop: let sum = 0.; for element in data { sum += *element; } Using the default floating point semantics, this loop expresses the floats must be added in a sequence, one after another. This constraint is usually completely unintended, and it means that no autovectorization is possible.
2016-03-18Add doc examplesGuillaume Gomez-0/+35
2016-03-17Add #[rustc_no_mir] to make tests pass with -Z orbit.Eduard Burtescu-0/+4
2016-03-12std: Clean out deprecated APIsAlex Crichton-383/+13
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-11std: Add a tracking issue for Peekable::is_emptyAlex Crichton-1/+1
The listed tracking issue was hooked up to the wrong location by accident.
2016-03-11core: Make a new tracking issue for prelude traitsAlex Crichton-7/+7
The referenced issues here were both closed, so hook up a new issue which tracks specifically the prelude traits being unstable.