@@ -250,7 +250,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
250
250
let ref_str_ty = tcx. mk_imm_ref ( re_erased, tcx. types . str_ ) ;
251
251
let ref_str = self . temp ( ref_str_ty, test. span ) ;
252
252
let deref = tcx. require_lang_item ( LangItem :: Deref , None ) ;
253
- let method = trait_method ( tcx, deref, sym:: deref, ty , [ ] ) ;
253
+ let method = trait_method ( tcx, deref, sym:: deref, [ ty ] ) ;
254
254
let eq_block = self . cfg . start_new_block ( ) ;
255
255
self . cfg . push_assign ( block, source_info, ref_string, Rvalue :: Ref ( re_erased, BorrowKind :: Shared , place) ) ;
256
256
self . cfg . terminate (
@@ -445,7 +445,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
445
445
} ;
446
446
447
447
let eq_def_id = self . tcx . require_lang_item ( LangItem :: PartialEq , Some ( source_info. span ) ) ;
448
- let method = trait_method ( self . tcx , eq_def_id, sym:: eq, deref_ty, [ deref_ty. into ( ) ] ) ;
448
+ let method = trait_method ( self . tcx , eq_def_id, sym:: eq, [ deref_ty, deref_ty] ) ;
449
449
450
450
let bool_ty = self . tcx . types . bool ;
451
451
let eq_result = self . temp ( bool_ty, source_info. span ) ;
@@ -837,10 +837,9 @@ fn trait_method<'tcx>(
837
837
tcx : TyCtxt < ' tcx > ,
838
838
trait_def_id : DefId ,
839
839
method_name : Symbol ,
840
- self_ty : Ty < ' tcx > ,
841
- params : impl IntoIterator < Item = GenericArg < ' tcx > , IntoIter : ExactSizeIterator > ,
840
+ substs : impl IntoIterator < Item = impl Into < GenericArg < ' tcx > > > ,
842
841
) -> ConstantKind < ' tcx > {
843
- let substs = tcx. mk_substs_trait ( self_ty , params ) ;
842
+ let substs = tcx. mk_substs ( substs . into_iter ( ) . map ( Into :: into ) ) ;
844
843
845
844
// The unhygienic comparison here is acceptable because this is only
846
845
// used on known traits.
0 commit comments