about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAli Bektas <bektasali@protonmail.com>2023-08-24 02:05:14 +0200
committerAli Bektas <bektasali@protonmail.com>2023-09-10 23:19:58 +0200
commita0c8bee35edcfb16c2c92f5c61bc574d6e555a44 (patch)
tree9592fdb8f2270b2112df9916b4190afdd767a23e
parent6dc7fa94235f1b2ca9ecd8bf90a96c7c1871f111 (diff)
downloadrust-a0c8bee35edcfb16c2c92f5c61bc574d6e555a44.tar.gz
rust-a0c8bee35edcfb16c2c92f5c61bc574d6e555a44.zip
Add more comments as requested
-rw-r--r--crates/ide-db/src/rename.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ide-db/src/rename.rs b/crates/ide-db/src/rename.rs
index a60b2423595..f6de3a88848 100644
--- a/crates/ide-db/src/rename.rs
+++ b/crates/ide-db/src/rename.rs
@@ -73,6 +73,8 @@ impl Definition {
     ) -> Result<SourceChange> {
         // 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.")