rustbot · GitHub

@rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

WG-trait-system-refactor

The Rustc Trait System Refactor Initiative (-Znext-solver)

labels

Jul 29, 2026

rust-bors Bot pushed a commit that referenced this pull request

Jul 29, 2026
Check for the empty case in `collect_remaining_errors()`

Merged

panstromek

@ChayimFriedman2

rust-bors Bot pushed a commit that referenced this pull request

Jul 29, 2026
Check for the empty case in `collect_remaining_errors()`

@ChayimFriedman2

@ChayimFriedman2

As it's very common.
This has multiple advantages:
 - Performance. The new type is 1/3 the size of `Vec` (being equivalent in layout to `Option<ThinVec>`) and can be kept in a register.
 - Type safety. We mark the type `#[must_use]`, and thinks requiring errors take `ThinVec`, which requires unwrapping the type and verifying there is indeed an error. We still provide conversions to slices, `ThinVec`, and iteration, because some code needs this and I saw no benefit in changing it, but we deliberately do not provide `Deref<Target = [E]>` or things like that.

@ChayimFriedman2

@lcnr lcnr mentioned this pull request

Aug 6, 2026

Open

8 tasks

@rust-bors rust-bors Bot added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Aug 6, 2026

@rust-bors

This was referenced

Aug 7, 2026

Open

Open

Merged

@ChayimFriedman2

Read the original on github.com ↗