rust/library
bors 598e29bf70 Auto merge of #100806 - timvermeulen:split_inclusive_double_ended_bound, r=dtolnay
Fix generic bound of `str::SplitInclusive`'s `DoubleEndedIterator` impl

`str::SplitInclusive`'s `DoubleEndedIterator` implementation currently uses a `ReverseSearcher` bound for the corresponding searcher. A `DoubleEndedSearcher` bound should have been used instead.

`DoubleEndedIterator` requires that repeated `next_back` calls produce the same items as repeated `next` calls, in opposite order. `ReverseSearcher` lets you search starting from the back of a string, but it makes no guarantees about how its matches correspond to the matches found by a forward search. `DoubleEndedSearcher` is a subtrait of `ReverseSearcher` and does require that the same matches are found in both directions.

This bug fix is a breaking change. Calling `next_back` on `"a+++b".split_inclusive("++")` is currently accepted with repeated calls producing `"b"` and `"a+++"`, while forward iteration yields `"a++"` and `"+b"`. Also see https://github.com/rust-lang/rust/issues/100756#issuecomment-1221307166 for more details.

I believe that this is the only iterator that uses this bound incorrectly — other related iterators such as `str::Split` do have a `DoubleEndedSearcher` bound for their `DoubleEndedIterator` implementation. And `slice::SplitInclusive` doesn't face this problem at all because it doesn't use patterns, only a predicate.

cc `@SkiFire13`
2023-10-07 17:10:02 +00:00
..
alloc Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
backtrace@99faef833f Bump backtrace to 0.3.69 2023-08-22 15:01:14 -07:00
core Auto merge of #100806 - timvermeulen:split_inclusive_double_ended_bound, r=dtolnay 2023-10-07 17:10:02 +00:00
panic_abort Rebase to master 2023-09-22 17:23:33 +05:30
panic_unwind Rename BoxMeUp to PanicPayload. 2023-09-20 19:24:52 +02:00
portable-simd remove repetitive words 2023-07-31 16:13:02 +08:00
proc_macro Auto merge of #116124 - WaffleLapkin:fix-proc-macro-literal-to-string, r=compiler-errors 2023-09-26 03:39:25 +00:00
profiler_builtins Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rtstartup
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #109214 - tosti007:std_collection_hash_new_rework, r=workingjubilee 2023-10-07 05:26:12 +00:00
stdarch@333e9e9977 Bump stdarch submodule 2023-10-02 23:43:35 +02:00
sysroot Expose compiler-builtins-weak-intrinsics feature for -Zbuild-std 2023-06-23 11:15:34 +01:00
test Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
unwind added support for GNU/Hurd 2023-09-21 17:31:25 +02:00