Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink SelectionError a lot #111029

Merged
merged 2 commits into from
May 11, 2023
Merged

Commits on May 9, 2023

  1. Shrink SelectionError a lot

    `SelectionError` used to be 80 bytes (on 64 bit). That's quite big.
    Especially because the selection cache contained `Result<_,
    SelectionError>. The Ok type is only 32 bytes, so the 80 bytes
    significantly inflate the size of the cache.
    
    Most variants of the `SelectionError` seem to be hard errors, only
    `Unimplemented` shows up in practice (for cranelift-codegen, it occupies
    23.4% of all cache entries). We can just box away the biggest variant,
    `OutputTypeParameterMismatch`, to get the size down to 16 bytes, well
    within the size of the Ok type inside the cache.
    Noratrieb committed May 9, 2023
    Configuration menu
    Copy the full SHA
    41a9cbe View commit details
    Browse the repository at this point in the history
  2. Rename expected_trait_ref to self_ty_trait_ref

    This trait ref is derived from the self type and then equated to the
    trait ref from the obligation.
    
    For example, for `fn(): Fn(u32)`, `self_ty_trait_ref` is `Fn()`, which
    is then equated to `Fn(u32)` (which will fail, causing the obligation to
    fail).
    Noratrieb committed May 9, 2023
    Configuration menu
    Copy the full SHA
    e8ab648 View commit details
    Browse the repository at this point in the history