about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-03-30std: Stabilize the rest of Any/BoxAnyAlex Crichton-2/+1
This commit stabilizes the following APIs: * `TypeId::of` - now that it has an `Any` bound it's ready to be stable. * `Box<Any>::downcast` - now that an inherent impl on `Box<Any>` as well as `Box<Any+Send>` is allowed the `BoxAny` trait is removed in favor of these inherent methods. This is a breaking change due to the removal of the `BoxAny` trait, but consumers can simply remove imports to fix crates. [breaking-change]
2015-03-30libcore: Ensure min and max functions are consistent for equal inputsKevin Butler-28/+44
2015-03-31replace deprecated as_slice()Emeliov Dmitrii-4/+4
2015-03-30std: Standardize (input, output) param orderingsAlex Crichton-17/+45
This functions swaps the order of arguments to a few functions that previously took (output, input) parameters, but now take (input, output) parameters (in that order). The affected functions are: * ptr::copy * ptr::copy_nonoverlapping * slice::bytes::copy_memory * intrinsics::copy * intrinsics::copy_nonoverlapping Closes #22890 [breaking-change]
2015-03-30Second attempt to fix #23713 based on follow-up comments in #23791.Julian Viereck-1/+1
2015-03-30Remove unnecessary `as usize`Vadim Petrochenkov-1/+1
2015-03-30Change the type of constants BYTES/BITS to usizeVadim Petrochenkov-4/+4
2015-03-30Driveby cleanup of the impl for negation, which had some kind ofNiko Matsakis-22/+2
surprising casts. This version more obviously corresponds to the builtin semantics.
2015-03-29Auto merge of #23830 - petrochenkov:spellcheck, r=steveklabnikbors-1/+1
With help of https://github.com/lucasdemarchi/codespell r? @steveklabnik
2015-03-29Fix line spacing.Andrew Hobden-1/+4
2015-03-29Fix trailing whitespace. Whoops!Andrew Hobden-5/+5
2015-03-29Update `std::error` exampleAndrew Hobden-22/+16
To not use `old_io` and `os`, which are deprecated. Since there is no more `MemoryMap` used byte parsing instead to generate the second potential error.
2015-03-29Auto merge of #23816 - frewsxcv:fromiterator-example, r=Manishearthbors-0/+21
2015-03-29Add an example for FromIterator::from_iterCorey Farwell-0/+21
2015-03-29Rollup merge of #23814 - steveklabnik:gh23320, r=alexcrichtonManish Goregaokar-0/+10
Fixes #23320
2015-03-29Auto merge of #23810 - sfackler:debug-collections, r=alexcrichtonbors-90/+125
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
2015-03-28Oops fix output examplesSteven Fackler-4/+4
2015-03-28Fold in debug builder doc examplesSteven Fackler-15/+3
2015-03-28Remove IteratorExtSteven Fackler-99/+103
All methods are inlined into Iterator with `Self: Sized` bounds to make sure Iterator is still object safe. [breaking-change]
2015-03-28Document properties for Eq + HashSteve Klabnik-0/+10
Fixes #23320
2015-03-28Fold collections debug implsSteven Fackler-16/+1
Also convert [T]'s Debug impl. The behavior of the alternate flag here's changing.
2015-03-28Update debug helpers and add list builderSteven Fackler-64/+126
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
2015-03-28Fix some typosVadim Petrochenkov-1/+1
2015-03-28Rollup merge of #23803 - richo:unused-braces, r=ManishearthManish Goregaokar-1/+1
Pretty much what it says on the tin.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-28Auto merge of #23799 - reem:error-no-send, r=aturonbors-1/+1
The Send bound is an unnecessary restriction, and though provided as a convenience, can't be removed by downstream code. The removal of this bound is a [breaking-change] since it removes an implicit Send bound on all `E: Error` and all `Error` trait objects. To migrate, consider if your code actually requires the Send bound and, if so, add it explicitly. Fixes #23774 r? @aturon
2015-03-28Auto merge of #23789 - steveklabnik:gh22716, r=alexcrichtonbors-0/+17
Fixes #22716
2015-03-27Make `std::error::Error` not inherit from SendJonathan Reem-1/+1
The Send bound is an unnecessary restriction, and though provided as a convenience, can't be removed by downstream code. The removal of this bound is a [breaking-change] since it removes an implicit Send bound on all `E: Error` and all `Error` trait objects. To migrate, consider if your code actually requires the Send bound and, if so, add it explicitly. Fixes #23774
2015-03-27Note that zip and enumerate are similarSteve Klabnik-0/+17
Fixes #22716
2015-03-27rollup merge of #23793: steveklabnik/gh21668Alex Crichton-4/+8
Fixes #21668
2015-03-27rollup merge of #23791: jviereck/fix-23713Alex Crichton-1/+1
Fixes #23713.
2015-03-27Update return value docs in atomics docsSteve Klabnik-4/+8
Fixes #21668
2015-03-27Fix wording for Option<T>.unwrap. Fixes #23713Julian Viereck-1/+1
2015-03-27Test fixes and rebase conflicts, round 1Alex Crichton-1/+1
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-116/+117
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27rollup merge of #23738: alexcrichton/snapshotsAlex Crichton-358/+0
Conflicts: src/libcollections/vec.rs
2015-03-27rollup merge of #23780: ruud-v-a/wrappingAlex Crichton-1/+1
This allows `Wrapping<T>` to be used in `assert_eq!`, for example. One of the tests (compile-fail/xc-private-method.rs) fails, but I can hardly imagine it is related to this change. I would also like to add a tests to ensure that `assert_eq!` compiles and keeps working in the future for `Wrapped<T>` values, but there appear to be no tests in libcore. What would be a good place to add such a test?
2015-03-27rollup merge of #23776: nrc/allow_trivial_castAlex Crichton-14/+0
r? @alexcrichton
2015-03-27rollup merge of #23771: aturon/stab-straggle-1Alex Crichton-10/+7
Marks as `#[stable}`: * `ok_or` * `ok_or_else` * `iter_mut` * `cloned` Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to work only on `Option<&T>`. Thus, this is a: [breaking-change] r? @alexcrichton
2015-03-27rollup merge of #23753: aturon/revise-convertAlex Crichton-0/+16
This commit revises `path` and `os_str` to use blanket impls for `From` on reference types. This both cuts down on the number of required impls, and means that you can pass through e.g. `T: AsRef<OsStr>` to `PathBuf::from` without an intermediate call to `as_ref`. It also makes a FIXME note for later generalizing the blanket impls for `AsRef` and `AsMut` to use `Deref`/`DerefMut`, once it is possible to do so.
2015-03-27rollup merge of #23752: alexcrichton/remove-should-failAlex Crichton-4/+4
This attribute has been deprecated in favor of #[should_panic]. This also updates rustdoc to no longer accept the `should_fail` directive and instead renames it to `should_panic`.
2015-03-27rollup merge of #23736: gmjosack/masterAlex Crichton-1/+1
Found a few 404s that seemed like simple fixes: In footer.inc, certain 404 pages were 404ing on the request to jquery.js and playpen.js. This is easily demonstrated by visiting http://doc.rust-lang.org/foo then http://doc.rust-lang.org/foo/bar. The latter 404s, looking for foo/jquery.js. The Result docs use old_io Writer as an example. Fix the link to old_io Writer. There's probably an effort to update the example away from a deprecated api but this was a simple fix. rustc/plugin was pointing at the old guide and it was a broken link anyways (plugin vs plugins). Point at the book instead. The main page of the API docs referenced c_{str,vec}. Looks like these were deleted in 25d5a3a19423fee01787de87a56d185dd4e0a4e7. Point at ffi docs instead.
2015-03-27rollup merge of #23721: erickt/deprecateAlex Crichton-0/+6
This is technically a breaking change as it deprecates and unstables some previously stable apis that were missed in the last round of deprecations. [breaking change]
2015-03-27rollup merge of #23712: nikomatsakis/reflect-traitAlex Crichton-11/+57
This PR introduces a `Reflect` marker trait which is a supertrait of `Any`. The idea is that `Reflect` is defined for all concrete types, but is not defined for type parameters unless there is a `T:Reflect` bound. This is intended to preserve the parametricity property. This allows the `Any` interface to be stabilized without committing us to unbounded reflection that is not easily detectable by the caller. The implementation of `Reflect` relies on an experimental variant of OIBIT. This variant behaves differently for objects, since it requires that all types exposed as part of the object's *interface* are `Reflect`, but isn't concerned about other types that may be closed over. In other words, you don't have to write `Foo+Reflect` in order for `Foo: Reflect` to hold (where `Foo` is a trait). Given that `Any` is slated to stabilization and hence that we are committed to some form of reflection, the goal of this PR is to leave our options open with respect to parametricity. I see the options for full stabilization as follows (I think an RFC would be an appropriate way to confirm whichever of these three routes we take): 1. We make `Reflect` a lang-item. 2. We stabilize some version of the OIBIT variation I implemented as a general mechanism that may be appropriate for other use cases. 3. We give up on preserving parametricity here and just have `impl<T> Reflect for T` instead. In that case, `Reflect` is a harmless but not especially useful trait going forward. cc @aturon cc @alexcrichton cc @glaebhoerl (this is more-or-less your proposal, as I understood it) cc @reem (this is more-or-less what we discussed on IRC at some point) cc @FlaPer87 (vaguely pertains to OIBIT)
2015-03-27rollup merge of #23676: gkoz/array_as_refAlex Crichton-0/+19
r? @aturon
2015-03-27num: Derive Debug for WrappingRuud van Asseldonk-1/+1
This allows `Wrapping<T>` to be used in `assert_eq!`, for example.
2015-03-27Change the trivial cast lints to allow by defaultNick Cameron-14/+0
2015-03-26Fix doc tests.Niko Matsakis-0/+1
2015-03-26Stabilize some stragglers in `std::option`Aaron Turon-10/+7
Marks as `#[stable}`: * `ok_or` * `ok_or_else` * `iter_mut` * `cloned` Similarly to `IteratorExt::cloned`, the `cloned` method is pared down to work only on `Option<&T>`. Thus, this is a: [breaking-change]
2015-03-26Implement `Reflect` trait with a variant on the standard OIBITNiko Matsakis-11/+56
semantics that tests the *interface* of trait objects, rather than what they close over.