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

Adt copy suggestions #94375

Merged
merged 4 commits into from
Mar 3, 2022
Merged

Adt copy suggestions #94375

merged 4 commits into from
Mar 3, 2022

Commits on Mar 1, 2022

  1. Add helper function to suggest multiple constraints

    Add `rustc_middle::ty::suggest_constraining_type_params` that suggests
    adding multiple constraints.
    
    `suggest_constraining_type_param` now just forwards params to this new
    function.
    WaffleLapkin committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    4c7fb9e View commit details
    Browse the repository at this point in the history
  2. Suggest adding Copy bound when Adt is moved out

    Previously we've only suggested adding `Copy` bounds when the type being
    moved/copied is a type parameter (generic). With this commit we also
    suggest adding bounds when a type
    - Can be copy
    - All predicates that need to be satisfied for that are based on type
      params
    
    i.e. we will suggest `T: Copy` for `Option<T>`, but won't suggest
    anything for `Option<String>`.
    
    Future work: it would be nice to also suggest adding `.clone()` calls
    WaffleLapkin committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    400d343 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    879efa8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f0a16b8 View commit details
    Browse the repository at this point in the history