Skip to content
New issue

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

rust-analyzer fails to provide autocompletion for methods of type wrapped in Into<T> #13482

Closed
westernwontons opened this issue Oct 25, 2022 · 1 comment

Comments

@westernwontons
Copy link
Contributor

I have this function signature:

  pub fn set_name<'a, T>(&mut self, name: T) -> &mut Self
  where
    T: Into<Cow<'a, str>>
  {
    self.name = name.into().into_owned();
    self
  }

In VSCode, if I set "unresolvedReference": "#d3d3d3d3", in "editor.semanticTokenColorCustomizations", I noticed that .into_owned() is grayed out, but this code works fine. I can confirm this, because this compiles:

Screenshot 2022-10-25 at 12 47 52

For example, if I have Into<Cow<'a, str>>, the Into trait's into() method shows up, but nothing after that. This video demonstrates this in practice:

Screen.Recording.2022-10-25.at.12.54.57.mov
@flodiebold
Copy link
Member

Duplicate of #5514

@flodiebold flodiebold marked this as a duplicate of #5514 Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants