File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/tools/rust-analyzer/crates/hir/src Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1884,6 +1884,14 @@ impl Function {
1884
1884
Type :: from_value_def ( db, self . id )
1885
1885
}
1886
1886
1887
+ pub fn fn_ptr_type ( self , db : & dyn HirDatabase ) -> Type {
1888
+ let resolver = self . id . resolver ( db. upcast ( ) ) ;
1889
+ let substs = TyBuilder :: placeholder_subst ( db, self . id ) ;
1890
+ let callable_sig = db. callable_item_signature ( self . id . into ( ) ) . substitute ( Interner , & substs) ;
1891
+ let ty = TyKind :: Function ( callable_sig. to_fn_ptr ( ) ) . intern ( Interner ) ;
1892
+ Type :: new_with_resolver_inner ( db, & resolver, ty)
1893
+ }
1894
+
1887
1895
/// Get this function's return type
1888
1896
pub fn ret_type ( self , db : & dyn HirDatabase ) -> Type {
1889
1897
let resolver = self . id . resolver ( db. upcast ( ) ) ;
You can’t perform that action at this time.
0 commit comments