@@ -2439,7 +2439,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2439
2439
Where ( ty:: Binder :: bind (
2440
2440
sized_crit
2441
2441
. iter ( )
2442
- . map ( |ty| ty. subst ( self . tcx ( ) , & substs) )
2442
+ . map ( |ty| ty. subst ( self . tcx ( ) , substs) )
2443
2443
. collect ( ) ,
2444
2444
) )
2445
2445
}
@@ -2621,7 +2621,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2621
2621
// We can resolve the `impl Trait` to its concrete type,
2622
2622
// which enforces a DAG between the functions requiring
2623
2623
// the auto trait bounds in question.
2624
- vec ! [ self . tcx( ) . type_of( def_id) . subst( self . tcx( ) , & substs) ]
2624
+ vec ! [ self . tcx( ) . type_of( def_id) . subst( self . tcx( ) , substs) ]
2625
2625
}
2626
2626
}
2627
2627
}
@@ -2674,7 +2674,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2674
2674
trait_def_id,
2675
2675
recursion_depth,
2676
2676
normalized_ty,
2677
- & [ ] ,
2677
+ SubstsRef :: empty ( ) ,
2678
2678
) ;
2679
2679
obligations. push ( skol_obligation) ;
2680
2680
obligations
@@ -3389,7 +3389,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3389
3389
// We can only make objects from sized types.
3390
3390
let tr = ty:: TraitRef {
3391
3391
def_id : tcx. require_lang_item ( lang_items:: SizedTraitLangItem ) ,
3392
- substs : tcx. mk_substs_trait ( source, & [ ] ) ,
3392
+ substs : tcx. mk_substs_trait ( source, SubstsRef :: empty ( ) ) ,
3393
3393
} ;
3394
3394
nested. push ( predicate_to_obligation ( tr. to_predicate ( ) ) ) ;
3395
3395
@@ -3447,14 +3447,14 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3447
3447
} ) ;
3448
3448
let substs = tcx. mk_substs ( params) ;
3449
3449
for & ty in fields. split_last ( ) . unwrap ( ) . 1 {
3450
- if ty. subst ( tcx, substs) . references_error ( ) {
3450
+ if ty. subst ( tcx, SubstsRef :: from_slice ( tcx , & substs) ) . references_error ( ) {
3451
3451
return Err ( Unimplemented ) ;
3452
3452
}
3453
3453
}
3454
3454
3455
3455
// Extract Field<T> and Field<U> from Struct<T> and Struct<U>.
3456
- let inner_source = field. subst ( tcx, & substs_a) ;
3457
- let inner_target = field. subst ( tcx, & substs_b) ;
3456
+ let inner_source = field. subst ( tcx, substs_a) ;
3457
+ let inner_target = field. subst ( tcx, substs_b) ;
3458
3458
3459
3459
// Check that the source struct with the target's
3460
3460
// unsized parameters is equal to the target.
@@ -3479,7 +3479,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3479
3479
obligation. predicate . def_id ( ) ,
3480
3480
obligation. recursion_depth + 1 ,
3481
3481
inner_source,
3482
- & [ inner_target. into ( ) ] ,
3482
+ SubstsRef :: from_slice ( tcx , & [ inner_target. into ( ) ] ) ,
3483
3483
) ) ;
3484
3484
}
3485
3485
@@ -3513,7 +3513,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3513
3513
obligation. predicate . def_id ( ) ,
3514
3514
obligation. recursion_depth + 1 ,
3515
3515
a_last. expect_ty ( ) ,
3516
- & [ b_last. into ( ) ] ,
3516
+ SubstsRef :: from_slice ( tcx , & [ b_last. into ( ) ] ) ,
3517
3517
) ) ;
3518
3518
}
3519
3519
@@ -3573,7 +3573,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3573
3573
let impl_substs = self . infcx
3574
3574
. fresh_substs_for_item ( obligation. cause . span , impl_def_id) ;
3575
3575
3576
- let impl_trait_ref = impl_trait_ref. subst ( self . tcx ( ) , & impl_substs) ;
3576
+ let impl_trait_ref = impl_trait_ref. subst ( self . tcx ( ) , impl_substs) ;
3577
3577
3578
3578
let Normalized {
3579
3579
value : impl_trait_ref,
@@ -3791,7 +3791,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
3791
3791
param_env,
3792
3792
cause. clone ( ) ,
3793
3793
recursion_depth,
3794
- & predicate. subst ( tcx, & substs) ,
3794
+ & predicate. subst ( tcx, substs) ,
3795
3795
) ;
3796
3796
predicate. obligations . into_iter ( ) . chain ( Some ( Obligation {
3797
3797
cause : cause. clone ( ) ,
0 commit comments