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

NLL: improve inference with flow results, represent regions with bitsets, and more #46319

Merged
merged 30 commits into from
Dec 4, 2017

Commits on Dec 4, 2017

  1. separate out the liveness constraints from the final value

    It will be useful later for diagnostics to be able to remember where
    things were live.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    932452e View commit details
    Browse the repository at this point in the history
  2. replace constant regions with a post-inference check

    Rather than declaring some region variables to be constant, and
    reporting errors when they would have to change, we instead populate
    each free region X with a minimal set of points (the CFG plus end(X)),
    and then we let inference do its thing. This may add other `end(Y)`
    points into X; we can then check after the fact that indeed `X: Y`
    holds.
    
    This requires a bit of "blame" detection to find where the bad
    constraint came from: we are currently using a pretty dumb
    algorithm. Good place for later expansion.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    a96b0cf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    08c8d7e View commit details
    Browse the repository at this point in the history
  4. inform constraint generation using maybe-init

    In particular, if we see a variable is DROP-LIVE, but it is not
    MAYBE-INIT, then we can ignore the drop. This leavess attempt to use
    more complex refinements of the idea (e.g., for subpaths or subfields)
    to future work.
    Nashenas88 authored and nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    a9cb25b View commit details
    Browse the repository at this point in the history
  5. region_infer: BitMatrix representation of region values

    This should be more efficient than allocating two BTreeSets for every
    region variable?—as it is written in rust-lang#45670.
    zackmdavis authored and nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    22b3175 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    aa51603 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    abd7d88 View commit details
    Browse the repository at this point in the history
  8. make resolve_regions_and_report_errors take an OutlivesEnv

    This revealed some shortcomings, one of which is fixed. Fixes rust-lang#45937.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    5562663 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1f33145 View commit details
    Browse the repository at this point in the history
  10. extract the code to create OutlivesBounds into its own module

    Now it can be reused by the NLL code.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    c45307f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    31d61f1 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    45f6027 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    fb4b06a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    663e7a4 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    4de7336 View commit details
    Browse the repository at this point in the history
  16. constraint_generation: create liveness constraints more thoroughly

    We now visit just the stuff in the CFG, and we add liveness
    constraints for all the random types, regions etc that appear within
    rvalues and statements.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    49d2274 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    e9067bd View commit details
    Browse the repository at this point in the history
  18. move liberate_late_bound_regions to a method on the tcx

    No reason for it to live on `Inherited`.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    7f247ad View commit details
    Browse the repository at this point in the history
  19. introduce closure_env_ty helper to compute ty of closure env arg

    Previously the code was somewhat duplicated.
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    fa813f7 View commit details
    Browse the repository at this point in the history
  20. rename "free region" to "universally quantified region"

    This has been bugging me. All the regions appear free in the source;
    the real difference is that some of them are universally quantified
    (those in the function signature) and some are existentially
    quantified (those for which we are inferring values).
    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    243bf3f View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    2e63bb3 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    18cc0f9 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    506e80c View commit details
    Browse the repository at this point in the history
  24. type_check.rs: rustfmt

    nikomatsakis committed Dec 4, 2017
    Configuration menu
    Copy the full SHA
    c1708ab View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    14480b4 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    a393596 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    7409ffd View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    2716160 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    ab2bc9f View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    a6adc74 View commit details
    Browse the repository at this point in the history