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

Enhance suggestions of dropping_* lints #126275

Closed
wants to merge 3 commits into from

Commits on Jun 11, 2024

  1. Distinguish dropping mutable references in lint

    Dropping mutable references is not a no-op, it makes the mutable
    reference inaccessible (as it is not a `Copy` type).
    tbu- committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    15bd318 View commit details
    Browse the repository at this point in the history
  2. Suggest to delete the whole drop expression if it doesn't do anything

    Previously, the lint suggested to change code like `drop(&variable);`
    into `let _ = &variable;`. Now it suggests to remove the whole
    expression.
    tbu- committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    5f06edd View commit details
    Browse the repository at this point in the history
  3. Test dropping_copy_types lint when the type is ()

    The lint will now suggest to simply remove the `drop` call instead of
    changing it to `let _ = …`.
    tbu- committed Jun 11, 2024
    Configuration menu
    Copy the full SHA
    aa06ced View commit details
    Browse the repository at this point in the history