@@ -351,7 +351,7 @@ impl<'tcx> ItemCtxt<'tcx> {
351351 }
352352
353353 pub fn to_ty ( & self , ast_ty : & hir:: Ty < ' _ > ) -> Ty < ' tcx > {
354- < dyn AstConv < ' _ > > :: ast_ty_to_ty ( self , ast_ty)
354+ self . astconv ( ) . ast_ty_to_ty ( ast_ty)
355355 }
356356
357357 pub fn hir_id ( & self ) -> hir:: HirId {
@@ -413,8 +413,7 @@ impl<'tcx> AstConv<'tcx> for ItemCtxt<'tcx> {
413413 poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
414414 ) -> Ty < ' tcx > {
415415 if let Some ( trait_ref) = poly_trait_ref. no_bound_vars ( ) {
416- let item_substs = <dyn AstConv < ' tcx > >:: create_substs_for_associated_item (
417- self ,
416+ let item_substs = self . astconv ( ) . create_substs_for_associated_item (
418417 span,
419418 item_def_id,
420419 item_segment,
@@ -1112,8 +1111,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
11121111 tcx. hir ( ) . get_parent ( hir_id)
11131112 && i. of_trait . is_some ( )
11141113 {
1115- <dyn AstConv < ' _ > >:: ty_of_fn (
1116- & icx,
1114+ icx. astconv ( ) . ty_of_fn (
11171115 hir_id,
11181116 sig. header . unsafety ,
11191117 sig. header . abi ,
@@ -1130,15 +1128,9 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
11301128 kind : TraitItemKind :: Fn ( FnSig { header, decl, span : _ } , _) ,
11311129 generics,
11321130 ..
1133- } ) => <dyn AstConv < ' _ > >:: ty_of_fn (
1134- & icx,
1135- hir_id,
1136- header. unsafety ,
1137- header. abi ,
1138- decl,
1139- Some ( generics) ,
1140- None ,
1141- ) ,
1131+ } ) => {
1132+ icx. astconv ( ) . ty_of_fn ( hir_id, header. unsafety , header. abi , decl, Some ( generics) , None )
1133+ }
11421134
11431135 ForeignItem ( & hir:: ForeignItem { kind : ForeignItemKind :: Fn ( fn_decl, _, _) , .. } ) => {
11441136 let abi = tcx. hir ( ) . get_foreign_abi ( hir_id) ;
@@ -1244,8 +1236,7 @@ fn infer_return_ty_for_fn_sig<'tcx>(
12441236
12451237 ty:: Binder :: dummy ( fn_sig)
12461238 }
1247- None => <dyn AstConv < ' _ > >:: ty_of_fn (
1248- icx,
1239+ None => icx. astconv ( ) . ty_of_fn (
12491240 hir_id,
12501241 sig. header . unsafety ,
12511242 sig. header . abi ,
@@ -1354,8 +1345,7 @@ fn impl_trait_ref(tcx: TyCtxt<'_>, def_id: DefId) -> Option<ty::TraitRef<'_>> {
13541345 match item. kind {
13551346 hir:: ItemKind :: Impl ( ref impl_) => impl_. of_trait . as_ref ( ) . map ( |ast_trait_ref| {
13561347 let selfty = tcx. type_of ( def_id) ;
1357- <dyn AstConv < ' _ > >:: instantiate_mono_trait_ref (
1358- & icx,
1348+ icx. astconv ( ) . instantiate_mono_trait_ref (
13591349 ast_trait_ref,
13601350 selfty,
13611351 check_impl_constness ( tcx, impl_. constness , ast_trait_ref) ,
@@ -1485,15 +1475,8 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
14851475 hir:: Unsafety :: Unsafe
14861476 } ;
14871477 let hir_id = tcx. hir ( ) . local_def_id_to_hir_id ( def_id. expect_local ( ) ) ;
1488- let fty = <dyn AstConv < ' _ > >:: ty_of_fn (
1489- & ItemCtxt :: new ( tcx, def_id) ,
1490- hir_id,
1491- unsafety,
1492- abi,
1493- decl,
1494- None ,
1495- None ,
1496- ) ;
1478+ let fty =
1479+ ItemCtxt :: new ( tcx, def_id) . astconv ( ) . ty_of_fn ( hir_id, unsafety, abi, decl, None , None ) ;
14971480
14981481 // Feature gate SIMD types in FFI, since I am not sure that the
14991482 // ABIs are handled at all correctly. -huonw
0 commit comments