about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHmikihiro <34ttrweoewiwe28@gmail.com>2025-07-27 21:53:35 +0900
committerHmikihiro <34ttrweoewiwe28@gmail.com>2025-07-27 22:49:56 +0900
commit1d5a582ba03f2ecda47a2c904bedb17adf5ee2dd (patch)
tree90a49c4648359cfa2bb686d8007afcfd4bf74434 /src
parentdfc9bd02ae169689dd643c3e69a4fbd207768b5a (diff)
downloadrust-1d5a582ba03f2ecda47a2c904bedb17adf5ee2dd.tar.gz
rust-1d5a582ba03f2ecda47a2c904bedb17adf5ee2dd.zip
refactor: conpare text of name_ref instead of syntax name_ref
Diffstat (limited to 'src')
-rw-r--r--src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs
index 4511072b041..f667d625935 100644
--- a/src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs
+++ b/src/tools/rust-analyzer/crates/ide-assists/src/handlers/inline_type_alias.rs
@@ -322,7 +322,10 @@ fn create_replacement(
 
                 replacements.push((syntax.clone(), new_lifetime.syntax().clone_for_update()));
             }
-        } else if let Some(replacement_syntax) = const_and_type_map.0.get(syntax_str) {
+        } else if let Some(name_ref) = ast::NameRef::cast(syntax.clone()) {
+            let Some(replacement_syntax) = const_and_type_map.0.get(&name_ref.to_string()) else {
+                continue;
+            };
             let new_string = replacement_syntax.to_string();
             let new = if new_string == "_" {
                 make::wildcard_pat().syntax().clone_for_update()