about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-04-09fmt: Assume that we'll only ever see 32 or 64 bit pointersRicho Healey-2/+1
2015-04-09fmt: {:p#} formats pointers padded to native widthRicho Healey-1/+25
2015-04-09Ensure that .join().unwrap() worksAaron Turon-0/+10
Makes `Any + Send` implement `Debug`. Fixes #21291
2015-04-10Rollup merge of #24217 - aturon:iterator-fixes, r=alexcrichtonManish Goregaokar-20/+22
2015-04-10Rollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturonManish Goregaokar-2/+1
This method hasn't really changed since is inception, and it can often be a nice performance win for some situations. This method also imposes no burden on implementors or users of `Clone` as it's just a default method on the side.
2015-04-09Improve bounds in Iterator APIAaron Turon-20/+22
This commit changes `Iterator`'s API by: * Generalizing bounds from `Iterator` to `IntoIterator` whenever possible, matching the semantics and ergonomics of `for` loops. * Tightens up a few method-level bounds so that you get an error earlier. For example, `rev` did not require `DoubleEndedIterator` even though the result is only an `Iterator` when the original iterator was double-ended. Closes #23587 The bound-tightening is technically a: [breaking-change] but no code should break in practice.
2015-04-09Auto merge of #24168 - kballard:clone-for-extern-c-unsafe-fns, r=alexcrichtonbors-0/+21
We only implemented Clone on `extern "Rust" fn`s (for up to 8 parameters). This didn't cover `extern "C"` or `unsafe` (or `unsafe extern "C"`) `fn`s, but there's no reason why they shouldn't be cloneable as well. The new impls are marked unstable because the existing impl for `extern "Rust" fn`s is. Fixes #24161.
2015-04-08std: Stabilize Clone::clone_fromAlex Crichton-2/+1
This method hasn't really changed since is inception, and it can often be a nice performance win for some situations. This method also imposes no burden on implementors or users of `Clone` as it's just a default method on the side.
2015-04-08Auto merge of #24144 - richo:ptr-formatter, r=alexcrichtonbors-0/+8
~~I believe this should fix the issue. Opening a PR to ensure noone duplicates effort, I'm running check now.~~ Closes #24091
2015-04-08Auto merge of #24120 - aturon:range-perf, r=alexcrichtonbors-24/+23
A recent change to the implementation of range iterators meant that, even when stepping by 1, the iterators *always* involved checked arithmetic. This commit reverts to the earlier behavior (while retaining the refactoring into traits). Fixes #24095 Closes #24119 cc #24014 r? @alexcrichton
2015-04-07alloc: impl fmt::Pointer for Rc, Arc and BoxRicho Healey-0/+8
Closes #24091
2015-04-07std: Hide facade extension traits in docsAlex Crichton-0/+4
These traits are currently all just unstable parts of the facade which are implementation details for primitives further up the facade. This may make it more difficult to find what set of methods you get if only linking to libcore, but for now that's also unstable behavior. Closes #22025
2015-04-07std: Deny most warnings in doctestsAlex Crichton-1/+0
Allow a few specific ones but otherwise this helps ensure that our examples are squeaky clean! Closes #18199
2015-04-07rustdoc: Add a primitive page for raw pointersAlex Crichton-0/+1
Closes #15318
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-97/+62
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-07Fix range performance regressionAaron Turon-24/+23
A recent change to the implementation of range iterators meant that, even when stepping by 1, the iterators *always* involved checked arithmetic. This commit reverts to the earlier behavior (while retaining the refactoring into traits). Fixes #24095 cc #24014
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-153/+62
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-04-07Add Clone impls for extern "C" and unsafe fnsKevin Ballard-0/+21
We only implemented Clone on `extern "Rust" fn`s (for up to 8 parameters). This didn't cover `extern "C"` or `unsafe` (or `unsafe extern "C"`) `fn`s, but there's no reason why they shouldn't be cloneable as well. The new impls are marked unstable because the existing impl for `extern "Rust" fn`s is. Fixes #24161.
2015-04-07doc ignore (fixup #24059)Manish Goregaokar-1/+1
2015-04-07Rollup merge of #24113 - mbrubeck:doc-edit, r=steveklabnikManish Goregaokar-2/+3
* Fix broken \"module-level documentation\" link on the [`trait Any` docs](http://doc.rust-lang.org/std/any/trait.Any.html) and related broken markup on the [`std::any` docs](http://doc.rust-lang.org/std/any/index.html). * Remove an outdated or incorrect notice in the `BufRead::lines` docs. There is no such `read_string` function, and `lines` never returns an error. r? @steveklabnik
2015-04-07Rollup merge of #24110 - tbu-:pr_doc_fix_add, r=alexcrichtonManish Goregaokar-4/+4
2015-04-07Rollup merge of #24059 - nikomatsakis:issue-22914-phantomdata-docs, r=huonManish Goregaokar-9/+58
This probably needs a bit more work, but I wanted to try and capture some common use cases and be a bit more helpful. r? @huonw cc @steveklabnik
2015-04-07Auto merge of #23952 - Kimundi:more_string_pattern, r=alexcrichtonbors-363/+587
This adds the missing methods and turns `str::pattern` in a user facing module, as per RFC. This also contains some big internal refactorings: - string iterator pairs are implemented with a central macro to reduce redundancy - Moved all tests from `coretest::str` into `collectionstest::str` and left a note to prevent the two sets of tests drifting apart further. See https://github.com/rust-lang/rust/issues/22477
2015-04-06Alter libcore::result example to utilize closure paramCorey Farwell-1/+1
Since it doesn't utilize the parameter, it's not very idiomatic since it could just use the `Result::or` method. So this changes the example to utilize the parameter. As far as I can tell, all the numbers in this example are completely arbitrary.
2015-04-06Fix broken link and markup in `trait Any` docs.Matt Brubeck-2/+3
2015-04-06Fix code formatting in `core::ops::Add` exampleTobias Bucher-4/+4
2015-04-06Try to improve PhantomData docs with more examplesNiko Matsakis-9/+58
2015-04-06Make `AdditiveIterator` and `MultiplicativeIterator` extensibleTobias Bucher-37/+93
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-06Remove unnecessary returns in API examplesCorey Farwell-3/+3
2015-04-05Remove external iterator in CharIndices comment and the reference to the ↵Guillaume Gomez-2/+1
std::iter module
2015-04-05Added smoke tests for new methods.Marvin Löbel-10/+23
Fixed bug in existing StrSearcher impl
2015-04-05Refactored core::str::pattern to become a user-facing module and hide awayMarvin Löbel-13/+17
CharEq.
2015-04-05Re-added Clone impls to all str iteratorsMarvin Löbel-9/+82
2015-04-05Implemented remaining string pattern iterators.Marvin Löbel-344/+478
- Added missing reverse versions of methods - Added [r]matches() - Generated the string pattern iterators with a macro - Added where bounds to the methods returning reverse iterators for better error messages.
2015-04-05Auto merge of #24067 - apasel422:patch-1, r=Gankrobors-4/+4
Per [RFC #0505](https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#formatting).
2015-04-04Auto merge of #24045 - frewsxcv:cleanup, r=alexcrichtonbors-90/+62
2015-04-04s/Perform/Performs/Andrew Paseltiner-4/+4
Per [RFC #0505](https://github.com/rust-lang/rfcs/blob/master/text/0505-api-comment-conventions.md#formatting).
2015-04-04Rollup merge of #24039 - frewsxcv:patch-10, r=steveklabnikManish Goregaokar-7/+5
2015-04-04Rollup merge of #24038 - frewsxcv:patch-9, r=steveklabnikManish Goregaokar-6/+2
2015-04-04Rollup merge of #23996 - frewsxcv:patch-8, r=alexcrichtonManish Goregaokar-1/+1
2015-04-03Cleanup and modernize some things in libcore::iterCorey Farwell-90/+62
2015-04-03Make example function in comment more idiomaticCorey Farwell-7/+5
2015-04-03Simplify `match` branches in documentation commentCorey Farwell-6/+2
2015-04-03Revert accidental change from stable -> unstable; just meant toNiko Matsakis-4/+4
deprecate (though these will likely be purged for 1.0).
2015-04-03Auto merge of #23938 - nikomatsakis:invariant, r=pnkfelixbors-73/+35
There are still some remnants we could remove from the compiler (e.g. references to "subtraitrefs"; traits still have variance entries in the variance table), but this removes all user-visible bits I believe. r? @pnkfelix Fixes #22806 (since such traits would no longer exist)
2015-04-03Auto merge of #23934 - lfairy:write-no-deref, r=alexcrichtonbors-1/+1
This means passing in e.g. a `Vec<u8>` or `String` will work as intended, rather than deref-ing to `&mut [u8]` or `&mut str`. [breaking-change] Closes #23768
2015-04-02Indicate associated type in comment is code-likeCorey Farwell-1/+1
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-5/+5
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-02Remove *most* mentions of phantom fns and variance on traits. Leave someNiko Matsakis-6/+22
comments and also leave the entries in the variance tables for now.
2015-04-02Deprecate MarkerTrait and PhantomFn.Niko Matsakis-67/+13