Add more comments as requested

This commit is contained in:
Ali Bektas 2023-08-24 02:05:14 +02:00
parent 6dc7fa9423
commit a0c8bee35e

View File

@ -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.")