about summary refs log tree commit diff
path: root/src/libcore/ops.rs
AgeCommit message (Collapse)AuthorLines
2015-03-23Compiler and trait changes to make indexing by value.Niko Matsakis-0/+12
2015-03-23Make the `Fn` traits inherit from one another and remove the bridgingNiko Matsakis-0/+24
impls. This requires: 1. modifying trait selection a bit so that when we synthesize impls for fn pointers and closures; 2. adding code to trans so that we can synthesize a `FnMut`/`FnOnce` impl for a `Fn` closure and so forth.
2015-03-18std: Add missing stability on RangeAlex Crichton-3/+4
Now that we check the stability of fields, the fields of this struct should also be stable.
2015-03-13Remove explicit syntax highlight from docs.Joseph Crail-4/+4
2015-03-11Example -> ExamplesSteve Klabnik-18/+18
This brings comments in line with https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#using-markdown
2015-03-03std: Mark `Index::Output` as a stable associated typeAlex Crichton-0/+1
This stability attribute was left out by accident and the stability pass has since picked up the ability to check for this. As a result, crates are currently getting warnings for implementations of `Index`.
2015-02-23Add documentation to associated types in libcore, libstdIvan Petkov-0/+17
2015-02-15Audit integer types in ops.Niko Matsakis-13/+13
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-6/+3
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-06make `IndexMut` a super trait over `Index`Jorge Aparicio-10/+14
closes #21630
2015-02-02register snapshotsJorge Aparicio-17/+0
2015-01-31remove Copy impls from remaining iteratorsJorge Aparicio-2/+2
2015-01-30Merge remote-tracking branch 'origin/master' into rollupAlex Crichton-0/+3
Conflicts: src/liballoc/lib.rs src/libcore/ops.rs
2015-01-30rollup merge of #21760: brson/snapsAlex Crichton-53/+0
2015-01-30Auto merge of #21604 - nikomatsakis:closure-move-indiv-vars, r=eddybbors-0/+3
r? @eddyb
2015-01-30Use `#[rustc_paren_sugar]` as a more extensible way of deciding whenNiko Matsakis-0/+3
paren sugar is legal.
2015-01-29Register snapsBrian Anderson-53/+0
2015-01-30Rename FullRange to RangeFullNick Cameron-0/+17
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-28Merge remote-tracking branch 'origin/master' into rollupManish Goregaokar-87/+157
Conflicts: src/libcollections/slice.rs src/libcore/nonzero.rs src/libcore/ops.rs
2015-01-28Move return type an associated type of the `Fn*` traits. Mostly this ↵Niko Matsakis-6/+69
involves tweaking things in the compiler that assumed two input types to assume two ouputs; we also have to teach `project.rs` to project `Output` from the unboxed closure and fn traits.
2015-01-28Rollup merge of #21658 - Manishearth:index_on_unimplemented, r=GankroManish Goregaokar-0/+2
Helps issues like [these](http://www.reddit.com/r/rust/comments/2tpefm/unable_to_access_array_elements/) r? @Gankro rollup-worthy
2015-01-27Add on_unimplemented note to IndexManish Goregaokar-0/+2
2015-01-25cleanup: s/impl Copy/#[derive(Copy)]/gJorge Aparicio-4/+2
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-98/+17
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-23grandfathered -> rust1Brian Anderson-62/+62
2015-01-23Set unstable feature names appropriatelyBrian Anderson-19/+19
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-19/+19
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-81/+88
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-59/+8
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-9/+9
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21367: steveklabnik/remove_gateAlex Crichton-30/+0
This gate was `Accepted`, so we shouldn't need these.
2015-01-21Stabilize Index traits and most range notationAaron Turon-63/+12
This commit marks as `#[stable]`: * The `Index` and `IndexMut` traits. These are stabilized as taking the index itself *by reference*; after extensive discussion it was determined that this is a better match with our choices elsewhere (e.g. making comparison operators auto-reference), and that the use cases for by-value indices are better handled through `IndexSet`. * The `Range`, `RangeFrom` and `RangeTo` structs, introduced for range notation. * Various impls of `Index` and `IndexMut`. The `FullRange` struct is left unstable as we may wish to rename it to `RangeFull` in the future. This commit also *removes* the `Step` trait in favor of direct implementation of iterator traits on ranges for integers. The `Step` trait was not a terribly useful factoring internally, and it is likely that external integer types are best off implementing range iterators directly. It was removed to simplify the API surface. We can always reintroduce `Step` later if it turns out to be useful. Due to this removal, this is a: [breaking-change]
2015-01-21Auto merge of #21227 - sellibitze:core-ops-for-references, r=aturonbors-4/+92
As discussed with @aturon I added implementations of various op traits for references to built-in types which was already suggested by the ops reform RFC. The 2nd commit updates the module documentation of core::ops to fully reflect the recent change from pass-by-reference to pass-by-value and expands on the implications for generic code.
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-9/+9
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20add stability text like suggested in discussionSebastian Gesemann-4/+4
2015-01-19Ranges implement Clone where possibleDiggory Blake-4/+4
2015-01-18Remove associated_types gate from std::ops docsSteve Klabnik-30/+0
2015-01-17Register new snapshots.Eduard Burtescu-18/+0
2015-01-17Make Index trait example clearerVolker Mische-12/+10
The example of the `Index` and `IndexMut` trait contained too much `Foo`. It now contains a bit more `Bar` to make things clearer which parts are defining the type of the index.
2015-01-16inline forward_xxx_xxx_binop macros as per suggestionSebastian Gesemann-25/+3
2015-01-16Fix/update core::ops module documentation w.r.t. operator traitsSebastian Gesemann-4/+12
* Not all traits are part of the prelude anymore * We switched from pass-by-reference to pass-by-value for most traits * Add some explanations around pass-by-value traits in the context of generic code and additional implementations for reference types.
2015-01-16libcore: implement many operators for references as wellSebastian Gesemann-0/+102
2015-01-11Allow any integral to be used as Shr and Shl RHSSimonas Kazlauskas-8/+60
This is only relevant to the code that uses generics such as fn magic<T: Shl>(a: T) { a << 10u8; } Fixes #20288
2015-01-08Remove String impls and fix for make tidyNick Cameron-51/+0
2015-01-08Show, String, Eq impls for RangesNick Cameron-4/+84
2015-01-06More test fixesAlex Crichton-2/+2
2015-01-06rollup merge of #20656: japaric/at-cleanAlex Crichton-1/+1
2015-01-06rollup merge of #20607: nrc/kindsAlex Crichton-1/+1
Conflicts: src/libcore/array.rs src/libcore/cell.rs src/libcore/prelude.rs src/libstd/path/posix.rs src/libstd/prelude/v1.rs src/test/compile-fail/dst-sized-trait-param.rs
2015-01-07markers -> markerNick Cameron-1/+1