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

Fixes shadow_same's false positive for #7915 #7997

Merged
merged 1 commit into from
Nov 22, 2021

Commits on Nov 21, 2021

  1. Fixes rust-lang#7915

    Fix shadow_same's positive false for async function's params:
    
    Example Code:
    ```rust
    #![deny(clippy::shadow_same)]
    
    pub async fn foo(_a: i32) {
    }
    ```
    Output:
    ```
    error: `_a` is shadowed by itself in `_a
    ```
    
    Hir:
    ```rust
    pub async fn foo(_a: i32)
     ->
         /*impl Trait*/ #[lang = "from_generator"](move |mut _task_context|
                                                       {
                                                           let _a = _a;
                                                           { let _t = { }; _t }
                                                       })
    ```
    
    Skip checking async function's params.
    
    changelog: Fix shadow_same's positive false for async function's params
    surechen committed Nov 21, 2021
    Configuration menu
    Copy the full SHA
    846c0be View commit details
    Browse the repository at this point in the history