SIGN IN SIGN UP

Auto merge of #160160 - ChayimFriedman2:if-empty-opt, r=TaKO8Ki

Optimize handling of solver errors



- Check for the empty case in `collect_remaining_errors()`.
- Instead of representing trait errors as `Vec<Error>`, use a special type

   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.
B
bors committed
ae45457594a670c59cd4d5591eaa243d9a3d44d5