| Age | Commit message (Collapse) | Author | Lines |
|
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
|
|
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?
|
|
|
|
Spotted a compiled function call to num::usize::min_value, I'd prefer
the 0 to be inlined.
|
|
The basic str equality in core::str calls memcmp, re-use the same
function in StrSearcher's is_prefix_of, is_suffix_of.
|
|
This makes it somewhat more aggressive, so this is kind-of a [breaking-change] for these compiling with `#[deny(unused_mut)]`.
r? @pnkfelix
|
|
Remove the tagged attribute `stable` from all private functions
|
|
|
|
|
|
Also, the info is repeated in the following paragraph
|
|
This recently regressed in #24689, and this updates the `Display` implementation
to take formatting flags into account.
Closes #26625
|
|
This recently regressed in #24689, and this updates the `Display` implementation
to take formatting flags into account.
Closes #26625
|
|
Fixes #26332
|
|
Fixes #26620
|
|
Fixes #26620
|
|
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.
|
|
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.
|
|
This was pretty misleading, so let's improve.
Fixes #26571
|
|
|
|
This was pretty misleading, so let's improve.
Fixes #26571
|
|
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`.
|
|
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.
|
|
These will first be deprecated in 1.2.0, not 1.1.0.
|
|
These will first be deprecated in 1.2.0, not 1.1.0.
|
|
documentation.
|
|
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.
|
|
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.
|
|
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`.
|
|
|
|
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.
|
|
|
|
`core::num::from_str_radix` can't parse the prefix `+` .
http://is.gd/ewo0T2
|
|
`core::num::from_str_radix` can't parse the prefix `+` .
http://is.gd/ewo0T2
|
|
|
|
* Add `#[doc(hidden)]`
* Rename away from `Error::description`
|
|
Also add `#[doc(hidden)]` to a few internal functions.
|
|
|
|
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.
|
|
This commit stabilizes these two iterator primitives as they have gone through
the RFC process and had some time to bake now.
|
|
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.
|
|
These constants have been unstable for some time now already
|
|
These were just exposed to be used elsewhere at some point, but neither is
currently being used so just make them private again.
|
|
This trait has seen very little usage and while safe, may not belong in the
standard library.
|
|
This function has seen very little use and it seems better to explore this
functionality through iterator adaptors instead of specialized functions.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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
|
|
Also, it feels more suitable to use hex to represent unicode
|