You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use crossbeam_channel::bounded;fnmain(){let(sender, _) = bounded(2);let value = 0usize;
crossbeam_channel::select! {
send(sender, value) -> _ => { todo!();}};}
Cargo.toml:
[package]
name = "bugtest"
version = "0.1.0"
edition = "2021"
[dependencies]
crossbeam-channel = "0.5.8"
This example compiles fine with rustc/cargo, but rust-analyzer emits the following error at the macro invocation: expected &dyn SelectHandle, found &Sender<usize>
The error vanishes, if you add an explicit type during the channel construction: let (sender, _) = bounded::<usize>(2);
Since rustc compiles this fine, rust-analyzer should also accept it.
The text was updated successfully, but these errors were encountered:
So the problem here is r-a created a new type var '0 in
let sender = Sender{inner:[]};
for Sender<T>, then try to check if &Sender<'0> can be coerced to &dyn SelectHandle. So chalk would try to resolve Sender<'0>: SelectHandle, but fails because it doesn't know if '0 is sized or not.
The solution maybe is to explicitly tell chalk that '0 is Sized from the Sized bound of struct Sender, or maybe chalk could somehow infer that itself. But I don't know chalk enough to decide if it's possible.
rust-analyzer version: rust-analyzer version: 0.3.1748-standalone
rustc version: rustc 1.74.0 (79e9716c9 2023-11-13)
src/main.rs:
Cargo.toml:
This example compiles fine with rustc/cargo, but rust-analyzer emits the following error at the macro invocation:
expected &dyn SelectHandle, found &Sender<usize>
The error vanishes, if you add an explicit type during the channel construction:
let (sender, _) = bounded::<usize>(2);
Since rustc compiles this fine, rust-analyzer should also accept it.
The text was updated successfully, but these errors were encountered: