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

Trying to address an incremental compilation issues #126409

Merged
merged 2 commits into from
Jun 20, 2024

Commits on Jun 19, 2024

  1. Allow for try_force_from_dep_node to fail

    The way it is implemented currently try_force_from_dep_node returns true
    as long as there's a function to force the query. It wasn't this way
    from the beginning, earlier version was producing forcing result and it
    was changed in rust-lang#89978, I couldn't
    find any comments addressing this change.
    
    One way it can fail is by failing to recover the query in
    DepNodeParams::recover - when we are trying to query something that no
    longer exists in the current environment
    pacak committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    db5ed4b View commit details
    Browse the repository at this point in the history
  2. local_def_path_hash_to_def_id can fail

    local_def_path_hash_to_def_id is used by Debug impl for DepNode and it
    looks for DefPathHash inside the current compilation. During incremental
    compilation we are going through nodes that belong to a previous
    compilation and might not be present and a simple attempt to print such
    node with tracing::debug (try_mark_parent_green does it for example)
    results in a otherwise avoidable panic
    
    Panic was added in rust-lang#82183,
    specifically in 2b60338, with a comment "We only use this mapping for
    cases where we know that it must succeed.", but I'm not sure if this
    property holds when we traverse nodes from the old compilation in order
    to figure out if they are valid or not
    pacak committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    12f8d12 View commit details
    Browse the repository at this point in the history