Rust-analyzer keeps spamming log area and auto-complete is very slow
rust-analyzer version: rust-analyzer version: 0.3.2658-standalone (049767e6fa 2025-10-26)
rustc version: rustc 1.90.0 (1159e78c4 2025-09-14)
editor or extension: VSCode: Version: 1.105.1 (system setup)
relevant settings: N/A
repository link (if public, optional): N/A
code snippet to reproduce:
const TEST: &str = "TEST";
fn main() {
let s = "rust".to_string();
match s.as_str() {
TEST => {}
_ => {}
}
}
When use code, every input will cause some output like, even when focus change:
2025-10-28T17:04:58.3691467+08:00 ERROR Overloaded deref on type str is not a projection
2025-10-28T17:05:05.7191977+08:00 ERROR pattern has unexpected type: pat: Pat { ty: str, kind: Deref { subpattern: Pat { ty: &'{region error} str, kind: Deref { subpattern: Pat { ty: &'{region error} str, kind: Wild } } } } }, ty: str
Might be related to #20149
Seems same issue, if I explicitly specifying the lifecycle it won't show errors.
Looks like I have to rewrite our type inference code for patterns. Our current code is quite wrong, especially with pattern adjustments for reborrows. I once reached to the same conclusion on #20149 but forgot about it a while 😅 This is the time I have to do it
@ShoyuVanilla I'm currently in the process of rewriting our method resolution to match rustc (final stages of fixing the last bugs). Granted, it almost doesn't touch pattern inference, but I still would prefer to not do it yet, although if you really want...
Okay, I'll wait until then
Autocompletion is fast for me (maybe that was fixed), but the logs keep being emitted, that needs the fix @ShoyuVanilla described.
Yeah, I'm gonna do it in next coming days. I'm just asking to confirm, will it overlap with your attribute handling rewrite, Chayim? I guess not because they are quite distant things but I'm not totally sure as I haven't looked into your PR much 😅
Attribute rewrite barely touches hir-ty, and if something change I can rebase easily (rebasing over hir-def is a pain though). So I don't think this will conflict.