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

Implement proper stability check for const impl Trait, fall back to unstable const when undeclared #93960

Closed
wants to merge 4 commits into from

Commits on Mar 16, 2022

  1. Configuration menu
    Copy the full SHA
    0b94fa4 View commit details
    Browse the repository at this point in the history
  2. Add and use stability helper methods

    This avoids an ambiguity (when reading) where `.level.is_stable()` is
    not immediately clear whether it is general stability or const
    stability.
    jhpratt committed Mar 16, 2022
    Configuration menu
    Copy the full SHA
    9a52401 View commit details
    Browse the repository at this point in the history
  3. Proper const stability check, default to unstable

    Rather than deferring to const eval for checking if a trait is const, we
    now check up-front. This allows the error to be emitted earlier, notably
    at the same time as other stability checks.
    
    Also included in this commit is a change of the default const stability
    level to UNstable. Previously, an item that was `const` but did not
    explicitly state it was unstable was implicitly stable.
    jhpratt committed Mar 16, 2022
    Configuration menu
    Copy the full SHA
    69b71de View commit details
    Browse the repository at this point in the history
  4. Move check to existing pass

    This alters the diagnostics a bit, as the trait method is still stable.
    The only thing this check does is ensure that compilation fails if a
    trait implementation is declared const-stable.
    jhpratt committed Mar 16, 2022
    Configuration menu
    Copy the full SHA
    6a45f4d View commit details
    Browse the repository at this point in the history