rust/library
bors 2f4dfc753f Auto merge of #137122 - yotamofek:pr/std/iter-eq-exact-size, r=the8472
Specialize `Iterator::eq{_by}` for `TrustedLen` iterators

I'm sure I got some stuff wrong here, but opening this to get feedback and make sure it's a viable idea at all.

### Motivation
I had a piece of code that open-coded `Iterator::eq`, something like:
```rust
if current.len() != other.len()
    || current.iter().zip(other.iter()).any(|(a, b)| a != b) { ... }
```
... where both `current` and `other` are slices of the same type.
Changing the code to use `current.iter().eq(other)` made it a lot slower, since it wasn't checking the length of the two slices beforehand anymore, which in this instance made a big difference in perf. So I thought I'd see if I can improve `Iterator::eq`.

### Questions
1. I can't specialize for `ExactSizeIterator`, I think it's a limitation of `min_specialization` but not sure exactly why. Is specializing for `TrustedLen` good enough?
2. Should I make a codegen test for this? If so, then how? (I manually checked the assembly to make sure it works as expected)
3. Where should I put `SpecIterCompare`?
4. Can I get a perf run for this, please? I think the compiler uses this in a few places, so it might have an affect.
2025-09-18 23:11:24 +00:00
..
alloc Add space after brace in Box<[T]>::new_uninit_slice example 2025-09-17 12:59:07 -04:00
alloctests Switch std::vec::PeekMut::pop from self to this parameter. 2025-09-14 08:16:05 -07:00
backtrace@b65ab935fb Update the backtrace submodule 2025-06-16 07:00:13 +00:00
compiler-builtins Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb 2025-08-31 13:40:34 +02:00
core Specialize Iterator::eq[_by] for TrustedLen iterators 2025-09-18 22:47:54 +03:00
coretests Rollup merge of #146487 - ferrocene:pvdrz/improve-num-coverage, r=joboet 2025-09-18 17:20:57 +02:00
panic_abort Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
panic_unwind Migrate panic_unwind to use cfg_select! 2025-08-20 16:45:24 -07:00
portable-simd docs(std): add missing closing code block fences in doc comments 2025-09-02 22:11:29 +02:00
proc_macro Rollup merge of #143631 - hkBst:update-escaper-2, r=compiler-errors 2025-07-17 10:41:45 +02:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Update cfg(bootstrap) 2025-07-01 10:55:49 -07:00
rustc-std-workspace-alloc Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
rustc-std-workspace-core Use core via rustc-std-workspace-core in library/panic* 2025-07-31 22:47:24 +00:00
rustc-std-workspace-std Disable unit tests for stdlib packages that don't contain any 2025-07-24 09:15:28 +00:00
std Auto merge of #139849 - thaliaarchi:args/zkvm, r=ibraheemdev 2025-09-17 18:19:36 +00:00
std_detect fix typo in comment 2025-09-12 08:18:26 +08:00
stdarch Stabilize sse4a and tbm target features 2025-08-14 02:07:40 +05:30
sysroot Rollup merge of #144399 - bjorn3:stdlib_tests_separate_packages, r=Mark-Simulacrum 2025-07-28 08:36:53 +02:00
test Rollup merge of #142807 - sourcefrog:failfast, r=dtolnay 2025-09-17 14:56:41 +10:00
unwind Indent some code inside cfg_select! 2025-08-16 16:01:08 -07:00
windows_targets Rollup merge of #144399 - bjorn3:stdlib_tests_separate_packages, r=Mark-Simulacrum 2025-07-28 08:36:53 +02:00
Cargo.lock Rollup merge of #146001 - bjorn3:update_getopts, r=davidtwco 2025-09-09 17:32:21 +02:00
Cargo.toml Remove the std workspace patch for compiler-builtins 2025-08-19 18:56:35 +00:00