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] Never type experiments #84573

Closed

Commits on Aug 30, 2021

  1. Configuration menu
    Copy the full SHA
    0be0bfc View commit details
    Browse the repository at this point in the history
  2. introduce new fallback algorithm

    We now fallback type variables using the following rules:
    
    * Construct a coercion graph `A -> B` where `A` and `B` are unresolved
      type variables or the `!` type.
    * Let D be those variables that are reachable from `!`.
    * Let N be those variables that are reachable from a variable not in
    D.
    * All variables in (D \ N) fallback to `!`.
    * All variables in (D & N) fallback to `()`.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    cf56389 View commit details
    Browse the repository at this point in the history
  3. remove diverging type variables from fn check

    The comment seems incorrect. Testing revealed that the examples in
    question still work (as well as some variants) even without the
    special casing here.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    ac195c7 View commit details
    Browse the repository at this point in the history
  4. remove reliance on "diverging" type variables

    Instead, we now record those type variables that are the target of a
    `NeverToAny` adjustment and consider those to be the "diverging" type
    variables. This allows us to remove the special case logic that
    creates a type variable for `!` in coercion.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    f54591f View commit details
    Browse the repository at this point in the history
  5. stop categorizing inference variables as diverging when created

    Instead, we now rely on the code that looks for a NeverToAny adjustment.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    543b241 View commit details
    Browse the repository at this point in the history
  6. fix bug in DepthFirstSearch where start node was not visited

    This could cause us to visit the start node twice.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    141246c View commit details
    Browse the repository at this point in the history
  7. optimization: use a single DepthFirstSearch instead of hashsets

    Extend the `DepthFirstSearch` iterator so that it can be re-used and
    extended with add'l start nodes. Then replace the FxHashSets of nodes
    we were using in the fallback analysis with a single iterator. This
    way we won't re-walk portions of the graph that are reached more than
    once, and we also do less allocation etc.
    nikomatsakis authored and Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    c48ee1c View commit details
    Browse the repository at this point in the history
  8. stabilize never type

    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    9a332c8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    be24f7b View commit details
    Browse the repository at this point in the history
  10. v2 of fallback algo

    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    7531f59 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    26403a2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    a9903a2 View commit details
    Browse the repository at this point in the history
  13. Rebase tests

    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    a963d8d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    73e9259 View commit details
    Browse the repository at this point in the history
  15. clippy

    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    c4532c0 View commit details
    Browse the repository at this point in the history
  16. Relate type variables during predicate registration

    This avoids select_obligations_where_possible having an effect, which future
    proofs the algorithm.
    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    5a8bcf9 View commit details
    Browse the repository at this point in the history
  17. Utilize coercion information to guide never type fallback

    This doesn't yet fully work -- running coercions seems to be prone to causing
    errors in the environment, which creates a little noise in some cases. It should
    be enough to let us re-run crater, though, I think.
    Mark-Simulacrum committed Aug 30, 2021
    Configuration menu
    Copy the full SHA
    40d1e69 View commit details
    Browse the repository at this point in the history