about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-01-01auto merge of #19388 : nick29581/rust/rc-show, r=alexcrichtobors-0/+11
r? @huonw or @alexcrichton Apparently, we have previously rejected an RFC like this. However, since then we removed `{:?}` and so without this debugging gets really difficult as soon as there is a RefCell anywhere, so I believe there is more benefit to adding these impls than there was before. By using "try_borrow" we can avoid panicing in `Show` (I think). @ huon in response to a comment in #19254: I noticed that `drop()` checks for the ptr being null, so I checked here too. Now I am checking for both, if you're confident I can change to only checking `strong()`.
2015-01-01Add some impls of Show (RefCell, Weak, some resolve types)Nick Cameron-0/+11
2014-12-31core: unbox closures used in let bindingsJorge Aparicio-3/+3
2014-12-31Remove core::iter::MinMaxResult::* public reexportCorey Farwell-3/+3
Part of #19253 [breaking-change]
2014-12-30rollup merge of #20061: aturon/stab-2-vec-sliceAlex Crichton-175/+252
Conflicts: src/libcollections/slice.rs src/libcollections/vec.rs src/libstd/sys/windows/os.rs
2014-12-30Fallout from stabilizationAaron Turon-3/+5
2014-12-30rollup merge of #20353: alexcrichton/snapshotsAlex Crichton-295/+0
2014-12-30rollup merge of #20348: frewsxcv/rm-reexportsAlex Crichton-1/+1
Part of #19253 [breaking-change]
2014-12-30rollup merge of #20328: huonw/attack-of-the-clonesAlex Crichton-1/+4
It's useful to be able to save state.
2014-12-30Register new snapshotsAlex Crichton-295/+0
2014-12-30Stabilize cmpAaron Turon-71/+125
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as `#[stable]`, as well as the majorify of manual implementaitons of these traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439). Along the way, two changes are made: * The recently-added type parameters for `Ord` and `Eq` are removed. These were mistakenly added while adding them to `PartialOrd` and `PartialEq`, but they don't make sense given the laws that are required for (and use cases for) `Ord` and `Eq`. * More explicit laws are added for `PartialEq` and `PartialOrd`, connecting them to their associated mathematical concepts. In the future, many of the impls should be generalized; see since generalizing later is not a breaking change. [breaking-change]
2014-12-30Adjustments from reviewAaron Turon-3/+7
2014-12-30Second pass stabilization: sliceAaron Turon-159/+169
This commit takes a second pass through the `slice` module to stabilize its API. The changes are as follows: **Stable**: * `as_mut_slice` * `as_ptr`, `as_mut_ptr` * `binary_search_by` (was: `binary_search`) * `binary_search` (was: `binary_search_elem`) * `chunks`, `chunks_mut` * `contains` * `ends_with` * `first`, `first_mut` (was: `head`) * `get_unchecked`, `get_unchecked_mut` (was: `unsafe_get`) * `get` * `is_empty` * `iter`, `iter_mut` * `len` * `reverse` * `sort_by` * `sort` * `split_at`, `split_at_mut` * `split_mut`, `splitn_mut`, `rsplitn_mut` * `split`, `splitn`, `rsplitn` * `starts_with` * `swap` * `to_vec` * `windows` **Deprecated**: * `head`, `head_mut` (renamed as above) * `unsafe_get`, `unsafe_mut` (renamed as above) * `binary_search_elem` (renamed as above) * `partitioned`, deprecated in favor of a new, more general iterator consumer called `partition`. * `BinarySearchResult`, deprecated in favor of `Result<uint, uint>` [breaking-change]
2014-12-30std::iter: Add partition and unzip methods to iteratorsAaron Turon-16/+77
2014-12-30Remove core::atomic::Ordering::* public reexportCorey Farwell-1/+1
Part of #19253 [breaking-change]
2014-12-30Implement `Clone` for a large number of iterators & other adaptors.Huon Wilson-1/+4
It's useful to be able to save state.
2014-12-29rollup merge of #20309: sfackler/refcell-sendAlex Crichton-5/+7
Also get rid of NoSync markers since UnsafeCell is now not Sync r? @alexcrichton
2014-12-29rollup merge of #20239: YawarRaza7349/patch-1Alex Crichton-1/+1
2014-12-29rollup merge of #20195: nagisa/unused-typoAlex Crichton-1/+1
2014-12-29rollup merge of #20191: lifthrasiir/double-debug_assertAlex Crichton-11/+1
Yes, really. That definition wouldn't work anyway. This also fixes repeated entries for `debug_assert!` from libcore docs. Maybe we should warn such macro definitions in the first place?
2014-12-29rollup merge of #20160: nick29581/ranges2Alex Crichton-13/+23
The first six commits are from an earlier PR (#19858) and have already been reviewed. This PR makes an awful hack in the compiler to accommodate slices both natively and in the index a range form. After a snapshot we can hopefully add the new Index impls and then we can remove these awful hacks. r? @nikomatsakis (or anyone who knows the compiler, really)
2014-12-30Fallout from mut slicesNick Cameron-11/+13
2014-12-30Remove ExprSlice by hacking the compilerNick Cameron-2/+2
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-30Add hypothetical support for ranges with only an upper boundNick Cameron-0/+8
Note that this doesn't add the surface syntax.
2014-12-29std: Second pass stabilization for `ptr`Alex Crichton-59/+92
This commit performs a second pass for stabilization over the `std::ptr` module. The specific actions taken were: * The `RawPtr` trait was renamed to `PtrExt` * The `RawMutPtr` trait was renamed to `MutPtrExt` * The module name `ptr` is now stable. * These functions were all marked `#[stable]` with no modification: * `null` * `null_mut` * `swap` * `replace` * `read` * `write` * `PtrExt::is_null` * `PtrExt::offset` * These functions remain unstable: * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive as null isn't the only bad value, and it's unclear whether we want to commit to these functions at this time. The reference/lifetime semantics as written are also problematic in how they encourage arbitrary lifetimes. * `zero_memory` - This function is currently not used at all in the distribution, and in general it plays a broader role in the "working with unsafe pointers" story. This story is not yet fully developed, so at this time the function remains unstable for now. * `read_and_zero` - This function remains unstable for largely the same reasons as `zero_memory`. * These functions are now all deprecated: * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead. * `PtrExt::to_uint` - use an `as` expression instead. * `PtrExt::is_not_null` - use `!p.is_null()` instead.
2014-12-29Implement Send for Cell and RefCellSteven Fackler-5/+7
Also get rid of NoSync markers since UnsafeCell is now not Sync
2014-12-29auto merge of #20058 : Kimundi/rust/str_pattern_pre, r=alexcrichtonbors-84/+164
This stabilizes most methods on `&str` working with patterns in a way that is forwards-compatible with a generic string pattern matching API: - Methods that are using the primary name for their operation are marked as `#[stable]`, as they can be upgraded to a full `Pattern` API later without existing code breaking. Example: `contains(&str)` - Methods that are using a more specific name in order to not clash with the primary one are marked as `#[unstable]`, as they will likely be removed once their functionality is merged into the primary one. Example: `contains_char<C: CharEq>(C)` - The method docs got changed to consistently refer to the pattern types as a pattern. - Methods whose names do not match in the context of the more generic API got renamed. Example: `trim_chars -> trim_matches` Additionally, all methods returning iterators got changed to return unique new types with changed names in accordance with the new naming guidelines. See also https://github.com/rust-lang/rfcs/pull/528 Due to some deprecations and type changes, this is a [breaking-change]
2014-12-29std: Stabilize the prelude moduleAlex Crichton-55/+59
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-28libcoretest: Add tests for NonZero.Luqman Aden-38/+0
2014-12-28libcore: Use Zeroable trait to try to limit what types may be used with NonZero.Luqman Aden-3/+57
2014-12-28libcore: Don't impl RawPtr* traits for NonZero.Luqman Aden-62/+1
2014-12-28Don't expose NonZero through libstd.Luqman Aden-88/+100
2014-12-28libcore: Make it unsafe to create NonZero and impl Deref.Luqman Aden-3/+21
2014-12-28libcore: Add NonZero lang item and implement some methods.Luqman Aden-0/+70
2014-12-27Fallout of changing format_args!(f, args) to f(format_args!(args)).Eduard Burtescu-3/+169
2014-12-26Rename `UniquePtr` to `Unique`Flavio Percoco-12/+12
Mostly following the convention in RFC 356
2014-12-26Move RacyCell to `std::comm`Flavio Percoco-38/+23
RacyCell is not exactly what we'd like as a final implementation for this. Therefore, we're moving it under `std::comm` and also making it private.
2014-12-26Make Send and Sync traits unsafeFlavio Percoco-6/+6
2014-12-26Rename `OwnedPtr` to `UniquePtr`Flavio Percoco-12/+12
2014-12-26Require types to opt-in SyncFlavio Percoco-13/+71
2014-12-26Fixed minor typo in docs for `Result`'s `err` methodYawarRaza7349-1/+1
2014-12-25Prepared most `StrExt` pattern using methods for stabilizationMarvin Löbel-84/+164
Made iterator-returning methods return newtypes Adjusted some docs to be forwards compatible with a generic pattern API
2014-12-25Parse fully-qualified associated types in generics without whitespaceP1start-8/+8
This breaks code that looks like this: let x = foo as bar << 13; Change such code to look like this: let x = (foo as bar) << 13; Closes #17362. [breaking-change]
2014-12-24Fix a typoSimonas Kazlauskas-1/+1
2014-12-24core: Removed a shadowed, unused definition of `debug_assert!`.Kang Seonghoon-11/+1
2014-12-24auto merge of #19858 : nick29581/rust/ranges, r=aturonbors-1/+135
Closes #19794 r? @aturon for the first patch r? @nikomatsakis for the rest
2014-12-24Review changesNick Cameron-59/+77
2014-12-24Add lang items for ranges.Nick Cameron-0/+3
2014-12-24Add structs for ranges to core::ops.Nick Cameron-1/+114
2014-12-23Rename and namespace `FPCategory`Tobias Bucher-31/+31
Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the naming convention This is a [breaking-change]. Existing code like this: ``` use std::num::{FPCategory, FPNaN}; ``` should be adjusted to this: ``` use std::num::FpCategory as Fp ``` In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.