@@ -519,9 +519,8 @@ pub struct Function {
519
519
pub ( crate ) id : FunctionId ,
520
520
}
521
521
522
- /// The declared signature of a function.
523
522
#[ derive( Debug , Clone , PartialEq , Eq ) ]
524
- pub struct FnSignature {
523
+ pub struct FnData {
525
524
pub ( crate ) name : Name ,
526
525
pub ( crate ) params : Vec < TypeRef > ,
527
526
pub ( crate ) ret_type : TypeRef ,
@@ -530,11 +529,11 @@ pub struct FnSignature {
530
529
pub ( crate ) has_self_param : bool ,
531
530
}
532
531
533
- impl FnSignature {
534
- pub ( crate ) fn fn_signature_query (
532
+ impl FnData {
533
+ pub ( crate ) fn fn_data_query (
535
534
db : & ( impl DefDatabase + AstDatabase ) ,
536
535
func : Function ,
537
- ) -> Arc < FnSignature > {
536
+ ) -> Arc < FnData > {
538
537
let src = func. source ( db) ;
539
538
let name = src. ast . name ( ) . map ( |n| n. as_name ( ) ) . unwrap_or_else ( Name :: missing) ;
540
539
let mut params = Vec :: new ( ) ;
@@ -569,7 +568,7 @@ impl FnSignature {
569
568
TypeRef :: unit ( )
570
569
} ;
571
570
572
- let sig = FnSignature { name, params, ret_type, has_self_param } ;
571
+ let sig = FnData { name, params, ret_type, has_self_param } ;
573
572
Arc :: new ( sig)
574
573
}
575
574
pub fn name ( & self ) -> & Name {
@@ -597,7 +596,7 @@ impl Function {
597
596
}
598
597
599
598
pub fn name ( self , db : & impl HirDatabase ) -> Name {
600
- self . signature ( db) . name . clone ( )
599
+ self . data ( db) . name . clone ( )
601
600
}
602
601
603
602
pub ( crate ) fn body_source_map ( self , db : & impl HirDatabase ) -> Arc < BodySourceMap > {
@@ -612,8 +611,8 @@ impl Function {
612
611
db. type_for_def ( self . into ( ) , Namespace :: Values )
613
612
}
614
613
615
- pub fn signature ( self , db : & impl HirDatabase ) -> Arc < FnSignature > {
616
- db. fn_signature ( self )
614
+ pub fn data ( self , db : & impl HirDatabase ) -> Arc < FnData > {
615
+ db. fn_data ( self )
617
616
}
618
617
619
618
pub fn infer ( self , db : & impl HirDatabase ) -> Arc < InferenceResult > {
@@ -670,8 +669,8 @@ impl Const {
670
669
self . id . module ( db)
671
670
}
672
671
673
- pub fn signature ( self , db : & impl HirDatabase ) -> Arc < ConstSignature > {
674
- db. const_signature ( self )
672
+ pub fn data ( self , db : & impl HirDatabase ) -> Arc < ConstData > {
673
+ db. const_data ( self )
675
674
}
676
675
677
676
pub fn infer ( self , db : & impl HirDatabase ) -> Arc < InferenceResult > {
@@ -696,14 +695,13 @@ impl Const {
696
695
}
697
696
}
698
697
699
- /// The declared signature of a const.
700
698
#[ derive( Debug , Clone , PartialEq , Eq ) ]
701
- pub struct ConstSignature {
699
+ pub struct ConstData {
702
700
pub ( crate ) name : Name ,
703
701
pub ( crate ) type_ref : TypeRef ,
704
702
}
705
703
706
- impl ConstSignature {
704
+ impl ConstData {
707
705
pub fn name ( & self ) -> & Name {
708
706
& self . name
709
707
}
@@ -712,27 +710,27 @@ impl ConstSignature {
712
710
& self . type_ref
713
711
}
714
712
715
- pub ( crate ) fn const_signature_query (
713
+ pub ( crate ) fn const_data_query (
716
714
db : & ( impl DefDatabase + AstDatabase ) ,
717
715
konst : Const ,
718
- ) -> Arc < ConstSignature > {
716
+ ) -> Arc < ConstData > {
719
717
let node = konst. source ( db) . ast ;
720
- const_signature_for ( & * node)
718
+ const_data_for ( & * node)
721
719
}
722
720
723
- pub ( crate ) fn static_signature_query (
721
+ pub ( crate ) fn static_data_query (
724
722
db : & ( impl DefDatabase + AstDatabase ) ,
725
723
konst : Static ,
726
- ) -> Arc < ConstSignature > {
724
+ ) -> Arc < ConstData > {
727
725
let node = konst. source ( db) . ast ;
728
- const_signature_for ( & * node)
726
+ const_data_for ( & * node)
729
727
}
730
728
}
731
729
732
- fn const_signature_for < N : NameOwner + TypeAscriptionOwner > ( node : & N ) -> Arc < ConstSignature > {
730
+ fn const_data_for < N : NameOwner + TypeAscriptionOwner > ( node : & N ) -> Arc < ConstData > {
733
731
let name = node. name ( ) . map ( |n| n. as_name ( ) ) . unwrap_or_else ( Name :: missing) ;
734
732
let type_ref = TypeRef :: from_ast_opt ( node. ascribed_type ( ) ) ;
735
- let sig = ConstSignature { name, type_ref } ;
733
+ let sig = ConstData { name, type_ref } ;
736
734
Arc :: new ( sig)
737
735
}
738
736
@@ -746,8 +744,8 @@ impl Static {
746
744
self . id . module ( db)
747
745
}
748
746
749
- pub fn signature ( self , db : & impl HirDatabase ) -> Arc < ConstSignature > {
750
- db. static_signature ( self )
747
+ pub fn data ( self , db : & impl HirDatabase ) -> Arc < ConstData > {
748
+ db. static_data ( self )
751
749
}
752
750
753
751
/// Builds a resolver for code inside this item.
0 commit comments