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

[WIP] Remove placeholders completely #130227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Nov 6, 2024

  1. Preliminary attempt at removing placeholders out of the borrow checker.

    This version is maximally naive, and currently unsound.
    
    Handle more placeholder errors.
    
    This update extends the SCC metadata tracking a lot
    and uses the extra information to add p: 'static for
    any placeholder that reaches another placeholder.
    
    It also inlines the few measly bits of `init_free_and_bound_regions()`
    that still remain as relevant. This increases the constructor for
    `RegionInferenceContext`s somewhat, but I still think it's
    readable.
    
    The documentation for `init_free_and_bound_regions()` was out of
    date, and the correct, up to date version is available in the various
    places where the logic was moved.
    
    Use annotions on the outlives-static constraints to
    help the search for who is to blame.
    
    Invalid placeholder relation constraints are redirects
    
    This commit makes the search for blamable outlives constraints
    treat an added `x: 'static` edge as a redirect to figure out
    why it reached an invalid placeholder.
    
    As a drive-by it also refactors the blame search somewhat, renames
    a few methods, and allows iterating over outgoing constraints
    without the implied edges from 'static.
    
    This version mostly works!
    
    I've switched to encoding our new outlives-static constraints
    with two extra parameters: the source and drain of a path in the
    original constraint graph that caused a placeholder issue.
    
    This handles all of the soundness issues, leaving 16 failing
    diagnostics.
    
    Remove some stuff we don't need or can't use anymore
    
    Figure out better names for opaque types!
    
    Fix tidy error
    
    Fix most of the cases of missing "implied 'static" warnings
    
    Fix documentation that build-failed
    amandasystems committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    54bcafb View commit details
    Browse the repository at this point in the history
  2. Produce slightly fewer placeholder constraints

    This seems to hit the sweet spot between enabling debugging
    and being efficient.
    
    Somewhat cleaner representation that separates concerns
    
    Avoid handling placeholders for MIR bodies without them
    
    Determine once and for all if there are higher-kinded concerns and nope out
    
    This also changes how annotations for SCCs work.
    
    This version finally does away with all kinds of universe handling
    
    It does so in a preprocessing step that now also removes higher-ranked
    concerns from type tests.
    
    Fix handling of opaque regions
    amandasystems committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    372912b View commit details
    Browse the repository at this point in the history