about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2014-05-13core: Move Hangul decomposition into unicode.rsFlorian Zeitz-50/+52
2014-05-13core: Use appropriately sized integers for codepoints and bytesFlorian Zeitz-50/+45
2014-05-13std, core: Generate unicode.rs using unicode.pyFlorian Zeitz-4/+7
2014-05-13std: Move the owned module from core to stdAlex Crichton-93/+95
The compiler was updated to recognize that implementations for ty_uniq(..) are allowed if the Box lang item is located in the current crate. This enforces the idea that libcore cannot allocated, and moves all related trait implementations from libcore to libstd. This is a breaking change in that the AnyOwnExt trait has moved from the any module to the owned module. Any previous users of std::any::AnyOwnExt should now use std::owned::AnyOwnExt instead. This was done because the trait is intended for Box traits and only Box traits. [breaking-change]
2014-05-12Improved example code in OptionAdolfo OchagavĂ­a-12/+15
2014-05-12libcore: remove fails from slice.rs and remove duplicated length checkingKevin Butler-24/+35
core::slice::raw::{shift_ptr,pop_ptr} now returns Option<*T> rather than *T. They no longer fail on empty slices. [breaking-change]
2014-05-12Add the patch number to version strings. Closes #13289Brian Anderson-1/+1
2014-05-12register snapshotsDaniel Micay-16/+0
2014-05-11core: Remove the cast moduleAlex Crichton-189/+165
This commit revisits the `cast` module in libcore and libstd, and scrutinizes all functions inside of it. The result was to remove the `cast` module entirely, folding all functionality into the `mem` module. Specifically, this is the fate of each function in the `cast` module. * transmute - This function was moved to `mem`, but it is now marked as #[unstable]. This is due to planned changes to the `transmute` function and how it can be invoked (see the #[unstable] comment). For more information, see RFC 5 and #12898 * transmute_copy - This function was moved to `mem`, with clarification that is is not an error to invoke it with T/U that are different sizes, but rather that it is strongly discouraged. This function is now #[stable] * forget - This function was moved to `mem` and marked #[stable] * bump_box_refcount - This function was removed due to the deprecation of managed boxes as well as its questionable utility. * transmute_mut - This function was previously deprecated, and removed as part of this commit. * transmute_mut_unsafe - This function doesn't serve much of a purpose when it can be achieved with an `as` in safe code, so it was removed. * transmute_lifetime - This function was removed because it is likely a strong indication that code is incorrect in the first place. * transmute_mut_lifetime - This function was removed for the same reasons as `transmute_lifetime` * copy_lifetime - This function was moved to `mem`, but it is marked `#[unstable]` now due to the likelihood of being removed in the future if it is found to not be very useful. * copy_mut_lifetime - This function was also moved to `mem`, but had the same treatment as `copy_lifetime`. * copy_lifetime_vec - This function was removed because it is not used today, and its existence is not necessary with DST (copy_lifetime will suffice). In summary, the cast module was stripped down to these functions, and then the functions were moved to the `mem` module. transmute - #[unstable] transmute_copy - #[stable] forget - #[stable] copy_lifetime - #[unstable] copy_mut_lifetime - #[unstable] [breaking-change]
2014-05-10initial port of the exchange allocator to jemallocDaniel Micay-3/+5
In stage0, all allocations are 8-byte aligned. Passing a size and alignment to free is not yet implemented everywhere (0 size and 8 align are used as placeholders). Fixing this is part of #13994. Closes #13616
2014-05-10add an align parameter to exchange_mallocDaniel Micay-5/+21
Closes #13094
2014-05-10auto merge of #14073 : alexcrichton/rust/snapshots, r=huonwbors-2/+2
2014-05-10auto merge of #14068 : alexcrichton/rust/rustdoc-xcrate-links, r=brsonbors-1/+1
This should improve the libcore experience quite a bit when looking at the libstd documentation.
2014-05-09Register new snapshotsAlex Crichton-2/+2
2014-05-09doc: Fix some broken linksAlex Crichton-1/+1
2014-05-09auto merge of #14053 : FlaPer87/rust/master, r=huonwbors-0/+1
This patch allows for using derivings for `kinds` in libcore r? @alexcrichton
2014-05-08auto merge of #14019 : brson/rust/docs, r=alexcrichtonbors-44/+24
Just small bits of polish.
2014-05-09core: Allow kinds derivingsFlavio Percoco-0/+1
2014-05-08Handle breakage after libcore splitKevin Ballard-3/+33
API Changes: - &[T] and ~[T] no longer support the addition operator (+)
2014-05-08Handle fallout in documentationKevin Ballard-55/+56
Tweak the tutorial's section on vectors and strings, to slightly clarify the difference between fixed-size vectors, vectors, and slices.
2014-05-08Handle fallout for vector additionKevin Ballard-17/+0
Adding two vectors now results in a Vec<T> instead of a ~[T]. Implement Add on Vec<T>.
2014-05-08Handle fallout in iter, option, result, and sync::arcKevin Ballard-50/+51
API changes: - UnsafeArc::newN() returns Vec<UnsafeArc<T>>
2014-05-08Remove FromIterator impl for ~[T]Kevin Ballard-33/+0
As part of the shift from ~[T] to Vec<T>, recently ~[T] was made non-growable. However, the FromIterator implementation for ~[T] was left intact (albeit implemented inefficiently), which basically provided a loophole to grow a ~[T] despite its non-growable nature. This is a problem, both for performance reasons and because it encourages APIs to continue returning ~[T] when they should return Vec<T>. Removing FromIterator forces these APIs to adopt the correct type. Furthermore, during today's weekly meeting it was decided that we should remove all instances of ~[T] from the standard libraries in favor of Vec<T>. Removing the FromIterator impl makes sense to do as a result. This commit only includes the removal of the FromIterator impl. The subsequent commits involve handling all of the breakage that results, including changing APIs to use Vec<T> instead of ~[T]. The precise API changes are documented in the subsequent commit messages, but each commit is not individually marked as a breaking change. Finally, a new trait FromVec is introduced that provides a mechanism to convert Vec<T> back into ~[T] if truly necessary. It is a bit awkward to use by design, and is anticipated that it will be more useful in a post-DST world to convert to an arbitrary Foo<[T]> smart pointer. [breaking-change]
2014-05-07std: Small doc tweaksBrian Anderson-1/+3
2014-05-07std: Change names of transmute's type parametersBrian Anderson-1/+1
from L, G to T, U. I don't know what L and G mean. T, U easier to understand.
2014-05-07std: Reorder definitions in castBrian Anderson-19/+19
Prioritize `transmute` and `forget`.
2014-05-07std: Remove bump_box_refcount. Deprecated and unused. Deprecused.Brian Anderson-23/+1
2014-05-07Test fixes and rebase conflictsAlex Crichton-25/+59
2014-05-07core: Move Option::expect to libstd from libcoreAlex Crichton-29/+5
See #14008 for more details
2014-05-07core: Fix an unsigned negation warningAlex Crichton-1/+1
2014-05-07core: Get coretest workingAlex Crichton-77/+238
This mostly involved frobbing imports between realstd, realcore, and the core being test. Some of the imports are a little counterintuitive, but it mainly focuses around libcore's types not implementing Show while libstd's types implement Show.
2014-05-07core: Inherit the cell moduleAlex Crichton-1/+312
2014-05-07core: Inherit the result moduleAlex Crichton-0/+754
The unwrap()/unwrap_err() methods are temporarily removed, and will be added back in the next commit.
2014-05-07core: Remove generics from Option::expectAlex Crichton-3/+1
The prospects of a generic failure function such as this existing in libcore are bleak, due to monomorphization not working across the crate boundary, and allocation into a ~Any is not allowed in libcore. The argument to expect() is now &str instead of <M: Send + Any> [breaking-change]
2014-05-07core: Add a limited implementation of failureAlex Crichton-45/+143
This adds an small of failure to libcore, hamstrung by the fact that std::fmt hasn't been migrated yet. A few asserts were re-worked to not use std::fmt features, but these asserts can go back to their original form once std::fmt has migrated. The current failure implementation is to just have some symbols exposed by std::rt::unwind that are linked against by libcore. This is an explicit circular dependency, unfortunately. This will be officially supported in the future through compiler support with much nicer failure messages. Additionally, there are two depended-upon symbols today, but in the future there will only be one (once std::fmt has migrated).
2014-05-07core: Bring char/finally test style up to dateAlex Crichton-196/+202
2014-05-07core: Allow some #[deriving] in libcoreAlex Crichton-0/+6
2014-05-07core: Implement necessary traits for ~[T]/~strAlex Crichton-0/+200
Coherence requires that libcore's traits be implemented in libcore for ~[T] and ~str (due to them being language defined types). These implementations cannot live in libcore forever, but for now, until Heap/Box/Uniq is a lang item, these implementations must reside inside of libcore. While not perfect implementations, these shouldn't reside in libcore for too long. With some form of lang item these implementations can be in a proper crate because the lang item will not be present in libcore.
2014-05-07core: Inherit possible string functionalityAlex Crichton-0/+1862
This moves as much allocation as possible from teh std::str module into core::str. This includes essentially all non-allocating functionality, mostly iterators and slicing and such. This primarily splits the Str trait into only having the as_slice() method, adding a new StrAllocating trait to std::str which contains the relevant new allocation methods. This is a breaking change if any of the methods of "trait Str" were overriden. The old functionality can be restored by implementing both the Str and StrAllocating traits. [breaking-change]
2014-05-07core: Inherit necessary unicode functionalityAlex Crichton-0/+5010
The unicode module remains private, but the normalization iterators require an allocation, so some functionality needs to remain in libstd
2014-05-07core: Inherit non-allocating slice functionalityAlex Crichton-0/+1484
This commit adds a new trait, MutableVectorAllocating, which represents functions on vectors which can allocate. This is another extension trait to slices which should be removed once a lang item exists for the ~ allocation.
2014-05-07core: Inherit the specific numeric modulesAlex Crichton-0/+1748
This implements all traits inside of core::num for all the primitive types, removing all the functionality from libstd. The std modules reexport all of the necessary items from the core modules.
2014-05-07core: Inherit what's possible from the num moduleAlex Crichton-0/+862
This strips out all string-related functionality from the num module. The inherited functionality is all that will be implemented in libcore (for now). Primarily, libcore will not implement the Float trait or any string-related functionality. It may be possible to migrate string parsing functionality into libcore in the future, but for now it will remain in libstd. All functionality in core::num is reexported in std::num.
2014-05-07core: Inhert ~/@/& cmp traits, remove old modulesAlex Crichton-0/+75
This commit removes the std::{managed, reference} modules. The modules serve essentially no purpose, and the only free function removed was `managed::ptr_eq` which can be achieved by comparing references. [breaking-change]
2014-05-07core: Inherit the cmp moduleAlex Crichton-0/+245
This removes the TotalOrd and TotalEq implementation macros, they will be added later to the numeric modules (where the other comparison implementations live).
2014-05-07core: Inherit the iter moduleAlex Crichton-0/+3091
2014-05-07core: Inherit the option moduleAlex Crichton-0/+882
2014-05-07core: Inherit the bool moduleAlex Crichton-0/+274
2014-05-07core: Inherit the tuple moduleAlex Crichton-0/+331
2014-05-07core: Bring clone tests up to date in styleAlex Crichton-36/+39