about summary refs log tree commit diff
path: root/library/coretests
AgeCommit message (Collapse)AuthorLines
2025-09-30iter repeat: add tests for new count and last behaviorMarijn Schouten-0/+11
2025-09-26Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkovbors-0/+6
Extended temporary argument to format_args!() in all cases Fixes https://github.com/rust-lang/rust/issues/145880 by removing the special case.
2025-09-25Rollup merge of #146737 - RalfJung:f16-f128-miri, r=tgross35Stuart Cook-17/+15
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`
2025-09-25Rollup merge of #146735 - Qelxiros:const_mul_add, r=tgross35,RalfJungStuart Cook-80/+38
unstably constify float mul_add methods Tracking issue: rust-lang/rust#146724 r? `@tgross35`
2025-09-24unstably constify float mul_add methodsJeremy Smart-80/+38
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-24f16_f128: enable some more tests in MiriRalf Jung-17/+15
2025-09-22constify {float}::total_cmp()Nathaniel McCallum-86/+85
2025-09-21Rollup merge of #146486 - ferrocene:pvdrz/improve-atomic-coverage, r=ibraheemdevMatthias Krüger-4/+240
Improve `core::sync::atomic` coverage This PR improves the `core::sync::atomic` coverage by adding new tests to `coretests`. r? libs
2025-09-18Rollup merge of #146487 - ferrocene:pvdrz/improve-num-coverage, r=joboetMatthias Krüger-0/+7
Improve `core::num` coverage This PR improves the `core::num` coverage by adding a new test to `coretests`. r? libs
2025-09-16Rollup merge of #146474 - ferrocene:pvdrz/improve-ascii-coverage, r=NoratriebMatthias Krüger-0/+7
Improve `core::ascii` coverage This PR improves the `core::ascii` coverage by adding a new test to `coretests` r? `@workingjubilee`
2025-09-16Improve `core::sync::atomic` coverageChristian Poveda-4/+240
2025-09-16Improve `core::ascii` coverageChristian Poveda-0/+7
2025-09-15Rollup merge of #146488 - ferrocene:pvdrz/improve-ptr-coverage, ↵Matthias Krüger-0/+8
r=Mark-Simulacrum 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
2025-09-15Rollup merge of #146478 - ferrocene:pvdrz/improve-fmt-coverage, ↵Matthias Krüger-0/+52
r=Mark-Simulacrum Improve `core::fmt` coverage This PR improves the `core::fmt` coverage by adding new tests to `coretests`
2025-09-15Rollup merge of #146284 - Kivooeo:blazing-fast-division-bignum, ↵Matthias Krüger-19/+0
r=Mark-Simulacrum 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
2025-09-13Rollup merge of #146481 - ferrocene:pvdrz/improve-hash-coverage, r=jhprattJana Dönszelmann-0/+13
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
2025-09-13Rollup merge of #146477 - ferrocene:pvdrz/improve-char-coverage, r=NoratriebJana Dönszelmann-0/+44
Improve `core::char` coverage This PR improves the `core::char` coverage by adding new tests to `coretests` r? ``@workingjubilee``
2025-09-13Rollup merge of #146452 - ferrocene:pvdrz/improve-alloc-coverage, r=tgross35Jana Dönszelmann-0/+24
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
2025-09-12Improve `core::ptr` coverageChristian Poveda-0/+8
2025-09-12Improve `core::num` coverageChristian Poveda-0/+7
2025-09-12Improve `core::hash` coverageChristian Poveda-0/+13
2025-09-12Improve `core::fmt` coverageChristian Poveda-0/+52
2025-09-12Improve `core::char` coverageChristian Poveda-0/+44
2025-09-12Improve `core::alloc` coverageChristian Poveda-0/+24
2025-09-12Constify Eq, Ord, PartialOrdEvgenii Zheltonozhskii-4/+3
2025-09-11Rollup merge of #146425 - ferrocene:pvdrz/improve-array-coverage, ↵Stuart Cook-0/+7
r=workingjubilee Improve `core::array` coverage This PR improves the `core::array` coverage by adding new tests to `coretests`
2025-09-11Rollup merge of #146424 - ferrocene:pvdrz/improve-ops-coverage, r=workingjubileeStuart Cook-1/+75
Improve `core::ops` coverage This PR improves the `core::ops` coverage by adding new tests to `coretests`
2025-09-11Rollup merge of #146380 - rperier:unify_and_dedup_bits_conv_float_tests, ↵Stuart Cook-110/+63
r=tgross35 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
2025-09-10Improve `core::array` coverageChristian Poveda-0/+7
2025-09-10Update library/coretests/tests/ops.rsChristian Poveda Ruiz-1/+2
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-09-10Improve `core::ops` coverageChristian Poveda-1/+74
2025-09-10Unify and deduplicate bits conv float testsRomain Perier-110/+63
2025-09-08const-eval: disable pointer fragment supportRalf Jung-4/+5
2025-09-07remove unsused div_rem method from bignumKivooeo-19/+0
2025-09-06Rollup merge of #145940 - pascaldekloe:int-exp-tune, r=tgross35Trevor Gross-0/+24
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
2025-09-05Rollup merge of #146152 - rperier:unify_and_dedup_algebraic_float_tests, ↵Trevor Gross-83/+44
r=tgross35 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
2025-09-04Rollup merge of #145690 - sayantn:integer-funnel-shift, r=tgross35Jacob Pratt-0/+37
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`
2025-09-04Rollup merge of #143725 - kennytm:peekable_next_if_map, r=jhprattStuart Cook-0/+87
core: add Peekable::next_if_map Implementation for rust-lang/rust#143702
2025-09-03Rollup merge of #145279 - clarfonthey:const-convert-initial, r=tgross35Stuart Cook-2/+1
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)
2025-09-03Unify and deduplicate algebraic float testsRomain Perier-83/+44
2025-09-03Add `funnel_sh{l,r}` functions and intrinsicssayantn-0/+37
- Add a fallback implementation for the intrinsics - Add LLVM backend support for funnel shifts Co-Authored-By: folkertdev <folkert@folkertdev.nl>
2025-09-01Constify conversion traitsltdk-2/+1
2025-09-01Rollup merge of #145468 - karolzwolak:float-tests-dedup, r=tgross35Stuart Cook-243/+105
dedup recip, powi, to_degrees, and to_radians float tests Deduplicates recip, powi, to_degrees, and to_radians float tests. I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating. Part of rust-lang/rust#141726. Best reviewed commit-by-commit. r? `@tgross35`
2025-08-31dedup to_radians float testKarol Zwolak-68/+26
2025-08-31dedup to_degrees float testKarol Zwolak-59/+29
2025-08-31dedup powi float testKarol Zwolak-66/+28
2025-08-31Rollup merge of #145174 - 197g:issue-145148-select-unpredictable-drop, r=joboetMatthias Krüger-0/+36
Ensure consistent drop for panicking drop in hint::select_unpredictable There are a few alternatives to the implementation. The principal problem is that the selected value must be owned (in the sense of having a drop flag of sorts) when the unselected value is dropped, such that panic unwind goes through the drop of both. This ownership must then be passed on in return when the drop went smoothly. The basic way of achieving this is by extracting the selected value first, at the cost of relying on the optimizer a little more for detecting the copy as constructing the return value despite having a place in the body. Unfortunately, that causes LLVM to discard the !unpredictable annotation (for some reason that is beyond my comprehension of LLVM). <details> <summary>Extract from the build log showing an unannotated select being used</summary> ``` 2025-08-09T16:51:06.8790764Z 39: define noundef i64 `@test_int2(i1` noundef zeroext %p, i64 noundef %a, i64 noundef %b) unnamed_addr #0 personality ptr `@rust_eh_personality` { 2025-08-09T16:51:06.8791368Z check:47'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found 2025-08-09T16:51:06.8791700Z 40: start: 2025-08-09T16:51:06.8791858Z check:47'0 ~~~~~~~ 2025-08-09T16:51:06.8792043Z 41: %ret.i = select i1 %p, i64 %a, i64 %b 2025-08-09T16:51:06.8792293Z check:47'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2025-08-09T16:51:06.8792686Z check:47'1 ? possible intended match 2025-08-09T16:51:06.8792946Z 42: ret i64 %ret.i 2025-08-09T16:51:06.8793127Z check:47'0 ~~~~~~~~~~~~~~~~ ``` </details> So instead, this PR includes a guard to drop the selected `MaybeUnit<T>` which is active only for the section where the unselected value is dropped. That leaves the code for selecting the result intact leading to the expected ir. That complicates the 'unselection' process a little bit since we require _both_ values as a result of that intrinsic call. Since the arguments alias, this portion as well as the drop guard uses raw pointers. Closes: rust-lang/rust#145148 Prior: rust-lang/rust#139977
2025-08-30dedup recip float testKarol Zwolak-50/+22
I left the additional asserts on {f16, f128}::MAX.recip() in a new test_max_recip tests.
2025-08-30Clarify panic-drop test for select_unpredictableAurelia Molzer-4/+3
2025-08-30Rollup merge of #145969 - actuallylost:duration-from-nanos-128, r=tgross35Stuart Cook-0/+20
Add Duration::from_nanos_u128 Feature Gate: `#![feature(duration_from_nanos_u128)]` ACP: https://github.com/rust-lang/libs-team/issues/567 Tracking issue: https://github.com/rust-lang/rust/issues/139201 Recreated from https://github.com/rust-lang/rust/pull/139243