aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-26 19:11:12 +0000
committerAleksey Kladov <[email protected]>2021-01-26 19:13:42 +0000
commitd35bda6429b0a3a758ddcd899e954043584f1071 (patch)
tree3371f60836fdab03f218793582d428ef7751fe55 /crates/ide
parent2664aee8e5976f590e2fcb700982488ae2358780 (diff)
Make always-assert crate reusable
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/references/rename.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs
index c25bcce50..99a558532 100644
--- a/crates/ide/src/references/rename.rs
+++ b/crates/ide/src/references/rename.rs
@@ -9,7 +9,7 @@ use ide_db::{
9 search::FileReference, 9 search::FileReference,
10 RootDatabase, 10 RootDatabase,
11}; 11};
12use stdx::assert_never; 12use stdx::never;
13use syntax::{ 13use syntax::{
14 ast::{self, NameOwner}, 14 ast::{self, NameOwner},
15 lex_single_syntax_kind, AstNode, SyntaxKind, SyntaxNode, T, 15 lex_single_syntax_kind, AstNode, SyntaxKind, SyntaxNode, T,
@@ -285,7 +285,7 @@ fn rename_mod(
285} 285}
286 286
287fn rename_to_self(sema: &Semantics<RootDatabase>, local: hir::Local) -> RenameResult<SourceChange> { 287fn rename_to_self(sema: &Semantics<RootDatabase>, local: hir::Local) -> RenameResult<SourceChange> {
288 if assert_never!(local.is_self(sema.db)) { 288 if never!(local.is_self(sema.db)) {
289 bail!("rename_to_self invoked on self"); 289 bail!("rename_to_self invoked on self");
290 } 290 }
291 291
@@ -388,7 +388,7 @@ fn rename_self_to_param(
388 let (file_id, self_param) = match local.source(sema.db) { 388 let (file_id, self_param) = match local.source(sema.db) {
389 InFile { file_id, value: Either::Right(self_param) } => (file_id, self_param), 389 InFile { file_id, value: Either::Right(self_param) } => (file_id, self_param),
390 _ => { 390 _ => {
391 assert_never!(true, "rename_self_to_param invoked on a non-self local"); 391 never!(true, "rename_self_to_param invoked on a non-self local");
392 bail!("rename_self_to_param invoked on a non-self local"); 392 bail!("rename_self_to_param invoked on a non-self local");
393 } 393 }
394 }; 394 };