aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs19
1 files changed, 15 insertions, 4 deletions
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index 86239d903..7bb22c4c4 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};
24use profile::Count; 24use profile::Count;
25use rustc_hash::FxHashMap; 25use rustc_hash::FxHashMap;
26use smallvec::SmallVec; 26use smallvec::SmallVec;
27use syntax::{ast, match_ast, SyntaxKind}; 27use syntax::{ast, match_ast, SmolStr, SyntaxKind};
28 28
29use crate::{ 29use crate::{
30 attr::{Attrs, RawAttrs}, 30 attr::{Attrs, RawAttrs},
@@ -556,16 +556,25 @@ pub struct Function {
556 pub generic_params: GenericParamsId, 556 pub generic_params: GenericParamsId,
557 pub has_self_param: bool, 557 pub has_self_param: bool,
558 pub has_body: bool, 558 pub has_body: bool,
559 pub is_unsafe: bool, 559 pub qualifier: FunctionQualifier,
560 /// Whether the function is located in an `extern` block (*not* whether it is an 560 /// Whether the function is located in an `extern` block (*not* whether it is an
561 /// `extern "abi" fn`). 561 /// `extern "abi" fn`).
562 pub is_extern: bool, 562 pub is_in_extern_block: bool,
563 pub params: Box<[Idx<TypeRef>]>, 563 pub params: Box<[Idx<TypeRef>]>,
564 pub is_varargs: bool, 564 pub is_varargs: bool,
565 pub ret_type: Idx<TypeRef>, 565 pub ret_type: Idx<TypeRef>,
566 pub ast_id: FileAstId<ast::Fn>, 566 pub ast_id: FileAstId<ast::Fn>,
567} 567}
568 568
569#[derive(Debug, Clone, PartialEq, Eq)]
570pub struct FunctionQualifier {
571 pub is_default: bool,
572 pub is_const: bool,
573 pub is_async: bool,
574 pub is_unsafe: bool,
575 pub abi: Option<SmolStr>,
576}
577
569#[derive(Debug, Clone, Eq, PartialEq)] 578#[derive(Debug, Clone, Eq, PartialEq)]
570pub struct Struct { 579pub struct Struct {
571 pub name: Name, 580 pub name: Name,
@@ -629,7 +638,9 @@ pub struct Trait {
629 pub name: Name, 638 pub name: Name,
630 pub visibility: RawVisibilityId, 639 pub visibility: RawVisibilityId,
631 pub generic_params: GenericParamsId, 640 pub generic_params: GenericParamsId,
632 pub auto: bool, 641 pub is_auto: bool,
642 pub is_unsafe: bool,
643 pub bounds: Box<[TypeBound]>,
633 pub items: Box<[AssocItem]>, 644 pub items: Box<[AssocItem]>,
634 pub ast_id: FileAstId<ast::Trait>, 645 pub ast_id: FileAstId<ast::Trait>,
635} 646}