-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)

rustc version: (eg. output of rustc -V
) rustc 1.89.0 (29483883e 2025-08-04)
editor or extension: Reproduced under both neovim and vscode.
relevant settings: (eg. client settings, or environment variables like CARGO
, RUSTC
, RUSTUP_HOME
or CARGO_HOME
)
repository link (if public, optional): https://github.com/adaszko/rust-analyzer-minrepro
code snippet to reproduce:
use ustr::{Ustr, ustr};
#[derive(Clone, PartialEq)]
pub enum Expr {
// `--help`
Terminal(Ustr, Option<Ustr>, usize),
}
fn foo(s: &str) -> Expr {
Expr::Terminal(ustr(s), None, 0)
}
fn main() {
use Expr::*;
let terminal_expr = Terminal(ustr("--color="), None, 0);
println!("Hello, world!");
// Terminal(ustr($s), None, 0) ==>> foo($s)
// Terminal($s, None, 0) ==>> foo($s)
}
Expected behavior: Triggering SSR using rule Terminal(ustr($s), None, 0) ==>> foo($s)
should rewrite
let terminal_expr = Terminal(ustr("--color="), None, 0);
to
let terminal_expr = foo("--color=")
.
Actual behavior: Rule doesn't match the line let terminal_expr = Terminal(ustr("--color="), None, 0);
.