-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug
Description
rust-analyzer version: rust-analyzer version: 0.3.2675-standalone [/home/nostal/.vscode-server/extensions/rust-lang.rust-analyzer-0.3.2675-linux-x64/server/rust-analyzer]
rustc version: rustc 1.93.0-nightly (bd3ac0330 2025-11-01)
editor or extension: VScode with rust-analyzer
relevant settings:
The only important setting is "rust-analyzer.diagnostics.experimental.enable": true,, which will give error complain on below minimal code.
"rust-analyzer.diagnostics.experimental.enable": true,code snippet to reproduce:
Below code works fine.
struct PBox<T, A>(T, A);
impl<T, A> PBox<T, A> {
fn token_with(self) -> usize {
0
}
}
trait MoveMessage {
fn token<A>(self, alloc: A) -> usize
where
Self: Sized,
{
let b = PBox::<Self, A>(self, alloc);
let t = b.token_with(); // RA complains: no method `token_with`
t
}
}
#[test]
fn works() {
struct Msg(u32);
impl MoveMessage for Msg {}
let msg = Msg(1);
let token = msg.token("alloc");
println!("token: {}",token)
}Metadata
Metadata
Assignees
Labels
A-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug