about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-07-06Significantly improve formatter trait docsSteve Klabnik-11/+300
Each formatting trait now has an example of implementation, as well as a fuller description of what it's supposed to output. It also contains a link to the module-level documentation which Fixes #25765
2015-07-05Auto merge of #26473 - Eljay:missing_docs, r=alexcrichtonbors-0/+35
Fixes #24249 I've tagged all items that were missing docs to allow them to compile for now, the ones in core/num should probably be documented at least. This is also a breaking change for any crates using `#[deny(missing_docs)]` that have undocumented constants, not sure there is any way to avoid this without making it a separate lint?
2015-07-05option: obey idiom of leaving behind a trailing comma in match blocksTshepang Lekhonkhobe-15/+15
2015-07-04Add missing #[inline] to min_value/max_value on integersUlrik Sverdrup-0/+2
Spotted a compiled function call to num::usize::min_value, I'd prefer the 0 to be inlined.
2015-07-04core: Use memcmp in is_prefix_of / is_suffix_ofUlrik Sverdrup-5/+4
The basic str equality in core::str calls memcmp, re-use the same function in StrSearcher's is_prefix_of, is_suffix_of.
2015-07-03Auto merge of #26378 - arielb1:unused-mut, r=pnkfelixbors-2/+2
This makes it somewhat more aggressive, so this is kind-of a [breaking-change] for these compiling with `#[deny(unused_mut)]`. r? @pnkfelix
2015-07-04Update atomic.rsWei-Ming Yang-9/+0
Remove the tagged attribute `stable` from all private functions
2015-07-02Auto merge of #26725 - tshepang:patch-2, r=blussbors-1/+1
2015-07-01doc: add missing spaceTshepang Lekhonkhobe-1/+1
2015-07-01doc: there is just one trait in hereTshepang Lekhonkhobe-2/+0
Also, the info is repeated in the following paragraph
2015-07-01Auto merge of #26698 - alexcrichton:char-fmt, r=huonwbors-1/+8
This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625
2015-06-30std: Fix formatting flags for charsAlex Crichton-1/+8
This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625
2015-07-01Make the unused_mut lint smarter with respect to locals.Ariel Ben-Yehuda-2/+2
Fixes #26332
2015-06-30Rollup merge of #26692 - steveklabnik:gh26620, r=alexcrichtonSteve Klabnik-0/+2
Fixes #26620
2015-06-30Make note of Ord's derive orderingSteve Klabnik-0/+2
Fixes #26620
2015-06-30Rollup merge of #26678 - bluss:doc-fmt, r=steveklabnikSteve Klabnik-1/+4
fmt: Update docs and mention :#? pretty-printing Expose `:#?` well in the docs for fmt and Debug itself. Also update some out of date information and fix formatting in `std::fmt` docs.
2015-06-30Auto merge of #26327 - bluss:two-way, r=aturonbors-440/+579
Update substring search to use the Two Way algorithm To improve our substring search performance, revive the two way searcher and adapt it to the Pattern API. Fixes #25483, a performance bug: that particular case now completes faster in optimized rust than in ruby (but they share the same order of magnitude). Many thanks to @gereeter who helped me understand the reverse case better and wrote the comment explaining `next_back` in the code. I had quickcheck to fuzz test forward and reverse searching thoroughly. The two way searcher implements both forward and reverse search, but not double ended search. The forward and reverse parts of the two way searcher are completely independent. The two way searcher algorithm has very small, constant space overhead, requiring no dynamic allocation. Our implementation is relatively fast, especially due to the `byteset` addition to the algorithm, which speeds up many no-match cases. A bad case for the two way algorithm is: ``` let haystack = (0..10_000).map(|_| "dac").collect::<String>(); let needle = (0..100).map(|_| "bac").collect::<String>()); ``` For this particular case, two way is not much faster than the naive implementation it replaces.
2015-06-30Auto merge of #26664 - steveklabnik:gh26571, r=alexcrichtonbors-2/+39
This was pretty misleading, so let's improve. Fixes #26571
2015-06-30fmt: Update docs and mention :#? pretty-printingUlrik Sverdrup-1/+4
2015-06-29Improve doc for std::mem::dropSteve Klabnik-2/+39
This was pretty misleading, so let's improve. Fixes #26571
2015-06-29Refine Atomic*::compare_and_swap documentationSimonas Kazlauskas-23/+23
Namely: * Change parameter `old` to read `current` so it is clearer what the argument refers to (originally suggested `expected`, but shot down by Steve); * Add some formatting and fix some mistakes like referring to the method as `swap` rather than `compare_and_swap`.
2015-06-27std: Avoid missing fns on i686-pc-windows-msvcAlex Crichton-21/+83
It turns out that the 32-bit toolchain for MSVC has many of these functions as `static inline` functions in header files so there's not actually a symbol for Rust to call. All of the implementations just cast floats to their 64-bit variants and then cast back to 32-bit at the end, so the standard library now takes this strategy.
2015-06-27Auto merge of #26609 - huonw:align, r=alexcrichtonbors-2/+2
These will first be deprecated in 1.2.0, not 1.1.0.
2015-06-26core: fix deprecation since version of align_of_min.Huon Wilson-2/+2
These will first be deprecated in 1.2.0, not 1.1.0.
2015-06-26Use Box::into_raw rather than the deprecated boxed::into_raw in tests and ↵Ms2ger-6/+4
documentation.
2015-06-24Make `align_of` behave like `min_align_of`.Huon Wilson-13/+7
This removes a footgun, since it is a reasonable assumption to make that pointers to `T` will be aligned to `align_of::<T>()`. This also matches the behaviour of C/C++. `min_align_of` is now deprecated. Closes #21611.
2015-06-24StrSearcher: Explicitly separate the long and short casesUlrik Sverdrup-5/+11
This is needed to not drop performance, after the trait-based changes. Force separate versions of the next method to be generated for the short and long period cases.
2015-06-21StrSearcher: Use trait to specialize two way algorithm by caseUlrik Sverdrup-57/+133
Use a trait to be able to implement both the fast search that skips to each match, and the slower search that emits `Reject` intervals regularly. The latter is important for uses of `next_reject`.
2015-06-21StrSearcher: Specialize is_prefix_of/is_suffix_of for &strUlrik Sverdrup-17/+33
2015-06-21StrSearcher: Update substring search to use the Two Way algorithmUlrik Sverdrup-425/+466
To improve our substring search performance, revive the two way searcher and adapt it to the Pattern API. Fixes #25483, a performance bug: that particular case now completes faster in optimized rust than in ruby (but they share the same order of magnitude). Much thanks to @gereeter who helped me understand the reverse case better and wrote the comment explaining `next_back` in the code. I had quickcheck to fuzz test forward and reverse searching thoroughly. The two way searcher implements both forward and reverse search, but not double ended search. The forward and reverse parts of the two way searcher are completely independent. The two way searcher algorithm has very small, constant space overhead, requiring no dynamic allocation. Our implementation is relatively fast, especially due to the `byteset` addition to the algorithm, which speeds up many no-match cases. A bad case for the two way algorithm is: ``` let haystack = (0..10_000).map(|_| "dac").collect::<String>(); let needle = (0..100).map(|_| "bac").collect::<String>()); ``` For this particular case, two way is not much faster than the naive implementation it replaces.
2015-06-21Temp fix for all constants that are missing docs.Eljay-0/+35
2015-06-21Auto merge of #26450 - rick68:patch-7, r=alexcrichtonbors-2/+1
`core::num::from_str_radix` can't parse the prefix `+` . http://is.gd/ewo0T2
2015-06-20Update mod.rsWei-Ming Yang-2/+1
`core::num::from_str_radix` can't parse the prefix `+` . http://is.gd/ewo0T2
2015-06-19add note for future type-system adventurersAlexis Beingessner-0/+5
2015-06-17std: Hide some internal functions more aggressivelyAlex Crichton-2/+4
* Add `#[doc(hidden)]` * Rename away from `Error::description`
2015-06-17std: Update stable since for `core::char`Alex Crichton-1/+3
Also add `#[doc(hidden)]` to a few internal functions.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-2/+24
2015-06-17std: Stabilize the `str_matches` featureAlex Crichton-2/+2
This commit stabilizes the `str::{matches, rmatches}` functions and iterators, but renames the unstable feature for the `str::{matches,rmatches}_indices` function to `str_match_indices` due to the comment present on the functions about the iterator's return value.
2015-06-17std: Stabilize the `iter_{once,empty}` featuresAlex Crichton-12/+12
This commit stabilizes these two iterator primitives as they have gone through the RFC process and had some time to bake now.
2015-06-17std: Stabilize the remaining wrapping_* functionsAlex Crichton-10/+10
This commit stabilizes the remaining `wrapping_*` functions on the primitive integer types as they follow the same conventions as other wrapping methods are were likely just initially unstable to be conservative.
2015-06-17std: Deprecate f{32,64}::consts::PI_2Alex Crichton-0/+2
These constants have been unstable for some time now already
2015-06-17std: Remove two internal `str_internals` functionsAlex Crichton-4/+2
These were just exposed to be used elsewhere at some point, but neither is currently being used so just make them private again.
2015-06-17std: Deprecate the IntSliceExt traitAlex Crichton-0/+4
This trait has seen very little usage and while safe, may not belong in the standard library.
2015-06-17std: Deprecate result::foldAlex Crichton-0/+3
This function has seen very little use and it seems better to explore this functionality through iterator adaptors instead of specialized functions.
2015-06-17std: Deprecate the copy_{,mut_}lifetime functionsAlex Crichton-0/+8
Unsafe patterns such as `slice::from_raw_parts` and `CStr::from_ptr` have shown that dealing with lifetimes, while useful, is often a hindrance. Consequently these functions are rarely called today and are being deprecated.
2015-06-17std: Deprecate iter::{Unfold, Iterate}Alex Crichton-0/+12
Neither of these iterators has seen enough usage to justify their position in the standard library, so these unstable iterators are being slated for deletion.
2015-06-17std: Deprecate the RandomAccessIterator traitAlex Crichton-0/+4
This trait has not proven itself over time as being core and fundamentally useful to iterators, so it's being deprecated to allow time to iterate on it out of tree.
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-24/+24
2015-06-17core: Split apart the global `core` featureAlex Crichton-232/+258
This commit shards the broad `core` feature of the libcore library into finer grained features. This split groups together similar APIs and enables tracking each API separately, giving a better sense of where each feature is within the stabilization process. A few minor APIs were deprecated along the way: * Iterator::reverse_in_place * marker::NoCopy
2015-06-17Auto merge of #26261 - tshepang:more-brief-example, r=huonwbors-11/+2
Also, it feels more suitable to use hex to represent unicode