rust-analyzer: Autocomplete fails on Vec after custom allocators support was added
Description
Autocomplete fails to show any result under specific circumstances:

This problem only seems to happen on rust nightly. It consistently disappears after rustup default stable and restarting the RA server. The bytes crate doesn’t seems to have anything cfg’ed on nightly. Functions in other traits (e.g. std::io::Read) seems to work fine.
Environment
- RA:
2020-11-23(cadf0e9) - VSCode:
1.51.1 - Rust:
1.50.0-nightly (1c389ffef 2020-11-24)
Minimal reproducible example
- Switch to
nightlytoolchain - Add
bytes = "0.6"to dependencies - Add
use bytes::{BytesMut, buf::Buf}; - Write
let buf = BytesMut::new(); - Try to complete on
buf.<|>
(Verified to be reproducible in Windows Sandbox using a fresh install of Rust, VSCode, and RA without changing any settings)
This is maybe related to #6612, but I’m not sure because a) it doesn’t complete no matter what I do or how long I wait; and b) it somehow only appears in Rust nightly.
Edit: see https://github.com/rust-analyzer/rust-analyzer/issues/6668#issuecomment-735501557
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Use correct, full substs for self type in impl Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it... — committed to flodiebold/rust-analyzer by flodiebold 4 years ago
- Use correct, full substs for self type in impl Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it... — committed to flodiebold/rust-analyzer by flodiebold 4 years ago
- Merge #6723 6723: Use correct, full substs for self type in impl r=flodiebold a=flodiebold Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't... — committed to rust-lang/rust-analyzer by bors[bot] 4 years ago
- Use correct, full substs for self type in impl Without arbitrary self types, the self type could never refer to the method type parameters, so this wasn't a problem; but with arbitrary self types, it... — committed to Matthias-Fauconneau/rust-analyzer by flodiebold 4 years ago
reproduces the problem on stable. I’m pretty sure the problem is the second type parameter on the
Box.For me the latest working version is
da3846948 2020-11-21and it fails ona0d664bae 2020-11-22, so it shouldn’t be the same issue? The only major difference between them appears to be rust-lang/rust#78461.Oh! I see.
BytesMutderefs toVec<u8>, so that’s why most of the other types don’t have the same issue.