about summary refs log tree commit diff
path: root/library/alloc/tests/slice.rs
AgeCommit message (Collapse)AuthorLines
2023-01-04Update rand in the stdlib tests, and remove the getrandom feature from itThom Chiovoloni-348/+1
2022-05-29Use Box::new() instead of box syntax in alloc testsest31-7/+7
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-6/+6
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-01-08Change panic::update_hook to simplify usageBadel2-6/+4
And to remove possibility of panics while changing the panic handler, because that resulted in a double panic.
2022-01-07Implement panic::update_hookBadel2-6/+7
2021-10-12Make split_inclusive() on an empty slice yield an empty outputMartin von Zweigbergk-4/+4
`[].split_inclusive()` currently yields a single, empty slice. That's different from `"".split_inslusive()`, which yields no output at all. I think that makes the slice version harder to use. The case where I ran into this bug was when writing code for generating a diff between two slices of bytes. I wanted to prefix removed lines with "-" and a added lines with "+". Due to `split_inclusive()`'s current behavior, that means that my code prints just a "-" or "+" for empty files. I suspect most existing callers have similar "bugs" (which would be fixed by this patch). Closes #89716.
2021-08-13Improve wording, correct -> tight.Frank Steffahn-6/+6
2021-08-13Consistent use of `impl Trait` arguments in the test's helper function.Frank Steffahn-5/+1
2021-08-12Rewrite test from previous commit but without using macros.Frank Steffahn-64/+55
2021-08-12Test and fix size_hint for slice's [r]split* iteratorsFrank Steffahn-0/+74
Adds extensive test for all the [r]split* iterators. Fixes size_hint upper bound for split_inclusive* iterators which was one higher than necessary for non-empty slices. Fixes size_hint lower bound for [r]splitn* iterators when n==0, which was one too high.
2021-02-20Update the bootstrap compilerJoshua Nelson-1/+1
Note this does not change `core::derive` since it was merged after the beta bump.
2020-12-10Update the slice GroupBy/Mut testClément Renault-4/+16
2020-12-10Implement it with only safe codeClément Renault-10/+29
2020-12-10Introduce the GroupBy and GroupByMut IteratorsClément Renault-0/+27
2020-10-17Move subslice pattern tests to alloc/tests/slice.rsAlexis Bourget-0/+120
2020-09-03in-place collect for Vec. Box<[]> and BinaryHeap IntoIter and some adaptersThe8472-0/+9
2020-08-12Put panic code path from `copy_from_slice` into cold functionLukas Kalbertodt-2/+2
The previous `assert_eq` generated quite some code, which is especially problematic when this call is inlined. This commit also slightly improves the panic message from: assertion failed: `(left == right)` left: `3`, right: `2`: destination and source slices have different lengths ...to: source slice length (2) does not match destination slice length (3)
2020-07-31expand commentsRalf Jung-1/+1
2020-07-31reduce slice::panic_safe test size further in MiriRalf Jung-1/+1
2020-07-27mv std libs to library/mark-0/+1771