Prevent renaming SelfType and BuiltinType
This commit is contained in:
parent
183ba483a9
commit
e194f2edc4
@ -88,6 +88,8 @@ pub(crate) fn rename_with_semantics(
|
||||
let def = find_definition(sema, syntax, position)?;
|
||||
match def {
|
||||
Definition::ModuleDef(ModuleDef::Module(module)) => rename_mod(&sema, module, new_name),
|
||||
Definition::SelfType(_) => bail!("Cannot rename `Self`"),
|
||||
Definition::ModuleDef(ModuleDef::BuiltinType(_)) => bail!("Cannot rename builtin type"),
|
||||
def => rename_reference(sema, def, new_name),
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user