Skip to content

Autocomplete for -> impl Future<Output = ()> in trait implementation adds unnecessary -> () to function signature #21201

@not-nullptr

Description

@not-nullptr

rust-analyzer version: 0.3.2702-standalone (d646b23f00 2025-11-30)

rustc version: rustc 1.91.1 (ed61e7d7e 2025-11-07)

editor or extension: VSCode 1.106.3

code snippet to reproduce:

trait ModernAsyncTrait {
    fn do_something(&self) -> impl Future<Output = ()>;
}

struct MyStruct;

impl ModernAsyncTrait for MyStruct {
	/* ctrl + space and hit enter here on the `async fn do_something(..)` item -- it'll produce the following: */
	//                           vvvvv
	async fn do_something(&self) -> () {
		
	}
}

When autocompleting with RA in VSCode for async traits which use impl Future<Output = ()>, RA will automatically add a unit return type to the function in the trait, which is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions