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 dataflow-based const validation #64470

Merged
merged 31 commits into from
Sep 29, 2019

Commits on Sep 28, 2019

  1. Configuration menu
    Copy the full SHA
    717c64e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    457c3aa View commit details
    Browse the repository at this point in the history
  3. Add analysis to determine if a local is indirectly mutable

    This adds a dataflow analysis that determines if a reference to a given
    `Local` or part of a `Local` that would allow mutation exists before a
    point in the CFG. If no such reference exists, we know for sure that
    that `Local` cannot have been mutated via an indirect assignment or
    function call.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    e81297d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    83a3e04 View commit details
    Browse the repository at this point in the history
  5. Copy Qualif to start work on new const validator

    This is an exact copy of the `Qualif` trait from `qualify_consts.rs` and
    its first two implementers, `HasMutInterior` and `NeedsDrop`.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    eec93ca View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3a5442a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    c2e121d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    48d3843 View commit details
    Browse the repository at this point in the history
  9. Remove reference to Mode::NonConstFn in qualifs

    This should have no effect on behavior since the validator is never run
    in const contexts.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    3758e38 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    908dcb8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3698d04 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    fc92d3b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c990243 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    670c84d View commit details
    Browse the repository at this point in the history
  15. Correct list of miri-supported operations

    Heap allocations are out, indirect `fn` calls are in!
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    27bd849 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    f2ff425 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e296436 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b3e59bb View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    93ee779 View commit details
    Browse the repository at this point in the history
  20. Trigger ICE on nightly if validators disagree

    Also adds an unstable flag to disable the ICE
    (`-Zsuppress-const-validation-back-compat-ice`) so that nightly users do
    not have to revert to a previous nightly if their code causes
    disagreement between the validators.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    bc7928a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    406ac2e View commit details
    Browse the repository at this point in the history
  22. Return a bool from in_any_value_of_ty

    The `Option` was only used for the promotion qualifiers, so we can use a
    simpler API for validation.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    2f5ea63 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    dcecefc View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    1a14d17 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    713ec15 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    ff6faab View commit details
    Browse the repository at this point in the history
  27. Mask results from flow-sensitive resolver with in_any_value_of_ty

    We relied previously on the caller (e.g. `Q::in_operand`) to ignore
    `Local`s that were indirectly mutable (and thus assumed to be
    qualified). However, it's much clearer (and more efficient) to do this
    in the resolver itself.
    
    This does not yet remove the masking done in `Q::in_operand` and others
    for safety's sake, although I believe that should now be possible.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    a302055 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    8bfe82b View commit details
    Browse the repository at this point in the history
  29. Revert "Use conservative, type-based qualifcation for statics"

    This reverts commit ac7a343cef8287427a98b9210cdb1a772486be10.
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    f2e7faf View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    ff4158a View commit details
    Browse the repository at this point in the history
  31. Rename sty to kind

    Picks up changes made in rust-lang#64513
    ecstatic-morse committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    0bf1a80 View commit details
    Browse the repository at this point in the history