| Age | Commit message (Collapse) | Author | Lines |
|
Stabilize `Option::as_deref` and `Option::as_deref_mut`
The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
|
|
r=alexcrichton"
This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing
changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
|
|
|
|
|
|
- Refactors the Emscripten target spec to share code with other wasm
targets.
- Replaces the incorrect wasm32 C call ABI with the old asmjs
version, which is correct for both wasm32 and JS.
- Updates the varargs ABI used by Emscripten and deletes the old one.
- Removes the obsolete wasm32-experimental-emscripten target.
- Temporarily makes Emscripten targets use panic=abort by default
because supporting unwinding will require an LLVM patch.
|
|
Stabilize todo macro
The `todo!` macro is just another name for `unimplemented!`.
Tracking issue: https://github.com/rust-lang/rust/issues/59277
This PR needs a FCP to merge.
r? @withoutboats
|
|
To make `new` method appear first in documentation.
|
|
Inline `{min,max}_value` even in debug builds
I think it is worth to inline `{min,max}_value` even in debug builds.
See this godbolt link: https://godbolt.org/z/-COkVS
|
|
Those two are const fn and do not have any arguments. Inlining
helps reducing generated code size in debug builds.
|
|
|
|
use try_fold instead of try_for_each to reduce compile time
as it was stated in #64572 that the biggest gain was due to less code was generated I tried to reduce the number of functions to inline by using try_fold direct instead of calling try_for_each that calls try_fold.
as there is some gains with using the try_fold function this is maybe a way forward.
when I tried to compile the clap-rs benchmark I get times gains only some % from #64572
there is more function that use eg. fold that calls try_fold that also can be changed but the question is how mush "duplication" that is tolerated in std to give faster compile times
can someone start a perf run?
cc @nnethercote @scottmcm @bluss
r? @ghost
|
|
Add lower bound doctests for `saturating_{add,sub}` signed ints
Closes #64940
|
|
Remove unneeded `fn main` blocks from docs
## [No whitespace diff](https://github.com/rust-lang/rust/pull/64912/files?w=1)
|
|
|
|
removes two functions to inline by combining the check functions and extra call to try_for_each
|
|
|
|
|
|
Add missing links for mem::needs_drop
r? @jonas-schievink
|
|
Fixed a misleading documentation issue #64844
Made the suggested change from @steveklabnik on issue #64844
|
|
|
|
Remove manual unrolling from slice::Iter(Mut)::try_fold
While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone.
I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545).
---
For context see https://github.com/rust-lang/rust/pull/64572#issuecomment-532961046
|
|
|
|
Improve wording in documentation of MaybeUninit
Changes
> variables are properly initialized **at** their respective type
into
> variables are properly initialized **as** their respective type
|
|
|
|
|
|
reserve `impl<T> From<!> for T`
this is necessary for never-type stabilization.
cc #57012 #35121
I think we wanted a crater run for this @nikomatsakis?
r? @nikomatsakis
|
|
|
|
Master is now 1.40
r? @pietroalbini
|
|
use `sign` variable in abs and wrapping_abs methods
This also makes the code easier to understand by hinting at the significance of `self >> ($BITS - 1)`.
Also, now `overflowing_abs` simply uses `wrapping_abs`, which is clearer and avoids a potential performance regression in the LLVM IR.
This PR follows from the discussion from #63786.
r? @eddyb
cc @nikic
|
|
|
|
update mem::discriminant test to use assert_eq and assert_ne over comparison operators
Use assert_eq and assert_ne over comparison operators.
|
|
Document the unstable iter_order_by library feature
Tracking issue: #64295
Follow-up for: #62205
References the tracking issue and adds a page to the unstable book for the new unstable `iter_order_by` feature.
|
|
|
|
|
|
|
|
this is necessary for never-type stabilization
|
|
|
|
|
|
Use assert_eq and assert_ne over comparison operators.
|
|
|
|
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently
requires a submodule update of `stdarch` to fix a problem with previous
compilers.
|
|
The tracking issue https://github.com/rust-lang/rust/issues/50264
still has unresolved question for the corresponding `Result` methods.
|
|
While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone.
I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545).
|
|
Exempt extern "Rust" from improper_ctypes
It should be fine for Rust ABIs to involve any Rust type.
Fixes #64593.
|
|
Add `cmp::{min_by, min_by_key, max_by, max_by_key}`
This adds the following functions to `core::cmp`:
- `min_by`
- `min_by_key`
- `max_by`
- `max_by_key`
`min_by` and `max_by` are somewhat trivial to implement, but not entirely because `min_by` returns the first value in case the two are equal (and `max_by` the second). `min` and `max` can be implemented in terms of `min_by` and `max_by`, but not as easily the other way around.
To give an example of why I think these functions could be useful: the `Iterator::{min_by, min_by_key, max_by, max_by_key}` methods all currently hard-code the behavior mentioned above which is an ever so small duplication of logic. If we delegate them to `cmp::{min_by, max_by}` methods instead, we get the correct behavior for free. (edit: this is now included in the PR)
I added `min_by_key` / `max_by_key` for consistency's sake but I wouldn't mind removing them. I don't have a particular use case in mind for them, and `min_by` / `max_by` seem to be more useful.
Tracking issue: #64460
|
|
It should be fine for Rust ABIs to involve any Rust type.
|
|
r=alexcrichton
PR: documentation spin loop hint
The documentation for 'spin loop hint' explains that yield is better if the lock holder is running on the same CPU. I suggest that 'CPU or core' would be clearer.
|
|
|
|
|
|
Add an example to Pin::as_mut
https://github.com/taiki-e/pin-project/issues/89#issuecomment-531701172
r? @RalfJung
|