about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2014-12-12Add Ord impl to raw pointersMike Pedersen-11/+25
2014-12-11auto merge of #19672 : alexcrichton/rust/snapshots, r=brsonbors-66/+12
These snapshots were generated on the 10.7 bot which should be the first step in fixing #19643
2014-12-11Register new snapshotsAlex Crichton-66/+12
2014-12-10Fix inappropriate ## headingsSteve Klabnik-3/+3
Fixes #15499.
2014-12-10auto merge of #19573 : apasel422/rust/sized_fn_once, r=alexcrichtonbors-2/+2
- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes `self` by value and can never be implemented by an unsized type. - Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl, as both `Fn` and `FnMut` are `for Sized?`.
2014-12-09Test fixes and rebase conflicts from the rollupAlex Crichton-1/+4
2014-12-09rollup merge of #19653: frewsxcv/rm-reexportsAlex Crichton-2/+2
Brief note: This does *not* affect anything in the prelude Part of #19253 All this does is remove the reexporting of Result and Option from their respective modules. More core reexports might be removed, but these ones are the safest to remove since these enums (and their variants) are included in the prelude. Depends on https://github.com/rust-lang/rust/pull/19407 which is merged, but might need a new snapshot [breaking-change]
2014-12-09rollup merge of #19623: rustyrazorblade/patch-1Alex Crichton-1/+1
Docs said from_utf8 accepts a vector when it actually accepts an array of bytes.
2014-12-09rollup merge of #19587: huonw/closure-feature-gateAlex Crichton-1/+1
detect UFCS drop and allow UFCS methods to have explicit type parameters. Work towards #18875. Since code could previously call the methods & implement the traits manually, this is a [breaking-change] Closes #19586. Closes #19375.
2014-12-09auto merge of #19644 : pcwalton/rust/oibit3, r=nikomatsakisbors-8/+155
2014-12-08Remove Result and Option reexportsCorey Farwell-2/+2
Brief note: This does *not* affect anything in the prelude Part of #19253 All this does is remove the reexporting of Result and Option from their respective modules. More core reexports might be removed, but these ones are the safest to remove since these enums (and their variants) are included in the prelude. [breaking-change]
2014-12-08Revert "Register new snapshots"Alex Crichton-0/+50
This reverts commit 9b443289cf32cbcff16768614340f0c844675340.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-8/+155
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-08core: make the public fmt API completely safe.Eduard Burtescu-28/+53
2014-12-08core: remove the dead function fmt::argumentstr.Eduard Burtescu-8/+0
2014-12-07documentation incorrectly described from_utf8Jon Haddad-1/+1
Docs said from_utf8 accepts a vector when it actually accepts a slice of bytes.
2014-12-07auto merge of #19407 : frewsxcv/rust/rm-reexports, r=cmrbors-32/+54
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::\*, Result::\*, and Ordering::\*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
2014-12-05Feature-gate explicit unboxed closure method calls & manual impls,Huon Wilson-1/+1
detect UFCS drop and allow UFCS methods to have explicit type parameters. Work towards #18875. Since code could previously call the methods & implement the traits manually, this is a [breaking-change] Closes #19586. Closes #19375.
2014-12-05Register new snapshotsAlex Crichton-50/+0
2014-12-05Utilize fewer reexportsCorey Farwell-32/+54
In regards to: https://github.com/rust-lang/rust/issues/19253#issuecomment-64836729 This commit: * Changes the #deriving code so that it generates code that utilizes fewer reexports (in particur Option::* and Result::*), which is necessary to remove those reexports in the future * Changes other areas of the codebase so that fewer reexports are utilized
2014-12-05libcore: Fix `Sized` bounds on overloaded function traits.Andrew Paseltiner-2/+2
- Remove the `for Sized?` bound on `core::ops::FnOnce`, as it takes `self` by value and can never be implemented by an unsized type. - Add a missing `Sized?` bound to the blanket `core::ops::FnMut` impl, as both `Fn` and `FnMut` are `for Sized?`.
2014-12-05rollup merge of #19553: sfackler/issue-19543Corey Richardson-0/+1
Closes #19543
2014-12-05rollup merge of #19520: csouth3/derefmut-unsizedCorey Richardson-1/+1
Right now, `DerefMut` is not `for Sized?`, so you can't impl `DerefMut<T> for Foo` where `Foo` is unsized. However, there is no reason that it can't be `for Sized?`, so this pull request fixes the issue. Closes #19493.
2014-12-05rollup merge of #19512: cybergeek94/masterCorey Richardson-3/+34
Added the example from [this Reddit thread][1], reworked to be more robust with correct logic (first link skipped the 0th and 1st Fibonacci numbers, second forgot about the last two valid values before overflow). Will yield all Fibonacci numbers sequentially in the range `[0, <u32 as Int>::max_value())`. If the example is too complicated I can change it to a more naive version, perhaps using signed integers to check for overflow instead of `Option` and `.checked_add()`. Also reworded the doc comments to clarify the usage and behavior of `Unfold`, as the thread suggested that it wasn't really clear how `Unfold` worked and when one should use it. This change is in the `core` crate but I based the example on `std` since that's where most readers will find the example. I included a note about `core` for clarity. Edit: removed. Tested with `rustdoc src/libcore/lib.rs`. Rebased against latest master as of the creation of this PR. [1]: http://www.reddit.com/r/rust/comments/2ny8r1/a_question_about_loops/cmighu4?context=10000
2014-12-05rollup merge of #19483: cgaebel/copy_memory-commentCorey Richardson-2/+3
2014-12-05rollup merge of #19468: victorvde/masterCorey Richardson-5/+5
1. Made small improvements to the docs for checked_sub, checked_mul and checked_div. 2. Updated a confusingly outdated comment for intrinsics, noticed before at <https://stackoverflow.com/questions/23582931/>.
2014-12-05rollup merge of #19386: tbu-/pr_refcell_stuffCorey Richardson-43/+75
2014-12-05rollup merge of #19359: japaric/clone-cowCorey Richardson-0/+12
Now we can use `#[deriving(Clone)]` on structs that contain `Cow`. r? @aturon or anyone else
2014-12-04Make missing_doc lint check typedefsSteven Fackler-0/+1
Closes #19543
2014-12-04auto merge of #18980 : erickt/rust/reader, r=ericktbors-5/+4
This continues the work @thestinger started in #18885 (which hasn't landed yet, so wait for that to land before landing this one). Instead of adding more methods to `BufReader`, this just allows a `&[u8]` to be used directly as a `Reader`. It also adds an impl of `Writer` for `&mut [u8]`.
2014-12-04core: fix a doctestErick Tryzelaar-2/+2
2014-12-04auto merge of #19167 : japaric/rust/rhs-cmp, r=aturonbors-44/+99
Comparison traits have gained an `Rhs` input parameter that defaults to `Self`. And now the comparison operators can be overloaded to work between different types. In particular, this PR allows the following operations (and their commutative versions): - `&str` == `String` == `CowString` - `&[A]` == `&mut [B]` == `Vec<C>` == `CowVec<D>` == `[E, ..N]` (for `N` up to 32) - `&mut A` == `&B` (for `Sized` `A` and `B`) Where `A`, `B`, `C`, `D`, `E` may be different types that implement `PartialEq`. For example, these comparisons are now valid: `string == "foo"`, and `vec_of_strings == ["Hello", "world"]`. [breaking-change]s Since the `==` may now work on different types, operations that relied on the old "same type restriction" to drive type inference, will need to be type annotated. These are the most common fallout cases: - `some_vec == some_iter.collect()`: `collect` needs to be type annotated: `collect::<Vec<_>>()` - `slice == &[a, b, c]`: RHS doesn't get coerced to an slice, use an array instead `[a, b, c]` - `lhs == []`: Change expression to `lhs.is_empty()` - `lhs == some_generic_function()`: Type annotate the RHS as necessary cc #19148 r? @aturon
2014-12-04core::iter::Unfold: reword docs and add exampleAustin Bonander-3/+34
Remove note about core
2014-12-04`DerefMut` should be `for Sized?`Chase Southwood-1/+1
2014-12-04Implement the `Fn` trait for bare fn pointers in the compiler rather than ↵Niko Matsakis-38/+42
doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes #19126.
2014-12-03Deprecate EquivJorge Aparicio-3/+11
2014-12-03Fix falloutJorge Aparicio-13/+13
2014-12-03Overload the `==` operatorJorge Aparicio-16/+62
- String == &str == CowString - Vec == &[T] == &mut [T] == [T, ..N] == CowVec - InternedString == &str
2014-12-02Fixed out of date comment on `copy_memory`Clark Gaebel-2/+3
2014-12-02libcore: add `Rhs` input parameter to comparison traitsJorge Aparicio-12/+13
2014-12-02Update comment to current file path for intrinsicsVictor van den Elzen-1/+1
2014-12-02Improve documentation of checked_* functionsVictor van den Elzen-4/+4
2014-11-30std: add Reader impl for &[u8]Erick Tryzelaar-4/+3
2014-11-30Simplify `RefCell` code a bit, make `deref` a no-op.Tobias Bucher-43/+75
2014-11-27impl Clone for CowJorge Aparicio-0/+12
2014-11-27auto merge of #19348 : SimonSapin/rust/patch-9, r=huonwbors-3/+3
2014-11-27auto merge of #19343 : sfackler/rust/less-special-attrs, r=alexcrichtonbors-1/+0
Descriptions and licenses are handled by Cargo now, so there's no reason to keep these attributes around.
2014-11-26rollup merge of #19329: steveklabnik/doc_style_cleanup2Alex Crichton-171/+154
2014-11-26/*! -> //!Steve Klabnik-171/+154
Sister pull request of https://github.com/rust-lang/rust/pull/19288, but for the other style of block doc comment.
2014-11-26rollup merge of #19298: nikomatsakis/unboxed-closure-parse-the-plusAlex Crichton-3/+3
Implements RFC 438. Fixes #19092. This is a [breaking-change]: change types like `&Foo+Send` or `&'a mut Foo+'a` to `&(Foo+Send)` and `&'a mut (Foo+'a)`, respectively. r? @brson