about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2014-06-01rustdoc: Fix some more broken linksAlex Crichton-3/+27
2014-06-01std: Drop Total from Total{Eq,Ord}Alex Crichton-59/+56
This completes the last stage of the renaming of the comparison hierarchy of traits. This change renames TotalEq to Eq and TotalOrd to Ord. In the future the new Eq/Ord will be filled out with their appropriate methods, but for now this change is purely a renaming change. [breaking-change]
2014-06-01auto merge of #14580 : utkarshkukreti/rust/fix-docs-for-result-map, ↵bors-1/+3
r=alexcrichton `reader.read_line()` includes trailing newline char, which makes `from_str` always return `None`.
2014-06-01Fix docs for `core::result::Result::map`.Utkarsh Kukreti-1/+3
`reader.read_line()` includes trailing newline char, which makes `from_str` always return `None`.
2014-05-31doc: Fix a number of broken linksAlex Crichton-2/+4
cc #14515
2014-05-31rustdoc: Create anchor pages for primitive typesAlex Crichton-0/+33
This commit adds support in rustdoc to recognize the `#[doc(primitive = "foo")]` attribute. This attribute indicates that the current module is the "owner" of the primitive type `foo`. For rustdoc, this means that the doc-comment for the module is the doc-comment for the primitive type, plus a signal to all downstream crates that hyperlinks for primitive types will be directed at the crate containing the `#[doc]` directive. Additionally, rustdoc will favor crates closest to the one being documented which "implements the primitive type". For example, documentation of libcore links to libcore for primitive types, but documentation for libstd and beyond all links to libstd for primitive types. This change involves no compiler modifications, it is purely a rustdoc change. The landing pages for the primitive types primarily serve to show a list of implemented traits for the primitive type itself. The primitive types documented includes both strings and slices in a semi-ad-hoc way, but in a way that should provide at least somewhat meaningful documentation. Closes #14474
2014-05-30syntax: Prepare for Total{Eq,Ord} => {Eq,Ord}Alex Crichton-1/+5
This commit adds the groundwork for the renaming of the Total{Eq,Ord} traits. After this commit hits a snapshot, the traits can be renamed.
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-125/+124
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-30Register new snapshotsAlex Crichton-38/+2
2014-05-30lib{std,core,debug,rustuv,collections,native,regex}: Fix snake_case errors.Kevin Butler-2/+3
A number of functions/methods have been moved or renamed to align better with rust standard conventions. std::reflect::MovePtrAdaptor => MovePtrAdaptor::new debug::reflect::MovePtrAdaptor => MovePtrAdaptor::new std::repr::ReprVisitor => ReprVisitor::new debug::repr::ReprVisitor => ReprVisitor::new rustuv::homing::HomingIO.go_to_IO_home => go_to_io_home [breaking-change]
2014-05-29auto merge of #14427 : alexcrichton/rust/librand, r=huonwbors-20/+17
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for libcore to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. cc #13851 [breaking-change]
2014-05-29std: Recreate a `rand` moduleAlex Crichton-20/+17
This commit shuffles around some of the `rand` code, along with some reorganization. The new state of the world is as follows: * The librand crate now only depends on libcore. This interface is experimental. * The standard library has a new module, `std::rand`. This interface will eventually become stable. Unfortunately, this entailed more of a breaking change than just shuffling some names around. The following breaking changes were made to the rand library: * Rng::gen_vec() was removed. This has been replaced with Rng::gen_iter() which will return an infinite stream of random values. Previous behavior can be regained with `rng.gen_iter().take(n).collect()` * Rng::gen_ascii_str() was removed. This has been replaced with Rng::gen_ascii_chars() which will return an infinite stream of random ascii characters. Similarly to gen_iter(), previous behavior can be emulated with `rng.gen_ascii_chars().take(n).collect()` * {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all relied on being able to use an OSRng for seeding, but this is no longer available in librand (where these types are defined). To retain the same functionality, these types now implement the `Rand` trait so they can be generated with a random seed from another random number generator. This allows the stdlib to use an OSRng to create seeded instances of these RNGs. * Rand implementations for `Box<T>` and `@T` were removed. These seemed to be pretty rare in the codebase, and it allows for librand to not depend on liballoc. Additionally, other pointer types like Rc<T> and Arc<T> were not supported. If this is undesirable, librand can depend on liballoc and regain these implementations. * The WeightedChoice structure is no longer built with a `Vec<Weighted<T>>`, but rather a `&mut [Weighted<T>]`. This means that the WeightedChoice structure now has a lifetime associated with it. * The `sample` method on `Rng` has been moved to a top-level function in the `rand` module due to its dependence on `Vec`. cc #13851 [breaking-change]
2014-05-29auto merge of #14492 : alexcrichton/rust/totaleq, r=pnkfelixbors-0/+3
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
2014-05-28auto merge of #14451 : alexcrichton/rust/issue-14442, r=brsonbors-6/+29
This avoids having to perform conversions from `*u8` to `&'static str` which can suck in a good deal of code. Closes #14442
2014-05-28auto merge of #14298 : kmcallister/rust/pattern-macros, r=huonwbors-0/+1
First commit is an unrelated fix for a test suite warning I introduced last week.
2014-05-28Silence warning in RefCell test suiteKeegan McAllister-0/+1
2014-05-28auto merge of #14464 : Sawyer47/rust/issue-12925, r=alexcrichtonbors-1402/+638
This is an attempt of fixing #12925. This PR moves almost all trait implementations for primitive types ((), bool, char, i*, u*, f*) near trait definitions. Only Float trait implementations weren't moved because they heavily rely on constants defined in f32.rs and f64.rs. Some trait implementations had cfg(not(test)) attribute. I suspect it's because of issue 2912. Still, someone who knows the problem better should probably check this code. Closes #12925
2014-05-28rustc: Accept PartialOrd/PartialOrdEq for Eq/OrdAlex Crichton-0/+3
This is a transitionary step towards completing #12517. This change modifies the compiler to accept Partial{Ord,Eq} as deriving modes which will currently expand to implementations of PartialOrd and PartialEq (synonyms for Eq/Ord). After a snapshot, all of deriving(Eq, Ord) will be removed, and after a snapshot of that, TotalEq/TotalOrd will be renamed to Eq/Ord.
2014-05-28auto merge of #14437 : Sawyer47/rust/utf16-items, r=alexcrichtonbors-7/+7
According to Rust's style guide acronyms should be CamelCase.
2014-05-28Move trait impls for primitives near trait definitionPiotr Jawniak-1402/+638
Closes #12925
2014-05-28auto merge of #14463 : SergioBenitez/rust/deprecation-fix, r=alexcrichtonbors-2/+2
The deprecation warning text for mem::move_val_init was incorrect. It should point users to `overwrite` instead of itself.
2014-05-28Rename UTF16Item[s] to Utf16Item[s]Piotr Jawniak-7/+7
According to Rust's style guide acronyms should be CamelCase. [breaking-change]
2014-05-27Move std::{reflect,repr,Poly} to a libdebug crateAlex Crichton-4/+5
This commit moves reflection (as well as the {:?} format modifier) to a new libdebug crate, all of which is marked experimental. This is a breaking change because it now requires the debug crate to be explicitly linked if the :? format qualifier is used. This means that any code using this feature will have to add `extern crate debug;` to the top of the crate. Any code relying on reflection will also need to do this. Closes #12019 [breaking-change]
2014-05-27std: Rename strbuf operations to stringRicho Healey-4/+4
[breaking-change]
2014-05-27Fixed deprecation warning text for mem::move_val_init and its associated ↵Sergio Benitez-2/+2
comment.
2014-05-27std: Remove String's to_ownedRicho Healey-10/+10
2014-05-27rustc: Use rust strings for failure argumentsAlex Crichton-6/+29
This avoids having to perform conversions from `*u8` to `&'static str` which can suck in a good deal of code. Closes #14442
2014-05-26Improve docs for core::tuplePiotr Jawniak-2/+50
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-19/+19
[breaking-change]
2014-05-24auto merge of #14402 : huonw/rust/arc-field-rename, r=alexcrichtonbors-14/+18
Paper over privacy issues with Deref by changing field names. Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-25Paper over privacy issues with Deref by changing field names.Huon Wilson-14/+18
Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-24auto merge of #14392 : alexcrichton/rust/mem-updates, r=sfacklerbors-10/+17
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-23core: Finish stabilizing the `mem` module.Alex Crichton-10/+17
* All of the *_val functions have gone from #[unstable] to #[stable] * The overwrite and zeroed functions have gone from #[unstable] to #[stable] * The uninit function is now deprecated, replaced by its stable counterpart, uninitialized [breaking-change]
2014-05-23core: Derive Show on SIMD typesBrian Anderson-0/+10
2014-05-23core: Document simd modBrian Anderson-1/+25
2014-05-23std: Move unstable::finally to std::finally. #1457Brian Anderson-2/+2
[breaking-change]
2014-05-23std: Move simd to core::simd and reexport. #1457Brian Anderson-1/+64
[breaking-change]
2014-05-23auto merge of #14359 : brson/rust/minordoc, r=alexcrichtonbors-14/+8
2014-05-23Minor library doc copyeditingBrian Anderson-14/+8
2014-05-23auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballardbors-88/+1
These have all been deprecated for awhile now, so it's likely time to start removing them.
2014-05-23auto merge of #14372 : neeee/rust/intrinsic-docs, r=brsonbors-0/+79
2014-05-23libcore: Document math intrinsics.lucy-0/+79
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-7/+9
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22auto merge of #14348 : alexcrichton/rust/doc.rust-lang.org, r=huonwbors-2/+2
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-382/+273
[breaking-change]
2014-05-22Remove a slew of old deprecated functionsAlex Crichton-88/+1
2014-05-22Spelling/doc formatting fixes.Huon Wilson-7/+9
2014-05-22auto merge of #14335 : tbu-/rust/pr_doc_strsplit, r=pnkfelixbors-0/+9
In particular, show examples for splitting the empty string and using `splitn` with a count of 0. Fix #14222.
2014-05-21Change static.rust-lang.org to doc.rust-lang.orgAlex Crichton-2/+2
The new documentation site has shorter urls, gzip'd content, and index.html redirecting functionality.
2014-05-21migrate from `exchange_malloc` to `allocate`Daniel Micay-5/+5
This is now only used internally by the compiler.