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

wf-check user types before normalization #104746

Closed
wants to merge 9 commits into from

Commits on Nov 22, 2022

  1. don't normalize in astconv

    We delay projection normalization to further stages in order to
    register user type annotations before normalization in HIR typeck.
    
    There are two consumers of astconv: ItemCtxt and FnCtxt.
    The former already expects unnormalized types from astconv, see its
    AstConv trait impl.
    The latter needs `RawTy` for a cleaner interface.
    
    Unfortunately astconv still needs the normalization machinery in
    order to resolve enum variants that have projections in the self type,
    e.g. `<<T as Trait>::Assoc>::StructVariant {}`.
    This is why `AstConv::normalize_ty_2` is necessary.
    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    ea9517e View commit details
    Browse the repository at this point in the history
  2. introduce AstConv::probe_adt

    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    4327a79 View commit details
    Browse the repository at this point in the history
  3. fix struct path

    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    32b4b8a View commit details
    Browse the repository at this point in the history
  4. fix method substs

    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    2ee771f View commit details
    Browse the repository at this point in the history
  5. make ascribe_user_type a TypeOp

    Projection types in user annotations may contain inference variables.
    This makes the normalization depend on the unification with the actual
    type and thus requires a separate TypeOp to track the obligations.
    Otherwise simply calling `TypeChecker::normalize` would ICE with
    "unexpected ambiguity"
    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    ff6a0aa View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e8cde83 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e6dc882 View commit details
    Browse the repository at this point in the history
  8. tests

    aliemjay committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    8e40dde View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. quick fixes

    aliemjay committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    3ba10e2 View commit details
    Browse the repository at this point in the history