aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-04-04 10:06:01 +0100
committerAleksey Kladov <[email protected]>2021-04-04 10:06:01 +0100
commitd1474ae51806cd5382c988fac1cf70a7f2718f4a (patch)
tree36350873c4d6721f6b20754c245d2ec61987761e /crates/hir_def/src/item_tree.rs
parentc9bcbf9a43eb0bf1a5255f704080305e568f0a36 (diff)
Check if bitflags deps pulls its weight
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.
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs29
1 files changed, 15 insertions, 14 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index c6d700977..739906778 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -569,20 +569,21 @@ pub enum Param {
569 Varargs, 569 Varargs,
570} 570}
571 571
572bitflags::bitflags! { 572#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
573 /// NOTE: Shared with `FunctionData` 573pub(crate) struct FnFlags {
574 pub(crate) struct FnFlags: u8 { 574 pub(crate) bits: u8,
575 const HAS_SELF_PARAM = 1 << 0; 575}
576 const HAS_BODY = 1 << 1; 576impl FnFlags {
577 const IS_DEFAULT = 1 << 2; 577 pub(crate) const HAS_SELF_PARAM: u8 = 1 << 0;
578 const IS_CONST = 1 << 3; 578 pub(crate) const HAS_BODY: u8 = 1 << 1;
579 const IS_ASYNC = 1 << 4; 579 pub(crate) const IS_DEFAULT: u8 = 1 << 2;
580 const IS_UNSAFE = 1 << 5; 580 pub(crate) const IS_CONST: u8 = 1 << 3;
581 /// Whether the function is located in an `extern` block (*not* whether it is an 581 pub(crate) const IS_ASYNC: u8 = 1 << 4;
582 /// `extern "abi" fn`). 582 pub(crate) const IS_UNSAFE: u8 = 1 << 5;
583 const IS_IN_EXTERN_BLOCK = 1 << 6; 583 /// Whether the function is located in an `extern` block (*not* whether it is an
584 const IS_VARARGS = 1 << 7; 584 /// `extern "abi" fn`).
585 } 585 pub(crate) const IS_IN_EXTERN_BLOCK: u8 = 1 << 6;
586 pub(crate) const IS_VARARGS: u8 = 1 << 7;
586} 587}
587 588
588#[derive(Debug, Clone, Eq, PartialEq)] 589#[derive(Debug, Clone, Eq, PartialEq)]