@@ -942,7 +942,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
942
942
pub ( in super :: super ) fn get_node_fn_decl (
943
943
& self ,
944
944
node : Node < ' tcx > ,
945
- ) -> Option < ( hir :: HirId , & ' tcx hir:: FnDecl < ' tcx > , Ident , bool ) > {
945
+ ) -> Option < ( LocalDefId , & ' tcx hir:: FnDecl < ' tcx > , Ident , bool ) > {
946
946
match node {
947
947
Node :: Item ( & hir:: Item {
948
948
ident,
@@ -953,25 +953,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
953
953
// This is less than ideal, it will not suggest a return type span on any
954
954
// method called `main`, regardless of whether it is actually the entry point,
955
955
// but it will still present it as the reason for the expected type.
956
- Some ( (
957
- hir:: HirId :: make_owner ( owner_id. def_id ) ,
958
- & sig. decl ,
959
- ident,
960
- ident. name != sym:: main,
961
- ) )
956
+ Some ( ( owner_id. def_id , & sig. decl , ident, ident. name != sym:: main) )
962
957
}
963
958
Node :: TraitItem ( & hir:: TraitItem {
964
959
ident,
965
960
kind : hir:: TraitItemKind :: Fn ( ref sig, ..) ,
966
961
owner_id,
967
962
..
968
- } ) => Some ( ( hir :: HirId :: make_owner ( owner_id. def_id ) , & sig. decl , ident, true ) ) ,
963
+ } ) => Some ( ( owner_id. def_id , & sig. decl , ident, true ) ) ,
969
964
Node :: ImplItem ( & hir:: ImplItem {
970
965
ident,
971
966
kind : hir:: ImplItemKind :: Fn ( ref sig, ..) ,
972
967
owner_id,
973
968
..
974
- } ) => Some ( ( hir :: HirId :: make_owner ( owner_id. def_id ) , & sig. decl , ident, false ) ) ,
969
+ } ) => Some ( ( owner_id. def_id , & sig. decl , ident, false ) ) ,
975
970
Node :: Expr ( & hir:: Expr {
976
971
hir_id,
977
972
kind :
@@ -1001,12 +996,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1001
996
} ) => ( ident, sig, owner_id) ,
1002
997
_ => return None ,
1003
998
} ;
1004
- Some ( (
1005
- hir:: HirId :: make_owner ( owner_id. def_id ) ,
1006
- & sig. decl ,
1007
- ident,
1008
- ident. name != sym:: main,
1009
- ) )
999
+ Some ( ( owner_id. def_id , & sig. decl , ident, ident. name != sym:: main) )
1010
1000
}
1011
1001
_ => None ,
1012
1002
}
@@ -1017,7 +1007,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1017
1007
pub fn get_fn_decl (
1018
1008
& self ,
1019
1009
blk_id : hir:: HirId ,
1020
- ) -> Option < ( hir :: HirId , & ' tcx hir:: FnDecl < ' tcx > , bool ) > {
1010
+ ) -> Option < ( LocalDefId , & ' tcx hir:: FnDecl < ' tcx > , bool ) > {
1021
1011
// Get enclosing Fn, if it is a function or a trait method, unless there's a `loop` or
1022
1012
// `while` before reaching it, as block tail returns are not available in them.
1023
1013
self . tcx . hir ( ) . get_return_block ( blk_id) . and_then ( |blk_id| {
0 commit comments