aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references/rename.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/references/rename.rs')
-rw-r--r--crates/ide/src/references/rename.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs
index 08f16b54d..a4b320227 100644
--- a/crates/ide/src/references/rename.rs
+++ b/crates/ide/src/references/rename.rs
@@ -342,8 +342,10 @@ fn rename_to_self(sema: &Semantics<RootDatabase>, local: hir::Local) -> RenameRe
342 342
343 // FIXME: reimplement this on the hir instead 343 // FIXME: reimplement this on the hir instead
344 // as of the time of this writing params in hir don't keep their names 344 // as of the time of this writing params in hir don't keep their names
345 let fn_ast = 345 let fn_ast = fn_def
346 fn_def.source(sema.db).ok_or(format_err!("Cannot rename non-param local to self"))?.value; 346 .source(sema.db)
347 .ok_or_else(|| format_err!("Cannot rename non-param local to self"))?
348 .value;
347 349
348 let first_param_range = fn_ast 350 let first_param_range = fn_ast
349 .param_list() 351 .param_list()