Use bitflags to compress function properties

Very minor savings, only 1 MB or so
This commit is contained in:
Jonas Schievink 2021-04-03 20:58:42 +02:00
parent f7e6b186e1
commit ee4b5a34d8
11 changed files with 120 additions and 71 deletions

View file

@ -832,7 +832,7 @@ impl Function {
}
pub fn self_param(self, db: &dyn HirDatabase) -> Option<SelfParam> {
if !db.function_data(self.id).has_self_param {
if !db.function_data(self.id).has_self_param() {
return None;
}
Some(SelfParam { func: self.id })
@ -864,7 +864,7 @@ impl Function {
}
pub fn is_unsafe(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).qualifier.is_unsafe
db.function_data(self.id).is_unsafe()
}
pub fn diagnostics(self, db: &dyn HirDatabase, sink: &mut DiagnosticSink) {
@ -878,7 +878,7 @@ impl Function {
///
/// This is false in the case of required (not provided) trait methods.
pub fn has_body(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).has_body
db.function_data(self.id).has_body()
}
/// A textual representation of the HIR of this function for debugging purposes.