Skip to content

Commit 4c1f3c6

Browse files
committed
fix: Fix edition handling for names in rename logic
1 parent 4d7b1a4 commit 4c1f3c6

File tree

3 files changed

+161
-115
lines changed

3 files changed

+161
-115
lines changed

src/tools/rust-analyzer/crates/hir/src/semantics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ impl<'db> SemanticsImpl<'db> {
659659

660660
/// Checks if renaming `renamed` to `new_name` may introduce conflicts with other locals,
661661
/// and returns the conflicting locals.
662-
pub fn rename_conflicts(&self, to_be_renamed: &Local, new_name: &str) -> Vec<Local> {
662+
pub fn rename_conflicts(&self, to_be_renamed: &Local, new_name: &Name) -> Vec<Local> {
663663
let body = self.db.body(to_be_renamed.parent);
664664
let resolver = to_be_renamed.parent.resolver(self.db);
665665
let starting_expr =
@@ -668,7 +668,7 @@ impl<'db> SemanticsImpl<'db> {
668668
body: &body,
669669
conflicts: FxHashSet::default(),
670670
db: self.db,
671-
new_name: Symbol::intern(new_name),
671+
new_name: new_name.symbol().clone(),
672672
old_name: to_be_renamed.name(self.db).symbol().clone(),
673673
owner: to_be_renamed.parent,
674674
to_be_renamed: to_be_renamed.binding_id,

0 commit comments

Comments
 (0)