aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree.rs
diff options
context:
space:
mode:
authoroxalica <[email protected]>2021-03-14 10:00:11 +0000
committeroxalica <[email protected]>2021-03-15 17:03:07 +0000
commit2bb8956a102cb2efbea35e414a8214fba2efcaf6 (patch)
treed1ab34b0c43e603f294ecb8f09ae5b5a5736d809 /crates/hir_def/src/item_tree.rs
parentb9c172a977135760006b6222820ac7240be67d58 (diff)
Introduce FunctionQualifier for hir::FunctionData
Diffstat (limited to 'crates/hir_def/src/item_tree.rs')
-rw-r--r--crates/hir_def/src/item_tree.rs15
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};
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},
@@ -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)]
565pub 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)]
565pub struct Struct { 574pub struct Struct {
566 pub name: Name, 575 pub name: Name,