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

Precise bounds #19

Merged
merged 18 commits into from
Jun 1, 2024
Merged

Precise bounds #19

merged 18 commits into from
Jun 1, 2024

Commits on Feb 20, 2024

  1. Debug impl: pass whole ast to create_format_arg

    We'll want this in a moment.  No functional chnage.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    bbafa6f View commit details
    Browse the repository at this point in the history
  2. Debug impl: Fix generated code for explicit methods

    * Make the internal wrapper type have *all* the parent's generics,
      and contain a PhantomData, so we can:
    * Put the bounds on the Debug impl for the internal wrapper type.
    
    * Rename the internal wrapper type to avoid name clashes with users' types.
    * Rename the formatter variable to avoid name clashes with users's values.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    e224ad8 View commit details
    Browse the repository at this point in the history
  3. Default bounds: Use precisely the right bounds, from the fields

    Rather than trying to filter the generic parameters for ones used in
    types, state the bounds in terms of the actual field types.
    
    This is precisely correct.  It avoids lossage in situations where the
    field type's implementation of the trait has bounds which depend in a
    less-than-straightforward way on its generics.
    
    There is still an issue with implementing traits which have
    supertraits.  We ought to apply a `Self: Super` bound, but we don't
    yet.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    dea0d33 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b2a99a7 View commit details
    Browse the repository at this point in the history
  5. Generic bounds: Handle supertraits

    When we are implementing traits which have supertraits, add
    bounds of the form `where Self: Super` for each supertrait.
    
    While we're touching every call site, abolish the unused parameters.
    
    (I have future plans that will want `params` in
    into_where_predicates_by_generic_parameters_check_types, but not in
    create_where_predicates_from_generic_parameters_check_types, so leave
    that one there for now.)
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    610b6ad View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    eb28c48 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    69f4c1c View commit details
    Browse the repository at this point in the history
  8. Eq: Fix bounds

    Use the new precise bounds function.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    7690e47 View commit details
    Browse the repository at this point in the history
  9. Eq: Fix bounds (rustfmt)

    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    2e47d8b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    725dae8 View commit details
    Browse the repository at this point in the history
  11. Copy: Fix bounds

    Use the new precise bounds function, rather than the ident-hunter.
    
    Apply the Clone supertrait explicitly.  This disposes of the oddity
    mentioned in the comment, as will be demonstrated in a test.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    b18f14f View commit details
    Browse the repository at this point in the history
  12. Copy: Fix bounds (rustfmt)

    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    9a29080 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1daf893 View commit details
    Browse the repository at this point in the history
  14. Clone of unions: Fix bounds

    Use the new precise bounds function.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    1a09812 View commit details
    Browse the repository at this point in the history
  15. Abolish find_idents_*

    This is no longer used, now that everything uses the precise bounds
    function.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    f3a3cb5 View commit details
    Browse the repository at this point in the history
  16. Abolish into_where_predicates_by_generic_parameters

    Nothing calls this.  And, nothing should, because it would give wrong
    answers.
    
    Rename create_where_predicates_from_generic_parameters to
    create_where_predicates_from_all_generic_parameters.  This will be
    useful if we implement a `bound(...)` syntax that allows requesting
    the "apply a bound for each generic parameter, regardless" mode.
    
    If we don't want to implement such a mode, we should delete this
    function, but let's not entangle this already large bugfix MR with
    questions about future features and UI.
    ijackson committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    ecaf0f2 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7b9a95c View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    4b07ecb View commit details
    Browse the repository at this point in the history