diff --git a/crates/ide-db/src/rename.rs b/crates/ide-db/src/rename.rs index a60b242359..f6de3a8884 100644 --- a/crates/ide-db/src/rename.rs +++ b/crates/ide-db/src/rename.rs @@ -73,6 +73,8 @@ impl Definition { ) -> Result { // self.krate() returns None if // self is a built-in attr, built-in type or tool module. + // it is not allowed for these defs to be renamed. + // cases where self.krate() is None is handled below. if let Some(krate) = self.krate(sema.db) { if !krate.origin(sema.db).is_local() { bail!("Cannot rename a non-local definition.")