Skip to content

Send and Future swapped in type hints  #13368

@fekie

Description

@fekie

rust-analyzer version: [v0.3.1229](version: 0.3.1229-standalone (5c28ad1 2022-10-01))
rustc version: rustc 1.65.0-nightly
relevant settings: None that I'm aware of

When viewing the type hints for this expression, the Send and Future is swapped.

use futures::Future;
use std::pin::Pin;
use tokio::sync::mpsc::channel;

let (tx, mut rx) = channel::<Pin<Box<dyn Future<Output = Result<bool, bool>> + Send>>>(64);

The type hints appear as this:
image
image

The correct annotation for this expression should be

(Sender<Pin<Box<dyn Send + Future<Output = Result<CheckInfo, CheckerError>>>>>, Receiver<Pin<Box<dyn Send + Future<Output = Result<CheckInfo, CheckerError>>>>>)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions