aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/references
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/references')
-rw-r--r--crates/ide/src/references/rename.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs
index 1e378279d..5340b638a 100644
--- a/crates/ide/src/references/rename.rs
+++ b/crates/ide/src/references/rename.rs
@@ -510,7 +510,8 @@ fn source_edit_from_def(
510 def: Definition, 510 def: Definition,
511 new_name: &str, 511 new_name: &str,
512) -> RenameResult<(FileId, TextEdit)> { 512) -> RenameResult<(FileId, TextEdit)> {
513 let nav = def.try_to_nav(sema.db).unwrap(); 513 let nav =
514 def.try_to_nav(sema.db).ok_or_else(|| format_err!("No references found at position"))?;
514 515
515 let mut replacement_text = String::new(); 516 let mut replacement_text = String::new();
516 let mut repl_range = nav.focus_or_full_range(); 517 let mut repl_range = nav.focus_or_full_range();