diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-04 16:42:19 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-04 16:42:19 +0100 |
commit | 0924888cce5f48e0ea0dc7fd8641db92850ef660 (patch) | |
tree | 1507aa873ea92a69b3df4ce2d4f51b0c9191c774 /crates/hir_def/src/data.rs | |
parent | bc8b27884132a4dbfa019f7d3d5fcbbf9f4912af (diff) | |
parent | d1474ae51806cd5382c988fac1cf70a7f2718f4a (diff) |
Merge #8325
8325: Check if bitflags deps pulls its weight r=jonas-schievink a=matklad
Bitflags is generally a good dependency -- it's lightweight, well
maintained and embraced by the ecosystem.
I wonder, however, do we really need it? Doesn't feel like it adds much
to be honest.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def/src/data.rs')
-rw-r--r-- | crates/hir_def/src/data.rs | 18 |
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 | ||