@@ -965,7 +965,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
965965 return_expr_ty,
966966 ) ;
967967
968- if let Some ( fn_sig) = self . body_fn_sig ( )
968+ if let Some ( fn_sig) = self . fn_sig ( )
969969 && fn_sig. output ( ) . has_opaque_types ( )
970970 {
971971 // Point any obligations that were registered due to opaque type
@@ -2764,8 +2764,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
27642764 return Ty :: new_error ( self . tcx ( ) , guar) ;
27652765 }
27662766
2767- let ( ident, def_scope) =
2768- self . tcx . adjust_ident_and_get_scope ( field, base_def. did ( ) , self . body_id ) ;
2767+ let ( ident, def_scope) = self . tcx . adjust_ident_and_get_scope (
2768+ field,
2769+ base_def. did ( ) ,
2770+ self . body_def_id ,
2771+ ) ;
27692772
27702773 if let Some ( ( idx, field) ) = self . find_adt_field ( * base_def, ident) {
27712774 self . write_field_index ( expr. hir_id , idx) ;
@@ -2938,7 +2941,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29382941 field_ident. span ,
29392942 "field not available in `impl Future`, but it is available in its `Output`" ,
29402943 ) ;
2941- match self . tcx . coroutine_kind ( self . body_id ) {
2944+ match self . tcx . coroutine_kind ( self . body_def_id ) {
29422945 Some ( hir:: CoroutineKind :: Desugared ( hir:: CoroutineDesugaring :: Async , _) ) => {
29432946 err. span_suggestion_verbose (
29442947 base. span . shrink_to_hi ( ) ,
@@ -2949,7 +2952,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29492952 }
29502953 _ => {
29512954 let mut span: MultiSpan = base. span . into ( ) ;
2952- span. push_span_label ( self . tcx . def_span ( self . body_id ) , "this is not `async`" ) ;
2955+ span. push_span_label ( self . tcx . def_span ( self . body_def_id ) , "this is not `async`" ) ;
29532956 err. span_note (
29542957 span,
29552958 "this implements `Future` and its output type has the field, \
@@ -3119,7 +3122,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
31193122 }
31203123
31213124 fn point_at_param_definition ( & self , err : & mut Diag < ' _ > , param : ty:: ParamTy ) {
3122- let generics = self . tcx . generics_of ( self . body_id ) ;
3125+ let generics = self . tcx . generics_of ( self . body_def_id ) ;
31233126 let generic_param = generics. type_param ( param, self . tcx ) ;
31243127 if let ty:: GenericParamDefKind :: Type { synthetic : true , .. } = generic_param. kind {
31253128 return ;
@@ -3703,7 +3706,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
37033706
37043707 fn check_expr_asm ( & self , asm : & ' tcx hir:: InlineAsm < ' tcx > , span : Span ) -> Ty < ' tcx > {
37053708 if let rustc_ast:: AsmMacro :: NakedAsm = asm. asm_macro {
3706- if !find_attr ! ( self . tcx, self . body_id , Naked ( ..) ) {
3709+ if !find_attr ! ( self . tcx, self . body_def_id , Naked ( ..) ) {
37073710 self . tcx . dcx ( ) . emit_err ( NakedAsmOutsideNakedFn { span } ) ;
37083711 }
37093712 }
@@ -3802,8 +3805,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
38023805 . emit ( ) ;
38033806 break ;
38043807 } ;
3805- let ( subident, sub_def_scope) =
3806- self . tcx . adjust_ident_and_get_scope ( subfield, variant. def_id , self . body_id ) ;
3808+ let ( subident, sub_def_scope) = self . tcx . adjust_ident_and_get_scope (
3809+ subfield,
3810+ variant. def_id ,
3811+ self . body_def_id ,
3812+ ) ;
38073813
38083814 let Some ( ( subindex, field) ) = variant
38093815 . fields
@@ -3854,7 +3860,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
38543860 let ( ident, def_scope) = self . tcx . adjust_ident_and_get_scope (
38553861 field,
38563862 container_def. did ( ) ,
3857- self . body_id ,
3863+ self . body_def_id ,
38583864 ) ;
38593865
38603866 let fields = & container_def. non_enum_variant ( ) . fields ;
0 commit comments