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

Solve a error .clone() suggestion when moving a mutable reference #127579

Merged
merged 1 commit into from
Jul 18, 2024

Commits on Jul 17, 2024

  1. If the moved value is a mut reference, it is used in a generic functi…

    …on and it's type is a generic param, it can be reborrowed to avoid moving.
    
    for example:
    
    ```rust
    struct Y(u32);
    // x's type is '& mut Y' and it is used in `fn generic<T>(x: T) {}`.
    fn generic<T>(x: T) {}
    ```
    
    fixes rust-lang#127285
    surechen committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    4821b84 View commit details
    Browse the repository at this point in the history