@@ -351,7 +351,7 @@ impl<'tcx> ItemCtxt<'tcx> {
351
351
}
352
352
353
353
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)
355
355
}
356
356
357
357
pub fn hir_id ( & self ) -> hir:: HirId {
@@ -413,8 +413,7 @@ impl<'tcx> AstConv<'tcx> for ItemCtxt<'tcx> {
413
413
poly_trait_ref : ty:: PolyTraitRef < ' tcx > ,
414
414
) -> Ty < ' tcx > {
415
415
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 (
418
417
span,
419
418
item_def_id,
420
419
item_segment,
@@ -1112,8 +1111,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
1112
1111
tcx. hir ( ) . get_parent ( hir_id)
1113
1112
&& i. of_trait . is_some ( )
1114
1113
{
1115
- <dyn AstConv < ' _ > >:: ty_of_fn (
1116
- & icx,
1114
+ icx. astconv ( ) . ty_of_fn (
1117
1115
hir_id,
1118
1116
sig. header . unsafety ,
1119
1117
sig. header . abi ,
@@ -1130,15 +1128,9 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
1130
1128
kind : TraitItemKind :: Fn ( FnSig { header, decl, span : _ } , _) ,
1131
1129
generics,
1132
1130
..
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
+ }
1142
1134
1143
1135
ForeignItem ( & hir:: ForeignItem { kind : ForeignItemKind :: Fn ( fn_decl, _, _) , .. } ) => {
1144
1136
let abi = tcx. hir ( ) . get_foreign_abi ( hir_id) ;
@@ -1244,8 +1236,7 @@ fn infer_return_ty_for_fn_sig<'tcx>(
1244
1236
1245
1237
ty:: Binder :: dummy ( fn_sig)
1246
1238
}
1247
- None => <dyn AstConv < ' _ > >:: ty_of_fn (
1248
- icx,
1239
+ None => icx. astconv ( ) . ty_of_fn (
1249
1240
hir_id,
1250
1241
sig. header . unsafety ,
1251
1242
sig. header . abi ,
@@ -1354,8 +1345,7 @@ fn impl_trait_ref(tcx: TyCtxt<'_>, def_id: DefId) -> Option<ty::TraitRef<'_>> {
1354
1345
match item. kind {
1355
1346
hir:: ItemKind :: Impl ( ref impl_) => impl_. of_trait . as_ref ( ) . map ( |ast_trait_ref| {
1356
1347
let selfty = tcx. type_of ( def_id) ;
1357
- <dyn AstConv < ' _ > >:: instantiate_mono_trait_ref (
1358
- & icx,
1348
+ icx. astconv ( ) . instantiate_mono_trait_ref (
1359
1349
ast_trait_ref,
1360
1350
selfty,
1361
1351
check_impl_constness ( tcx, impl_. constness , ast_trait_ref) ,
@@ -1485,15 +1475,8 @@ fn compute_sig_of_foreign_fn_decl<'tcx>(
1485
1475
hir:: Unsafety :: Unsafe
1486
1476
} ;
1487
1477
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 ) ;
1497
1480
1498
1481
// Feature gate SIMD types in FFI, since I am not sure that the
1499
1482
// ABIs are handled at all correctly. -huonw
0 commit comments