Skip to content

.await completion shown in a non-async function when the receiver is of unknown type #22478

@ada4a

Description

@ada4a

code snippet to reproduce:

//- minicore: future
fn foo(t: T) {
    let _ = t.$0;
}

t is of type T which isn't defined anywhere, which in turn causes a completion t.await to appear. If we define T, e.g. by adding it as a generic to foo, then the completion is (correctly) no longer shown.

rust-analyzer version: rust-analyzer 1.95.0 (5980761 2026-04-14)

rustc version: rustc 1.95.0 (59807616e 2026-04-14)

editor or extension: VSCode, extension version 0.3.2913

relevant settings: none

@rustbot claim

Metadata

Metadata

Assignees

Labels

C-bugCategory: bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions