We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, the rust-analyzer display {unknown} with special associated type order.
{unknown}
use std::fmt::Debug; pub trait Widget {} pub trait Windows { type W: Widget; type E: Debug; fn as_widget(&self) -> Result<&Self::W, Self::E>; } /// !!! Pay attention to the order Box<dyn Windows<E = E, W = W>> !!! impl<W: Widget, E: Debug> Windows for Box<dyn Windows<E = E, W = W>> { type W = W; type E = E; fn as_widget(&self) -> Result<&Self::W, Self::E> { todo!() } } pub struct Contain<W, WW>(Vec<WW>) where W: Widget, WW: Windows< W = W, E = String,>; impl<W, WW> Contain<W, WW> where W: Widget, WW: Windows< W = W, E = String,>, { pub fn new() -> Self { Self(vec![]) } pub fn get_value(&self) -> bool { todo!() } } pub struct Dialog; impl Widget for Dialog {} let c = Contain::<Dialog, Box<dyn Windows<W = Dialog, E = String>>>::new(); c.get_value(); /* display unknown */
When you enter point after c, it not display the get_value method in autocomplete list.
c
get_value
And point on the get_value , the RA display {unknown}.
If I changed the order of associated type order to
impl<W: Widget, E: Debug> Windows for Box<dyn Windows<W = W, E = E>> { type W = W; type E = E; fn as_widget(&self) -> Result<&Self::W, Self::E> { todo!() } }
all the RA feature mentioned above working correctly.
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.1186-standalone (e8e598f 2022-08-28)
rustc version: (eg. output of rustc -V)
rustc -V
rustc 1.63.0 (4b91a6ea7 2022-08-08)
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)
CARGO
RUSTUP_HOME
CARGO_HOME
None
The text was updated successfully, but these errors were encountered:
6dfd8ae
Successfully merging a pull request may close this issue.
Hi, the rust-analyzer display
{unknown}
with special associated type order.When you enter point after
c
, it not display theget_value
method in autocomplete list.And point on the
get_value
, the RA display{unknown}
.If I changed the order of associated type order to
all the RA feature mentioned above working correctly.
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.1186-standalone (e8e598f 2022-08-28)
rustc version: (eg. output of
rustc -V
)rustc 1.63.0 (4b91a6ea7 2022-08-08)
relevant settings: (eg. client settings, or environment variables like
CARGO
,RUSTUP_HOME
orCARGO_HOME
)None
The text was updated successfully, but these errors were encountered: