Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index bf60c6bc6a..23a0101039 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -601,18 +601,17 @@ pub enum Param {
Varargs,
}
-#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
-pub(crate) struct FnFlags {
- pub(crate) bits: u8,
-}
-impl FnFlags {
- pub(crate) const HAS_SELF_PARAM: u8 = 1 << 0;
- pub(crate) const HAS_BODY: u8 = 1 << 1;
- pub(crate) const IS_DEFAULT: u8 = 1 << 2;
- pub(crate) const IS_CONST: u8 = 1 << 3;
- pub(crate) const IS_ASYNC: u8 = 1 << 4;
- pub(crate) const IS_UNSAFE: u8 = 1 << 5;
- pub(crate) const IS_VARARGS: u8 = 1 << 7;
+bitflags::bitflags! {
+ #[derive(Default)]
+ pub(crate) struct FnFlags: u8 {
+ const HAS_SELF_PARAM = 1 << 0;
+ const HAS_BODY = 1 << 1;
+ const IS_DEFAULT = 1 << 2;
+ const IS_CONST = 1 << 3;
+ const IS_ASYNC = 1 << 4;
+ const IS_UNSAFE = 1 << 5;
+ const IS_VARARGS = 1 << 6;
+ }
}
#[derive(Debug, Clone, Eq, PartialEq)]