about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2016-03-04Rollup merge of #32036 - Seeker14491:patch-1, r=steveklabnikSteve Klabnik-1/+1
To me it was unclear whether 'it' referred to the fold function, or the closure.
2016-03-04Rollup merge of #32035 - ubsan:master, r=blussSteve Klabnik-2/+0
Just take out the `NOTE` and the `#[allow(improper_ctypes)]`
2016-03-04make skip a double ended iteratorOliver Schneider-0/+11
2016-03-04Clarify ambiguous wording in fold() docsBrian Bowman-1/+1
To me it was unclear whether 'it' referred to the fold function, or the closure.
2016-03-03`usize` is now a proper ctype, so fix cmp_sliceubsan-2/+0
2016-03-02Rollup merge of #31999 - bluss:fundamental-raw-ptr, r=eddybManish Goregaokar-5/+5
Use raw pointer casts for slice, str's .as_ptr() We can now use raw pointer casts `*const [T] as *const T` and `*const str as *const u8` instead of .repr() for getting the pointer out of a slice.
2016-03-02Rollup merge of #31989 - Kimundi:more_flexible_str_pattern_indirection, r=blussManish Goregaokar-1/+1
This allows a bit more flexibility in how to use it, see the included test case.
2016-03-02Rollup merge of #31982 - apasel422:sync, r=alexcrichtonManish Goregaokar-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others. r? @alexcrichton
2016-03-01Explicitly opt out of `Sync` for `cell` and `mpsc` typesAndrew Paseltiner-0/+6
These types were already `!Sync`, but this improves error messages when they are used in contexts that require `Sync`, aligning them with conventions used with `Rc`, among others.
2016-03-01Use raw pointer casts for slice, str's .as_ptr()Ulrik Sverdrup-5/+5
We can now use raw pointer casts `*const [T] as *const T` and `*const str as *const u8` instead of .repr() for getting the pointer out of a slice.
2016-03-01Rollup merge of #31965 - miqid:doc, r=steveklabnikSteve Klabnik-12/+12
Hello. Quite a few of the links in the `core` module concerning redirection to additional primitive type documentation are broken. I noticed in #30214 that there seemed to be a consensus with linking across to `std` module documentation from the `core` module. This is what I've done with the `core` modules for primitive types. If the changes here are good to go forward with, I'll happily tend to adding more documentation links for the extension traits in the aforementioned issue if need be. r? @steveklabnik
2016-03-01Changed `std::pattern::Pattern` impl on `&'a &'a str` to `&'a &'b str`Marvin Löbel-1/+1
in order to allow a bit more felixibility in how to use it.
2016-03-01Fix broken links for core primitivesMichael Huynh-12/+12
Redirects existing links for more details on primitive types in the `core` module to the ones that exist in the `std` module.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-67/+44
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-27Auto merge of #31942 - bluss:iter-desugar, r=steveklabnikbors-1/+1
Make for loop desugaring for iterators more precise The UFCS call IntoIterator::into_iter() is used by the for loop.
2016-02-27Make for loop desugaring for iterators more preciseUlrik Sverdrup-1/+1
The UFCS call IntoIterator::into_iter() is used by the for loop.
2016-02-27update snapshot commentsAlex Burka-4/+4
2016-02-27fix underflow in DoubleEndedIterator::next_backAlex Burka-5/+9
2016-02-27add indexing with RangeInclusive in libcore and libcollectionsAlex Burka-4/+107
2016-02-27add StepBy for RangeInclusiveAlex Burka-4/+108
2016-02-27note work still to be doneAlex Burka-6/+12
In particular, uses of inclusive ranges within the standard library are still waiting. Slices and collections can be sliced with `usize` and `Range*<usize>`, but not yet `Range*Inclusive<usize>`. Also, we need to figure out what to do about `RangeArgument`. Currently it has `start()` and `end()` methods which are pretty much identical to `Range::start` and `Range::end`. For the same reason as Range itself, these methods can't express a range such as `0...255u8` without overflow. The easiest choice, it seems to me, is either changing the meaning of `end()` to be inclusive, or adding a new method, say `last()`, that is inclusive and specifying that `end()` returns `None` in cases where it would overflow. Changing the semantics would be a breaking change, but `RangeArgument` is unstable so maybe we should do it anyway.
2016-02-27remove range lang itemsAlex Burka-4/+4
The range desugaring does not use the lang items. Hence I did not add lang items for inclusive ranges. This cleanup commit removes the old unused ones as well. Whether the desugaring _should_ use lang items is another question: see #30809. But if we decide on a strategy there we can add back these lang items, and new ones for inclusive ranges. For stage0 we need to keep the attributes as the lang items still exist even if they are never used. This is surprisingly not a breaking change. Unused #[lang] attributes do not even trigger a lint (see #30881).
2016-02-27core: add inclusive ranges to core::opsAlex Burka-90/+167
Since it removes the old iter::{range_inclusive, RangeInclusive} which were unstable and deprecated, this is a [breaking-change] on nightly.
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-2/+2
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26Auto merge of #31834 - ubsan:copy_from_slice, r=alexcrichtonbors-1/+13
implements rust-lang/rfcs#1419 r? alexcrichton
2016-02-25Add unstable copy_from_sliceNicholas Mazzuca-1/+13
2016-02-24Auto merge of #31778 - aturon:snapshot, r=alexcrichtonbors-6/+3
r? @alexcrichton
2016-02-23Register new snapshotsAaron Turon-6/+3
2016-02-22Auto merge of #30969 - Amanieu:extended_atomic_cmpxchg, r=alexcrichtonbors-9/+453
This is an implementation of rust-lang/rfcs#1443.
2016-02-22Correct Iterator trait documentationMichael Huynh-7/+7
Fixes several minor spelling errors and includes a suggested style fix.
2016-02-21Auto merge of #31761 - Amanieu:volatile, r=alexcrichtonbors-0/+48
Tracking issue: #31756 RFC: rust-lang/rfcs#1467 I've made these unstable for now. Should they be stabilized straight away since we've had plenty of experience with people using the unstable intrinsics?
2016-02-19Auto merge of #31736 - bluss:write-char, r=alexcrichtonbors-0/+4
fmt: Make sure write_fmt's implementation can use write_char It looks like the Adapter inside write_fmt was never updated to forward the write_char method.
2016-02-18Add compare_exchange and compare_exchange_weak to atomic typesAmanieu d'Antras-9/+426
2016-02-18Implement read_volatile and write_volatileAmanieu d'Antras-0/+48
2016-02-18Add intrinsics for compare_exchange and compare_exchange_weakAmanieu d'Antras-0/+27
2016-02-17fmt: Make sure write_fmt's implementation can use write_charUlrik Sverdrup-0/+4
It looks like the Adapter inside write_fmt was never updated to forward the write_char method.
2016-02-16Improve 'std::mem::transmute_copy' doc example.Corey Farwell-2/+18
Prior to this commit, it was a trivial example that did not demonstrate the effects of using the function. Fixes https://github.com/rust-lang/rust/issues/31094
2016-02-15Auto merge of #31663 - nodakai:cleanup-uint_module, r=alexcrichtonbors-7/+7
2016-02-15libcore/num: Remove unused macro argument.NODA, Kai-7/+7
It is no longer necessary after dd0d495f50e2d8ba501e6b003cb4c1ef52d95ed5 Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-02-14Rollup merge of #31655 - ollie27:patch-4, r=steveklabnikSteve Klabnik-5/+5
r? @steveklabnik
2016-02-14Rollup merge of #31607 - steveklabnik:gh31599, r=brsonSteve Klabnik-2/+1
Fixes #31599
2016-02-14Fix a couple of issues in from_utf8 docsOliver Middleton-3/+3
2016-02-14Fix doc error for Utf8ErrorOliver Middleton-1/+1
2016-02-14Fix signed int checked_neg docsOliver Middleton-1/+1
2016-02-14Remove incorrect documentationSteve Klabnik-2/+1
Fixes #31599
2016-02-14Rollup merge of #31535 - ↵Manish Goregaokar-0/+14
Ketsuban:more-detail-in-wrapping-shift-documentation, r=steveklabnik `wrapping_shl` and `wrapping_shr` are easy to mistake for rotations, when in fact they work somewhat differently. The documentation currently available is a little sparse and easy to misinterpret, so I've added a warning to anyone who bumps into them that the equivalent rotate methods may actually be what they're looking for. If it's deemed useful to add a symmetrical mention to the documentation for the `rotate_left` and `rotate_right` methods, I can certainly have a go at that, but my gut feeling is that people likely to want a rotate will already know about the wrapping-arithmetic methods, for example from writing CPU simulators.
2016-02-11bootstrap: Add a bunch of Cargo.toml filesAlex Crichton-0/+9
These describe the structure of all our crate dependencies.
2016-02-11Auto merge of #31479 - kamalmarhubi:fmt-pointer-unsized, r=alexcrichtonbors-5/+5
This allows printing pointers to unsized types with the {:p} formatting directive. The following impls are extended to unsized types: - impl<'a, T: ?Sized> Pointer for &'a T - impl<'a, T: ?Sized> Pointer for &'a mut T - impl<T: ?Sized> Pointer for *const T - impl<T: ?Sized> Pointer for *mut T - impl<T: ?Sized> fmt::Pointer for Box<T> - impl<T: ?Sized> fmt::Pointer for Rc<T> - impl<T: ?Sized> fmt::Pointer for Arc<T>
2016-02-10Note rotate_{left,right} in wrapping_sh{lr} docsThomas Winwood-0/+14
2016-02-09Rollup merge of #31520 - steveklabnik:doc_num, r=alexcrichtonSteve Klabnik-1/+19
This commit does two things: * Re-works the module-level documentation. * Cleaning up wording and adding links to where error types are used. Part of #29364