mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Merge #10546
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:
commit
0af9d1fc8a
6 changed files with 280 additions and 11 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue