aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/data.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/data.rs')
-rw-r--r--crates/hir_def/src/data.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs
index b409fb45c..135a6698e 100644
--- a/crates/hir_def/src/data.rs
+++ b/crates/hir_def/src/data.rs
@@ -50,7 +50,7 @@ impl FunctionData {
50 50
51 let mut flags = func.flags; 51 let mut flags = func.flags;
52 if is_varargs { 52 if is_varargs {
53 flags |= FnFlags::IS_VARARGS; 53 flags.bits |= FnFlags::IS_VARARGS;
54 } 54 }
55 55
56 Arc::new(FunctionData { 56 Arc::new(FunctionData {
@@ -71,37 +71,37 @@ impl FunctionData {
71 } 71 }
72 72
73 pub fn has_body(&self) -> bool { 73 pub fn has_body(&self) -> bool {
74 self.flags.contains(FnFlags::HAS_BODY) 74 self.flags.bits & FnFlags::HAS_BODY != 0
75 } 75 }
76 76
77 /// True if the first param is `self`. This is relevant to decide whether this 77 /// True if the first param is `self`. This is relevant to decide whether this
78 /// can be called as a method. 78 /// can be called as a method.
79 pub fn has_self_param(&self) -> bool { 79 pub fn has_self_param(&self) -> bool {
80 self.flags.contains(FnFlags::HAS_SELF_PARAM) 80 self.flags.bits & FnFlags::HAS_SELF_PARAM != 0
81 } 81 }
82 82
83 pub fn is_default(&self) -> bool { 83 pub fn is_default(&self) -> bool {
84 self.flags.contains(FnFlags::IS_DEFAULT) 84 self.flags.bits & FnFlags::IS_DEFAULT != 0
85 } 85 }
86 86
87 pub fn is_const(&self) -> bool { 87 pub fn is_const(&self) -> bool {
88 self.flags.contains(FnFlags::IS_CONST) 88 self.flags.bits & FnFlags::IS_CONST != 0
89 } 89 }
90 90
91 pub fn is_async(&self) -> bool { 91 pub fn is_async(&self) -> bool {
92 self.flags.contains(FnFlags::IS_ASYNC) 92 self.flags.bits & FnFlags::IS_ASYNC != 0
93 } 93 }
94 94
95 pub fn is_unsafe(&self) -> bool { 95 pub fn is_unsafe(&self) -> bool {
96 self.flags.contains(FnFlags::IS_UNSAFE) 96 self.flags.bits & FnFlags::IS_UNSAFE != 0
97 } 97 }
98 98
99 pub fn is_in_extern_block(&self) -> bool { 99 pub fn is_in_extern_block(&self) -> bool {
100 self.flags.contains(FnFlags::IS_IN_EXTERN_BLOCK) 100 self.flags.bits & FnFlags::IS_IN_EXTERN_BLOCK != 0
101 } 101 }
102 102
103 pub fn is_varargs(&self) -> bool { 103 pub fn is_varargs(&self) -> bool {
104 self.flags.contains(FnFlags::IS_VARARGS) 104 self.flags.bits & FnFlags::IS_VARARGS != 0
105 } 105 }
106} 106}
107 107