| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
Add simple docs example for struct Cell
|
|
|
|
This helps with vectorization in some cases, such as (0..u16::MAX).collect::<Vec<u16>>(),
as LLVM is able to change the loop condition to use equality instead of less than
|
|
|
|
CC #42034
|
|
doc: make into_iter example more concise
Also, remove dupe example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Stabilize more APIs for the 1.20.0 release
In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
|
|
Add missing impl and tests for int to int TryFrom impls
These were missing from #43248.
r? @nagisa
|
|
Make the "main" constructors of NonZero/Shared/Unique return Option
Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441.
This is a breaking change to unstable APIs.
The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts.
In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
|
|
Bump master to 1.21.0
This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.
|
|
Stabilizes
* `<&mut str>::as_bytes_mut`
* `<Box<str>>::into_boxed_bytes`
* `std::str::from_boxed_utf8_unchecked`
* `std::str::from_utf8_mut`
* `std::str::from_utf8_unchecked_mut`
Closes #41119
|
|
Stabilizes:
* `compile_error!` as a macro defined by rustc
Closes #40872
|
|
Stabilizes
* `core::mem::ManuallyDrop`
* `std::mem::ManuallyDrop`
* `ManuallyDrop::new`
* `ManuallyDrop::into_inner`
* `ManuallyDrop::drop`
* `Deref for ManuallyDrop`
* `DerefMut for ManuallyDrop`
Closes #40673
|
|
Stabilizes:
* `Utf8Error::error_len`
Closes #40494
|
|
Stabilized
* `<str>::get`
* `<str>::get_mut`
* `<str>::get_unchecked`
* `<str>::get_unchecked_mut`
Closes #39932
|
|
Stabilized:
* `Option::get_or_insert`
* `Option::get_or_insert_with`
Closes #39288
|
|
Stabilizes:
* `<char>::escape_debug`
* `std::char::EscapeDebug`
Closes #35068
|
|
This commit bumps the master branch's version to 1.21.0 and also updates the
bootstrap compiler from the freshly minted beta release.
|
|
|
|
Fix overflowing_literals lint for large f32s
Float literals need to be parsed as the correct type so they can be
rounded correctly.
|
|
improve the TryFrom implementations
This removes the need for a 128 bit storage by making use of the fact that there can be either no over/underflow, either one or both, and each time the target type suffices to hold the limit for comparison. This also means that the implementation will work in targets without 128bit support (unless it's for 128bit types, of course).
The downside is that the code looks a bit more complex.
|
|
|
|
|
|
This removes the need for a 128 bit storage by making use of the fact that
there can be either no over/underflow, either one or both, and each time
the target type suffices to hold the limit for comparison.
The downside is that the code looks a bit more complex.
This test code included in this commit is from @oyvindln 's PR. They also
greatly helped fixing a number of errors I made along the way. Thanks a lot!
|
|
|
|
|
|
|
|
Fix some doc/comment typos.
|
|
|
|
Add generic example of std::ops::Sub in doc comments
This PR adds an example of using generics with std::ops::Sub and is a follow up of PR #41612 and is related to issue #29365. I also wanted to add examples to Mul and Div, but I think these two traits are already loaded with examples.
|
|
|
|
doc: provide an actual equivalent to filter_map
|
|
|
|
Add missing `!: Clone` impl
Fixes #43296
(untested because I'm having computer troubles, but a one-liner can't break anything right?)
|
|
|
|
|