about summary refs log tree commit diff
path: root/library/coretests/tests
AgeCommit message (Collapse)AuthorLines
2025-07-20Rollup merge of #143604 - nxsaken:const_float_round_methods, r=RalfJungMatthias Krüger-1/+0
Stabilize `const_float_round_methods` Closes rust-lang/rust#141555, waiting for FCP.
2025-07-20Stabilize `const_float_round_methods`Nurzhan Sakén-1/+0
2025-07-19fix load-bearing typoRémy Rakic-1/+1
2025-07-19Rollup merge of #141076 - the8472:fix-zip-panic-safety2, r=workingjubileeMatthias Krüger-34/+88
fix Zip unsoundness (again) Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. #82292 tried to fix unsoundness (#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (#86443), but the fix #86452 didn't fix it for nested Zip iterators (#137255). Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in #83791 but we haven't made use of that so far. fixes #137255
2025-07-17Rollup merge of #143829 - a1phyr:trim_borrowed_buf, r=ChrisDentonLeón Orell Valerian Liehr-6/+2
Trim `BorrowedCursor` API This PR removes some method from the unstable `BorrowedCursor` type. A rational for each change can be found in the message of each commit. I don't think that an ACP is required for this, please tell me if it is not the case. Cc rust-lang/rust#78485 rust-lang/rust#117693
2025-07-16Rollup merge of #143738 - rocurley:float_tests_refactor_2, r=tgross35Samuel Tardieu-615/+268
Move several float tests to floats/mod.rs This PR moves several tests to `floats/mod.rs`, as discussed in https://github.com/rust-lang/rust/issues/141726. The tests moved are: - `test_num_f*` - `test_infinity` - `test_neg_infinity` - `test_zero` - `test_neg_zero` - `test_one` - `test_is_nan` - `test_is_infinite` - `test_is_finite` - `test_is_normal` - `test_classify` Each test is its own commit, so it may be easiest to review each commit individually. r? tgross35
2025-07-14Auto merge of #142885 - a1phyr:borrowed_cursor_to_buf, r=Mark-Simulacrumbors-0/+36
core: Add `BorrowedCursor::with_unfilled_buf` Implementation of https://github.com/rust-lang/libs-team/issues/367. This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`. Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly. Cc rust-lang/rust#78485 rust-lang/rust#117693
2025-07-13Auto merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petrochenkovbors-3/+12
make `cfg_select` a builtin macro tracking issue: https://github.com/rust-lang/rust/issues/115585 This parses mostly the same as the `macro cfg_select` version, except: 1. wrapping in double brackets is no longer supported (or needed): `cfg_select {{ /* ... */ }}` is now rejected. 2. in an expression context, the rhs is no longer wrapped in a block, so that this now works: ```rust fn main() { println!(cfg_select! { unix => { "foo" } _ => { "bar" } }); } ``` 3. a single wildcard rule is now supported: `cfg_select { _ => 1 }` now works I've also added an error if none of the rules evaluate to true, and warnings for any arms that follow the `_` wildcard rule. cc `@traviscross` if I'm missing any feature that should/should not be included r? `@petrochenkov` for the macro logic details
2025-07-13make `cfg_select` a builtin macroFolkert de Vries-3/+12
2025-07-11Consolidate classify testsRoger Curley-71/+23
2025-07-11Consolidate is_normal testsRoger Curley-82/+51
2025-07-11Consolidate is_finite testsRoger Curley-52/+22
2025-07-11Consolidate is_infinite testsRoger Curley-52/+22
2025-07-11Consolidate is_nanRoger Curley-52/+22
2025-07-11Consolidate one testsRoger Curley-52/+19
2025-07-11Consolidate negative zero testsRoger Curley-56/+20
2025-07-11Consolidate zero testsRoger Curley-52/+19
2025-07-11Consolidate neg_infinity testsRoger Curley-48/+18
2025-07-11Consolidate test_num testsRoger Curley-50/+34
2025-07-11Consolidate infinity testsRoger Curley-48/+18
2025-07-10Auto merge of #143721 - tgross35:rollup-sjdfp6r, r=tgross35bors-56/+23
Rollup of 9 pull requests Successful merges: - rust-lang/rust#141996 (Fix `proc_macro::Ident`'s handling of `$crate`) - rust-lang/rust#142950 (mbe: Rework diagnostics for metavariable expressions) - rust-lang/rust#143011 (Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps) - rust-lang/rust#143265 (Mention as_chunks in the docs for chunks) - rust-lang/rust#143270 (tests/codegen/enum/enum-match.rs: accept negative range attribute) - rust-lang/rust#143298 (`tests/ui`: A New Order [23/N]) - rust-lang/rust#143396 (Move NaN tests to floats/mod.rs) - rust-lang/rust#143398 (tidy: add support for `--extra-checks=auto:` feature) - rust-lang/rust#143644 (Add triagebot stdarch mention ping) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-09Refactor nan testsRoger Curley-56/+23
2025-07-09Add opaque TypeId handles for CTFEOli Scherer-8/+0
2025-07-09core: Change `BorrowedCursor::written`'s originBenoît du Garreau-1/+1
This enable removing the `start` field, so `BorrowedCursor` fits in a single register. Because `written` is almost always used in difference with another call, this changes nothing else in practice.
2025-07-09core: Remove `BorrowedCursor::uninit_mut`Benoît du Garreau-2/+0
I assume that this method was there for completeness, but there is hardly any useful use of it: the buffer it gave was not always connected to the start of the cursor and its use required `unsafe` anyway to mark the bytes as initialized.
2025-07-09core: Remove `BorrowedCursor::init_ref` methodBenoît du Garreau-3/+1
This method was not really useful: at no point one would only need to read the initialized part of the cursor without mutating it.
2025-07-04Rollup merge of #142749 - LimpSquid:bool_to_result, r=scottmcmJacob Pratt-0/+9
Add methods for converting bool to `Result<(), E>` ## Tracking Issue https://github.com/rust-lang/rust/issues/142748 ## ACP https://github.com/rust-lang/libs-team/issues/606
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-2/+2
2025-07-01core: Add `BorrowedCursor::with_unfilled_buf`Benoît du Garreau-0/+36
Implementation of https://github.com/rust-lang/libs-team/issues/367. This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`. Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly.
2025-06-27Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errorsbors-0/+75
Rollup of 18 pull requests Successful merges: - rust-lang/rust#137843 (make RefCell unstably const) - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - rust-lang/rust#142549 (small iter.intersperse.fold() optimization) - rust-lang/rust#142637 (Remove some glob imports from the type system) - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - rust-lang/rust#142700 (Remove incorrect comments in `Weak`) - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`) - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition) - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - rust-lang/rust#143001 (Rename run always ) - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`) - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes) - rust-lang/rust#143041 (Remove cache for citool) - rust-lang/rust#143056 (Move an ACE test out of the GCI directory) - rust-lang/rust#143059 (Fix 1.88 relnotes) - rust-lang/rust#143067 (Tracking issue number for `iter_macro`) - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains) Failed merges: - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-25make RefCell unstably constDaniel Bloom-0/+75
2025-06-25make `tidy-alphabetical` use a natural sortFolkert de Vries-1/+1
2025-06-20Rollup merge of #142668 - hkBst:less-static-mut, r=tgross35Trevor Gross-17/+13
vec_deque/fmt/vec tests: remove static mut More rust-lang/rust#125035. r? ```@tgross35```
2025-06-19Add methods for converting bool to `Result<(), E>`LimpSquid-0/+9
2025-06-19atomic tests: remove static mutMarijn Schouten-17/+13
2025-06-18Add test for new format_args!() temporary lifetimes.Mara Bos-0/+15
2025-06-16Rollup merge of #142373 - m-ou-se:debug-for-location, r=tgross35Jakub Beránek-0/+8
Fix Debug for Location Fixes https://github.com/rust-lang/rust/issues/142279
2025-06-16Test Debug for Location.Mara Bos-0/+8
2025-06-14Rollup merge of #142243 - RalfJung:float-test-dedup, r=tgross35Matthias Krüger-676/+308
float tests: deduplicate min, max, and rounding tests Part of https://github.com/rust-lang/rust/issues/141726 Best reviewed commit-by-commit. - Use `assert_biteq!` in the `mod.rs` tests. This requires some trickery to make shadowing macros with imports work. - The min, max, minimum, maximum tests in `tests/floats/f*.rs` are entirely subsumed by what we already have in `tests/float/mod.rs`, so I just removed them. - The rounding tests (floor etc) in `f*.rs` had more test points, so I copied them over. They didn't have `0.5` and `-0.5` though which seem like interesting points in particular regarding the sign of the resulting zero if that's what it sounds to, and they didn't max min/max/inf/nan tests, so this was really a merger of both tests. r? ``@tgross35``
2025-06-14Rollup merge of #141811 - mejrs:bye_locals, r=compiler-errorsMatthias Krüger-1/+0
Unimplement unsized_locals Implements https://github.com/rust-lang/compiler-team/issues/630 Tracking issue here: https://github.com/rust-lang/rust/issues/111942 Note that this just removes the feature, not the implementation, and does not touch `unsized_fn_params`. This is because it is required to support `Box<dyn FnOnce()>: FnOnce()`. There may be more that should be removed (possibly in follow up prs) - the `forget_unsized` function and `forget` intrinsic. - the `unsized_locals` test directory; I've just fixed up the tests for now - various codegen support for unsized values and allocas cc ``@JakobDegen`` ``@oli-obk`` ``@Noratrieb`` ``@programmerjake`` ``@bjorn3`` ``@rustbot`` label F-unsized_locals Fixes rust-lang/rust#79409
2025-06-13tweak runtime/const macro managementRalf Jung-44/+49
2025-06-13Unimplement unsized_localsmejrs-1/+0
2025-06-12Delegate `<CStr as Debug>` to `ByteStr`Tamir Duberstein-1/+1
This allows UTF-8 characters to be printed without escapes, rather than just ASCII.
2025-06-12Auto merge of #136594 - pascaldekloe:fmt-int128, r=tgross35bors-36/+121
Faster fmt::Display of 128-bit integers, without unsafe pointer In followup of #135265, hereby the 128-bit part. * Batches per 16 instead of 19 digits * Buffer access as array insteaf of unsafe pointer * Added test coverage for i128 and u128 r? tgross35 ChrisDenton
2025-06-11feat: Add `bit_width` for unsigned integer typesShun Sakai-0/+9
2025-06-10format integer tests regrouped, min/max coverage and 128-bit coveragePascal S. de Kloe-36/+121
2025-06-09Auto merge of #138062 - LorrensP-2158466:miri-enable-float-nondet, r=RalfJungbors-5/+12
Enable Non-determinism of float operations in Miri and change std tests Links to [#4208](https://github.com/rust-lang/miri/issues/4208) and [#3555](https://github.com/rust-lang/miri/issues/3555) in Miri. Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them. This pr includes the following changes: - Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP - These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [#4286](https://github.com/rust-lang/miri/issues/4286#issue-3010677983) - Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`. - Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds` - Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed. - Added tests in the float tests of Miri to test the C23 behaviour. Fixes https://github.com/rust-lang/miri/issues/4208
2025-06-09float midpoint tests: add missing NAN casesRalf Jung-0/+2
2025-06-09make the default float comparison tolerance type-dependentRalf Jung-15/+31
2025-06-09float tests: deduplicate min, max, and rounding testsRalf Jung-456/+56