@@ -932,7 +932,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
932
932
pub ( in super :: super ) fn get_node_fn_decl (
933
933
& self ,
934
934
node : Node < ' tcx > ,
935
- ) -> Option < ( hir :: HirId , & ' tcx hir:: FnDecl < ' tcx > , Ident , bool ) > {
935
+ ) -> Option < ( LocalDefId , & ' tcx hir:: FnDecl < ' tcx > , Ident , bool ) > {
936
936
match node {
937
937
Node :: Item ( & hir:: Item {
938
938
ident,
@@ -943,25 +943,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
943
943
// This is less than ideal, it will not suggest a return type span on any
944
944
// method called `main`, regardless of whether it is actually the entry point,
945
945
// but it will still present it as the reason for the expected type.
946
- Some ( (
947
- hir:: HirId :: make_owner ( owner_id. def_id ) ,
948
- & sig. decl ,
949
- ident,
950
- ident. name != sym:: main,
951
- ) )
946
+ Some ( ( owner_id. def_id , & sig. decl , ident, ident. name != sym:: main) )
952
947
}
953
948
Node :: TraitItem ( & hir:: TraitItem {
954
949
ident,
955
950
kind : hir:: TraitItemKind :: Fn ( ref sig, ..) ,
956
951
owner_id,
957
952
..
958
- } ) => Some ( ( hir :: HirId :: make_owner ( owner_id. def_id ) , & sig. decl , ident, true ) ) ,
953
+ } ) => Some ( ( owner_id. def_id , & sig. decl , ident, true ) ) ,
959
954
Node :: ImplItem ( & hir:: ImplItem {
960
955
ident,
961
956
kind : hir:: ImplItemKind :: Fn ( ref sig, ..) ,
962
957
owner_id,
963
958
..
964
- } ) => Some ( ( hir :: HirId :: make_owner ( owner_id. def_id ) , & sig. decl , ident, false ) ) ,
959
+ } ) => Some ( ( owner_id. def_id , & sig. decl , ident, false ) ) ,
965
960
Node :: Expr ( & hir:: Expr {
966
961
hir_id,
967
962
kind :
@@ -991,12 +986,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
991
986
} ) => ( ident, sig, owner_id) ,
992
987
_ => return None ,
993
988
} ;
994
- Some ( (
995
- hir:: HirId :: make_owner ( owner_id. def_id ) ,
996
- & sig. decl ,
997
- ident,
998
- ident. name != sym:: main,
999
- ) )
989
+ Some ( ( owner_id. def_id , & sig. decl , ident, ident. name != sym:: main) )
1000
990
}
1001
991
_ => None ,
1002
992
}
@@ -1007,7 +997,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1007
997
pub fn get_fn_decl (
1008
998
& self ,
1009
999
blk_id : hir:: HirId ,
1010
- ) -> Option < ( hir :: HirId , & ' tcx hir:: FnDecl < ' tcx > , bool ) > {
1000
+ ) -> Option < ( LocalDefId , & ' tcx hir:: FnDecl < ' tcx > , bool ) > {
1011
1001
// Get enclosing Fn, if it is a function or a trait method, unless there's a `loop` or
1012
1002
// `while` before reaching it, as block tail returns are not available in them.
1013
1003
self . tcx . hir ( ) . get_return_block ( blk_id) . and_then ( |blk_id| {
0 commit comments