Skip to content

"Remove unnecessary async" assist should not appear in trait impls #13492

Closed
@j-tai

Description

@j-tai

The Remove unnecessary async code assist should not be available inside trait implementations. This is because the async is required to conform to the trait interface, so the async is not "unnecessary".

Reproduce:

  1. Paste the following code

    trait Trait {
        async fn foo();
    }
    
    impl Trait for () {async fn foo() {
    
        }
    }

    denotes the cursor location.

  2. Press alt+. to show code assists

rust-analyzer version: 0.3.1258-standalone

rustc version: 1.64.0 (a55dd71d5 2022-09-19)

relevant settings:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions