| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
part of #28810
|
|
Our docs were very basic for the various versions of from_utf8, so
this commit beefs them up.
It also improves docs for the &str variant's error, Utf8Error.
|
|
Our docs were very basic for the various versions of from_utf8, so
this commit beefs them up.
It also improves docs for the &str variant's error, Utf8Error.
|
|
fixes #26920
|
|
part of #28810
|
|
|
|
Using the comparison operators already refs the operands, so doing it
ourselves as well just adds an unnecessary level of indirection.
|
|
@marchelzo pointed out on IRC that this doesn't have docs, so, let's
change that.
|
|
Fixes #28166
|
|
@marchelzo pointed out on IRC that this doesn't have docs, so, let's
change that.
|
|
The links in the rustdoc for several places in fmt were trying to link to
the std::fmt module but actually linking to std, which was confusing.
While trying to figure out why I noticed that the documentation chapter of
the Rust book has examples that show this same bug (although it doesn't seem
widespread in practice).
r? @steveklabnik
|
|
|
|
Fixes #28166
|
|
The links in the rustdoc for several places in fmt were trying to link to
the std::fmt module but actually linking to std, which was confusing.
While trying to figure out why I noticed that the documentation chapter of
the Rust book has examples that show this same bug (although it doesn't seem
widespread in practice).
|
|
|
|
|
|
Remove redundant uses of Iterator::by_ref()
|
|
|
|
|
|
fixes #26920
|
|
The lifetime can be elided here, and I think eliding it makes the example slightly simpler.
|
|
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow
the same pattern as the `chars` and `char_indices` iterators. The `matches`
iterator currently yield `&str` elements, so the `MatchIndices` iterator now
yields the index of the match as well as the `&str` that matched (instead of
start/end indexes).
cc #27743
|
|
|
|
cc #27726
r? @alexcrichton
|
|
Caught by Brian Smith: https://github.com/rust-lang/rust/issues/27774#issuecomment-143154735
|
|
|
|
|
|
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow
the same pattern as the `chars` and `char_indices` iterators. The `matches`
iterator currently yield `&str` elements, so the `MatchIndices` iterator now
yields the index of the match as well as the `&str` that matched (instead of
start/end indexes).
cc #27743
|
|
Caught by Brian Smith: https://github.com/rust-lang/rust/issues/27774#issuecomment-143154735
|
|
[breaking-change]
`FixedSizeArray` is meant to be implemented for arrays of fixed size only, but can be implemented for anything at the moment. Marking the trait unsafe would make it more reasonable to write unsafe code which operates on fixed size arrays of any size.
For example, using `uninitialized` to create a fixed size array and immediately filling it with a fixed value is externally safe:
```
pub fn init_with_nones<T, A: FixedSizeArray<Option<T>>>() -> A {
let mut res = unsafe { mem::uninitialized() };
for elm in res.as_mut_slice().iter_mut() {
*elm = None;
}
res
}
```
But the same code is not safe if `FixedSizeArray` is implemented for other types:
```
struct Foo { foo: usize }
impl FixedSizeArray<Option<usize>> for Foo {
fn as_slice(&self) -> &[usize] { &[] }
fn as_mut_slice(&self) -> &mut [usize] { &mut [] }
}
```
now `init_with_nones() : Foo` returns a `Foo` with an undefined value for the field `foo`.
|
|
|
|
cc #27726
|
|
|
|
(12 was chosen to be consistent with what we do for tuples)
Fixes #28559
|
|
Move private bignum module to core::num, because it is not only used in flt2dec.
Extract private 80-bit soft-float into new core::num module for the same reason.
|
|
Move private bignum module to core::num, because it is not only used in flt2dec.
Extract private 80-bit soft-float into new core::num module for the same reason.
|
|
|
|
|
|
It's clear it's the one being documented
|
|
|
|
It's clear it's the one being documented
|
|
This branch improves the performance of Ord and PartialOrd methods for slices compared to the iter-based implementation.
Based on the approach used in #26884.
|
|
The explicit slicing is needed in order to enable additional range
check optimizations in the compiler.
|
|
Be more conservative with inlining.
|