10546: feat: Implement promote_local_to_const assist r=Veykril a=Veykril

Fixes #7692, that is now one can invoke the `extract_variable` assist on something and then follow that up with this assist to turn it into a const.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot]
2021-10-14 19:51:34 +00:00
committed by GitHub
6 changed files with 280 additions and 11 deletions

View File

@@ -1307,6 +1307,10 @@ impl Function {
db.function_data(self.id).is_unsafe()
}
pub fn is_const(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).is_const()
}
pub fn is_async(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).is_async()
}