Commit graph

15 commits

Author SHA1 Message Date
bendn
68abe69f13
iter::ArrayChunks::into_remainder ought not return option 2025-11-20 15:27:57 +07:00
Matthias Krüger
cb3c6edc9b
Rollup merge of #147258 - hkBst:panic-last-repeat, r=scottmcm
iter repeat: panic on last

https://github.com/rust-lang/rust/issues/146660#issuecomment-3356842371
2025-10-18 08:08:36 +02:00
Matthias Krüger
817720c9a9
Rollup merge of #138799 - joboet:extend-tuple, r=Mark-Simulacrum
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.
2025-10-12 10:13:12 +02:00
Marijn Schouten
d52744e9fc iter repeat: panic on last 2025-10-07 16:43:48 +00:00
Marijn Schouten
50398e2e75 iter repeat: add tests for new count and last behavior 2025-09-30 17:56:18 +00:00
Stuart Cook
732802c207
Rollup merge of #143725 - kennytm:peekable_next_if_map, r=jhpratt
core: add Peekable::next_if_map

Implementation for rust-lang/rust#143702
2025-09-04 10:01:51 +10:00
Jeremy Smart
1a33d628df
implement Sum and Product for Saturating(u*) 2025-08-28 18:38:53 -04:00
Rémy Rakic
4ef92bec5a fix load-bearing typo 2025-07-19 15:17:04 +00:00
kennytm
2261154549 core: add Peekable::next_if_map 2025-07-10 20:44:59 +08:00
The 8472
61c2c1211f add comments to Zip unsoundness regression test 2025-06-05 01:28:55 +02:00
The 8472
cdeca5cbd3 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.

¹ see merge commit for linkfied issues.
2025-06-05 01:27:17 +02:00
Jonathan Gruner
f121c7c360 added test for Enumerate::next_index on empty iterator 2025-04-19 12:29:47 +02:00
Frank Steffahn
af66ece822
Add tests for Extend<(T, U)> for (ExtendT, ExtendU)
ordering of side-effects to `coretest`.
2025-03-21 21:01:37 +01:00
bjorn3
1fcae03369 Rustfmt 2025-02-08 22:12:13 +00:00
bjorn3
b6a3841942 Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00