rust-analyzer version: 0.3.2711-standalone [/home/oxa/.config/VSCodium/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer]
rustc version: rustc 1.93.0 (254b59607 2026-01-19)
editor or extension: VSCode
repository link (if public, optional): https://github.com/oxalica/sjlj2/blob/8c9bfbb566f7e2b72250e0d007756715056d4da2/src/lib.rs#L360
code snippet to reproduce:
The following minimized code compiles fine with rustc, but rust-analyzer emits an error.
macro_rules! m {
($e:expr) => {
core::arch::asm!("/*{f}*/", f = sym $e, out("ax") _)
};
}
fn generic<T>() {}
fn main() {
unsafe {
m!(generic::<i32>);
// ^^ invalid `_` expression, expected type `()` [rust-analyzer(typed-hole)]
}
}
The issue occurs when the next TT after sym is a invisible-delimited group captured by macro expr specifier. I have to admit that it is technically more correct to use path specifier in this case (and then rust-analyzer will parse everything fine), but expr should work since it is also accepted by rustc.
rust-analyzer version: 0.3.2711-standalone [/home/oxa/.config/VSCodium/User/globalStorage/rust-lang.rust-analyzer/rust-analyzer]
rustc version: rustc 1.93.0 (254b59607 2026-01-19)
editor or extension: VSCode
repository link (if public, optional): https://github.com/oxalica/sjlj2/blob/8c9bfbb566f7e2b72250e0d007756715056d4da2/src/lib.rs#L360
code snippet to reproduce:
The following minimized code compiles fine with rustc, but rust-analyzer emits an error.
The issue occurs when the next TT after
symis a invisible-delimited group captured by macroexprspecifier. I have to admit that it is technically more correct to usepathspecifier in this case (and then rust-analyzer will parse everything fine), butexprshould work since it is also accepted by rustc.