@@ -2068,7 +2068,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
20682068 }
20692069 }
20702070
2071- _ => candidates. vec . push ( AutoImplCandidate ( def_id. clone ( ) ) ) ,
2071+ _ => candidates. vec . push ( AutoImplCandidate ( def_id) ) ,
20722072 }
20732073 }
20742074
@@ -2132,10 +2132,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
21322132 // but `Foo` is declared as `trait Foo: Bar<u32>`.
21332133 let upcast_trait_refs = util:: supertraits ( self . tcx ( ) , poly_trait_ref)
21342134 . filter ( |upcast_trait_ref| {
2135- self . infcx . probe ( |_| {
2136- let upcast_trait_ref = upcast_trait_ref. clone ( ) ;
2137- self . match_poly_trait_ref ( obligation, upcast_trait_ref) . is_ok ( )
2138- } )
2135+ self . infcx
2136+ . probe ( |_| self . match_poly_trait_ref ( obligation, * upcast_trait_ref) . is_ok ( ) )
21392137 } )
21402138 . count ( ) ;
21412139
@@ -2243,7 +2241,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
22432241 let def_id = obligation. predicate . def_id ( ) ;
22442242
22452243 if self . tcx ( ) . is_trait_alias ( def_id) {
2246- candidates. vec . push ( TraitAliasCandidate ( def_id. clone ( ) ) ) ;
2244+ candidates. vec . push ( TraitAliasCandidate ( def_id) ) ;
22472245 }
22482246
22492247 Ok ( ( ) )
@@ -3249,7 +3247,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
32493247 obligation_trait_ref : ty:: PolyTraitRef < ' tcx > ,
32503248 expected_trait_ref : ty:: PolyTraitRef < ' tcx > ,
32513249 ) -> Result < Vec < PredicateObligation < ' tcx > > , SelectionError < ' tcx > > {
3252- let obligation_trait_ref = obligation_trait_ref. clone ( ) ;
32533250 self . infcx
32543251 . at ( & obligation_cause, obligation_param_env)
32553252 . sup ( obligation_trait_ref, expected_trait_ref)
0 commit comments