core: simplify `Extend` for tuples
This is an alternative to https://github.com/rust-lang/rust/pull/137400. The current macro is incredibly complicated and introduces subtle bugs like calling the `extend_one` of the individual collections in backwards order. This PR drastically simplifies the macro by removing recursion and moving the specialization out of the macro. It also fixes the ordering issue described above (I've stolen the test of the new behaviour from https://github.com/rust-lang/rust/pull/137400). Additionally, the 1-tuple is now special-cased to allow taking advantage of the well-optimized `Extend` implementations of the individual collection.
f16_f128: enable some more tests in Miri
For some reason, a bunch of tests were disabled in Miri that don't use any fancy intrinsics. Let's enable them.
I verified this with `./x miri library/core --no-doc -- float`.
r? `@tgross35`
Improve `core::ptr` coverage
This PR improves the `core::ptr` coverage by adding a new test to `coretests` for the `<*const T>::is_aligned_to` method.
r? libs
Remove `div_rem` from `core::num::bignum`
This fixes very old fixme that sounds like this
```
Stupid slow base-2 long division taken from
https://en.wikipedia.org/wiki/Division_algorithm
FIXME use a greater base ($ty) for the long division.
```
By deleting this method since it was never used
Improve `core::hash` coverage
This PR improves the `core::hash` coverage by adding a new test to `coretests` and extending one of the existing tests to use 128-bit integers
r? libs
Improve `alloc::Layout` coverage
This PR improves the `core::alloc` coverage by adding a new test to `coretests` that cover the `Layout` methods when they error.
Tracking issue: https://github.com/rust-lang/rust/issues/55724
Unify and deduplicate bits conv float tests
cc rust-lang/rust#141726
This is a proposal to unify and deduplicate the bits conv tests for f16, f32, f64 and f128
single buffer for exponent fmt of integers
No need for fragmented buffers when formatting.
```
orig.txt: fmt::write_i128_exp 143.39ns/iter +/- 0.32
orig.txt: fmt::write_i64_exp 68.72ns/iter +/- 0.03
new.txt: fmt::write_i128_exp 138.29ns/iter +/- 0.50
new.txt: fmt::write_i64_exp 58.93ns/iter +/- 4.62
```
This patch fully eliminates unsafe pointer use (after rust-lang/rust#135265 and rust-lang/rust#136594).
r? libs
Unify and deduplicate algebraic float tests
cc rust-lang/rust#141726
This is a proposal to unify and deduplicate the algebraic tests for f16, f32, f64 and f128
Implement Integer funnel shifts
Tracking issue: rust-lang/rust#145686
ACP: https://github.com/rust-lang/libs-team/issues/642
This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else
Thanks `@folkertdev` for the fixes and tests
cc `@rust-lang/libs-api`
Constify conversion traits (part 1)
This is the first part of rust-lang/rust#144289 being split into smaller pieces. It adds/moves constness of several traits under the `const_convert` feature:
* `From`
* `Into`
* `TryFrom`
* `TryInto`
* `FromStr`
* `AsRef`
* `AsMut`
* `Borrow`
* `BorrowMut`
* `Deref`
* `DerefMut`
There are a few methods that are intrinsically tied to these traits which I've included in the feature. Particularly, those which are wrappers over `AsRef`:
* `ByteStr::new` (unstable under `bstr` feature)
* `OsStr::new`
* `Path::new`
Those which directly use `Into`:
* `Result::into_ok`
* `Result::into_err`
And those which use `Deref` and `DerefMut`:
* `Pin::as_ref`
* `Pin::as_mut`
* `Pin::as_deref_mut`
* `Option::as_deref`
* `Option::as_deref_mut`
* `Result::as_deref`
* `Result::as_deref_mut`
(note: the `Option` and `Result` methods were suggested by ``@npmccallum`` initially as rust-lang/rust#146101)
The parts which are missing from this PR are:
* Anything that involves heap-allocated types
* Making any method const than the ones listed above
* Anything that could rely on the above, *or* could rely on system-specific code for `OsStr` or `Path` (note: this mostly makes these methods useless since `str` doesn't implement `AsRef<OsStr>` yet, but it's better to track the method for now and add impls later, IMHO)
r? ``@tgross35`` (who mostly already reviewed this)