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

fix(experimental elaborator): Fix duplicate resolve_type on self type and don't leak a trait impl's generics #5102

Merged
merged 53 commits into from
May 28, 2024

Commits on May 2, 2024

  1. Add elaborator

    jfecher committed May 2, 2024
    Configuration menu
    Copy the full SHA
    d0afc12 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Configuration menu
    Copy the full SHA
    1c433ec View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. More expressions

    jfecher committed May 6, 2024
    Configuration menu
    Copy the full SHA
    225303f View commit details
    Browse the repository at this point in the history

Commits on May 7, 2024

  1. Finish each expression kind

    jfecher committed May 7, 2024
    Configuration menu
    Copy the full SHA
    29e67a1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0177c12 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2024

  1. Add compiler flag

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    6b30028 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7550fb8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    39d23dc View commit details
    Browse the repository at this point in the history
  4. Connect elaborator

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    2e77d87 View commit details
    Browse the repository at this point in the history
  5. Code review

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    e542d32 View commit details
    Browse the repository at this point in the history
  6. Finish removing Scope

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    fd287df View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    73dc473 View commit details
    Browse the repository at this point in the history
  8. Finish functions

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    9614b87 View commit details
    Browse the repository at this point in the history
  9. Add should_panic

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    b44c98a View commit details
    Browse the repository at this point in the history
  10. clippy

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    9579646 View commit details
    Browse the repository at this point in the history
  11. Fix test

    jfecher committed May 8, 2024
    Configuration menu
    Copy the full SHA
    e4d5f61 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2024

  1. Fix test

    jfecher committed May 9, 2024
    Configuration menu
    Copy the full SHA
    556e6ef View commit details
    Browse the repository at this point in the history
  2. Elaborate impls

    jfecher committed May 9, 2024
    Configuration menu
    Copy the full SHA
    7487b03 View commit details
    Browse the repository at this point in the history
  3. Fix yet another missed line

    jfecher committed May 9, 2024
    Configuration menu
    Copy the full SHA
    82d5871 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a3872e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3fb05dc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4fa4677 View commit details
    Browse the repository at this point in the history
  7. Resolve weird git merge

    jfecher committed May 9, 2024
    Configuration menu
    Copy the full SHA
    e9e69f4 View commit details
    Browse the repository at this point in the history
  8. Wrong arg order

    jfecher committed May 9, 2024
    Configuration menu
    Copy the full SHA
    d7d91ae View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    e9afa1a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    13564f8 View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. Code review

    jfecher committed May 10, 2024
    Configuration menu
    Copy the full SHA
    75c6451 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bbecf41 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2024

  1. Configuration menu
    Copy the full SHA
    0029558 View commit details
    Browse the repository at this point in the history
  2. Add globals

    jfecher committed May 21, 2024
    Configuration menu
    Copy the full SHA
    7a37bf3 View commit details
    Browse the repository at this point in the history
  3. Format

    jfecher committed May 21, 2024
    Configuration menu
    Copy the full SHA
    464d58c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ba893ae View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Configuration menu
    Copy the full SHA
    397fe78 View commit details
    Browse the repository at this point in the history
  2. Remove unneeded comment

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    afcf26e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1f3e79b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8522936 View commit details
    Browse the repository at this point in the history
  5. Fix panic in the elaborator

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    bbb7228 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1f9b6d0 View commit details
    Browse the repository at this point in the history
  7. Undo unnecessary change

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    78e6a27 View commit details
    Browse the repository at this point in the history
  8. Remove more unnecessary code

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    3b59749 View commit details
    Browse the repository at this point in the history
  9. Remove unnecessary import

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    bf999d9 View commit details
    Browse the repository at this point in the history
  10. Remove outdated assert

    jfecher committed May 22, 2024
    Configuration menu
    Copy the full SHA
    7be1561 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    f48280d View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Configuration menu
    Copy the full SHA
    fadc085 View commit details
    Browse the repository at this point in the history
  2. Clippy

    jfecher committed May 23, 2024
    Configuration menu
    Copy the full SHA
    f0d249a View commit details
    Browse the repository at this point in the history
  3. Add missed field in test

    jfecher committed May 23, 2024
    Configuration menu
    Copy the full SHA
    68ccf9c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    aa6d581 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f519ced View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. Fix more errors

    jfecher committed May 24, 2024
    Configuration menu
    Copy the full SHA
    4e6490c View commit details
    Browse the repository at this point in the history
  2. Clippy

    jfecher committed May 24, 2024
    Configuration menu
    Copy the full SHA
    38f20e9 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2024

  1. fix(experimental elaborator): Avoid defining globals twice (#5103)

    # Description
    
    ## Problem\*
    
    Fixes the "Duplicate definitions of <global> found" error by removing
    `resolve_local_globals`.
    
    ## Summary\*
    
    
    
    ## Additional Context
    
    We don't need to re-add globals to scope anymore via
    `resolve_local_globals` since we're not creating a new Elaborator for
    each function like we do for NameResolvers. The flip side of this is
    that I think we'll need to change how globals are stored eventually so
    that they're not all always visible. I think how it is now may violate
    imports but I'll leave that for a later fix to keep these PRs small.
    (and wait until I have a test case that shows it).
    
    Down to 61 errors after this PR. The errors are:
    - "Duplicate definitions of \<generic> found" - looks to be only one
    case where there is a generic directly on a trait method. `fn
    hash<H>(self, state: &mut H) where H: Hasher;`
    - "Expression type is ambiguous" - from the two turbofish cases that
    haven't been merged in this branch yet
    - "Expected type &mut _, found type H" - issues with auto-deref and
    trait methods possibly
    - "No matching impl found for ..." - trait solver issues
    
    ## Documentation\*
    
    Check one:
    - [x] No documentation needed.
    - [ ] Documentation included in this PR.
    - [ ] **[For Experimental Features]** Documentation to be submitted in a
    separate PR.
    
    # PR Checklist\*
    
    - [x] I have tested the changes locally.
    - [x] I have formatted the changes with [Prettier](https://prettier.io/)
    and/or `cargo fmt` on default settings.
    jfecher authored May 28, 2024
    Configuration menu
    Copy the full SHA
    31e4228 View commit details
    Browse the repository at this point in the history
  2. fix(experimental elaborator): Move code to declare trait impls earlier (

    #5105)
    
    # Description
    
    ## Problem\*
    
    Resolves "No matching impl found for ..." trait solver issues in the
    elaborator.
    
    ## Summary\*
    
    These issues were just because we'd add a trait impl to the interner
    after elaborating the impl. At that point, we'd already have elaborated
    all other functions & methods so it wasn't of much use. I've moved it to
    add the trait impl to the interner during `collect_trait_impl` instead.
    
    ## Additional Context
    
    Down to 6 errors after this PR. The errors are:
    - "Duplicate definitions of \<generic> found" - looks to be only one
    case where there is a generic directly on a trait method. `fn
    hash<H>(self, state: &mut H) where H: Hasher;` (1 error)
    - "Expected type &mut _, found type H" - issues with auto-deref and
    trait methods possibly (5 errors)
    
    (merging master has fixed the 2 "expression is ambiguous" errors from
    the turbofish operator changes)
    
    ## Documentation\*
    
    Check one:
    - [x] No documentation needed.
    - [ ] Documentation included in this PR.
    - [ ] **[For Experimental Features]** Documentation to be submitted in a
    separate PR.
    
    # PR Checklist\*
    
    - [x] I have tested the changes locally.
    - [x] I have formatted the changes with [Prettier](https://prettier.io/)
    and/or `cargo fmt` on default settings.
    
    ---------
    
    Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
    Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
    Co-authored-by: Álvaro Rodríguez <sirasistant@gmail.com>
    Co-authored-by: guipublic <47281315+guipublic@users.noreply.github.com>
    5 people authored May 28, 2024
    Configuration menu
    Copy the full SHA
    0fed42c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6267857 View commit details
    Browse the repository at this point in the history