From d35bda6429b0a3a758ddcd899e954043584f1071 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 26 Jan 2021 22:11:12 +0300 Subject: Make always-assert crate reusable --- crates/ide/src/references/rename.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ide/src') 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::{ search::FileReference, RootDatabase, }; -use stdx::assert_never; +use stdx::never; use syntax::{ ast::{self, NameOwner}, lex_single_syntax_kind, AstNode, SyntaxKind, SyntaxNode, T, @@ -285,7 +285,7 @@ fn rename_mod( } fn rename_to_self(sema: &Semantics, local: hir::Local) -> RenameResult { - if assert_never!(local.is_self(sema.db)) { + if never!(local.is_self(sema.db)) { bail!("rename_to_self invoked on self"); } @@ -388,7 +388,7 @@ fn rename_self_to_param( let (file_id, self_param) = match local.source(sema.db) { InFile { file_id, value: Either::Right(self_param) } => (file_id, self_param), _ => { - assert_never!(true, "rename_self_to_param invoked on a non-self local"); + never!(true, "rename_self_to_param invoked on a non-self local"); bail!("rename_self_to_param invoked on a non-self local"); } }; -- cgit v1.2.3