diff options
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r-- | crates/hir_def/src/item_tree.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index 09bcb10dc..d8f22d442 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs | |||
@@ -24,7 +24,7 @@ use la_arena::{Arena, Idx, RawIdx}; | |||
24 | use profile::Count; | 24 | use profile::Count; |
25 | use rustc_hash::FxHashMap; | 25 | use rustc_hash::FxHashMap; |
26 | use smallvec::SmallVec; | 26 | use smallvec::SmallVec; |
27 | use syntax::{ast, match_ast, SyntaxKind}; | 27 | use syntax::{ast, match_ast, SmolStr, SyntaxKind}; |
28 | 28 | ||
29 | use crate::{ | 29 | use crate::{ |
30 | attr::{Attrs, RawAttrs}, | 30 | attr::{Attrs, RawAttrs}, |
@@ -551,16 +551,25 @@ pub struct Function { | |||
551 | pub generic_params: GenericParamsId, | 551 | pub generic_params: GenericParamsId, |
552 | pub has_self_param: bool, | 552 | pub has_self_param: bool, |
553 | pub has_body: bool, | 553 | pub has_body: bool, |
554 | pub is_unsafe: bool, | 554 | pub qualifier: FunctionQualifier, |
555 | /// Whether the function is located in an `extern` block (*not* whether it is an | 555 | /// Whether the function is located in an `extern` block (*not* whether it is an |
556 | /// `extern "abi" fn`). | 556 | /// `extern "abi" fn`). |
557 | pub is_extern: bool, | 557 | pub is_in_extern_block: bool, |
558 | pub params: Box<[Idx<TypeRef>]>, | 558 | pub params: Box<[Idx<TypeRef>]>, |
559 | pub is_varargs: bool, | 559 | pub is_varargs: bool, |
560 | pub ret_type: Idx<TypeRef>, | 560 | pub ret_type: Idx<TypeRef>, |
561 | pub ast_id: FileAstId<ast::Fn>, | 561 | pub ast_id: FileAstId<ast::Fn>, |
562 | } | 562 | } |
563 | 563 | ||
564 | #[derive(Debug, Clone, PartialEq, Eq)] | ||
565 | pub struct FunctionQualifier { | ||
566 | pub is_default: bool, | ||
567 | pub is_const: bool, | ||
568 | pub is_async: bool, | ||
569 | pub is_unsafe: bool, | ||
570 | pub abi: Option<SmolStr>, | ||
571 | } | ||
572 | |||
564 | #[derive(Debug, Clone, Eq, PartialEq)] | 573 | #[derive(Debug, Clone, Eq, PartialEq)] |
565 | pub struct Struct { | 574 | pub struct Struct { |
566 | pub name: Name, | 575 | pub name: Name, |