@@ -2068,7 +2068,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2068
2068
}
2069
2069
}
2070
2070
2071
- _ => candidates. vec . push ( AutoImplCandidate ( def_id. clone ( ) ) ) ,
2071
+ _ => candidates. vec . push ( AutoImplCandidate ( def_id) ) ,
2072
2072
}
2073
2073
}
2074
2074
@@ -2132,10 +2132,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2132
2132
// but `Foo` is declared as `trait Foo: Bar<u32>`.
2133
2133
let upcast_trait_refs = util:: supertraits ( self . tcx ( ) , poly_trait_ref)
2134
2134
. 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 ( ) )
2139
2137
} )
2140
2138
. count ( ) ;
2141
2139
@@ -2243,7 +2241,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
2243
2241
let def_id = obligation. predicate . def_id ( ) ;
2244
2242
2245
2243
if self . tcx ( ) . is_trait_alias ( def_id) {
2246
- candidates. vec . push ( TraitAliasCandidate ( def_id. clone ( ) ) ) ;
2244
+ candidates. vec . push ( TraitAliasCandidate ( def_id) ) ;
2247
2245
}
2248
2246
2249
2247
Ok ( ( ) )
@@ -3249,7 +3247,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
3249
3247
obligation_trait_ref : ty:: PolyTraitRef < ' tcx > ,
3250
3248
expected_trait_ref : ty:: PolyTraitRef < ' tcx > ,
3251
3249
) -> Result < Vec < PredicateObligation < ' tcx > > , SelectionError < ' tcx > > {
3252
- let obligation_trait_ref = obligation_trait_ref. clone ( ) ;
3253
3250
self . infcx
3254
3251
. at ( & obligation_cause, obligation_param_env)
3255
3252
. sup ( obligation_trait_ref, expected_trait_ref)
0 commit comments