@@ -1296,14 +1296,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
1296
1296
} else if self . tcx ( ) . lang_items . unsize_trait ( ) == Some ( def_id) {
1297
1297
self . assemble_candidates_for_unsizing ( obligation, & mut candidates) ;
1298
1298
} else {
1299
- if self . tcx ( ) . lang_items . clone_trait ( ) == Some ( def_id) {
1300
- // Same builtin conditions as `Copy`, i.e. every type which has builtin support
1301
- // for `Copy` also has builtin support for `Clone`, + tuples and arrays of `Clone`
1302
- // types have builtin support for `Clone`.
1303
- let clone_conditions = self . copy_conditions ( obligation) ;
1304
- self . assemble_builtin_bound_candidates ( clone_conditions, & mut candidates) ?;
1305
- }
1306
-
1307
1299
self . assemble_closure_candidates ( obligation, & mut candidates) ?;
1308
1300
self . assemble_fn_pointer_candidates ( obligation, & mut candidates) ?;
1309
1301
self . assemble_candidates_from_impls ( obligation, & mut candidates) ?;
@@ -2172,8 +2164,8 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2172
2164
2173
2165
match candidate {
2174
2166
BuiltinCandidate { has_nested } => {
2175
- let data = self . confirm_builtin_candidate ( obligation , has_nested ) ;
2176
- Ok ( VtableBuiltin ( data ) )
2167
+ Ok ( VtableBuiltin (
2168
+ self . confirm_builtin_candidate ( obligation , has_nested ) ) )
2177
2169
}
2178
2170
2179
2171
ParamCandidate ( param) => {
@@ -2279,9 +2271,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2279
2271
_ if Some ( trait_def) == self . tcx ( ) . lang_items . copy_trait ( ) => {
2280
2272
self . copy_conditions ( obligation)
2281
2273
}
2282
- _ if Some ( trait_def) == self . tcx ( ) . lang_items . clone_trait ( ) => {
2283
- self . copy_conditions ( obligation)
2284
- }
2285
2274
_ => bug ! ( "unexpected builtin trait {:?}" , trait_def)
2286
2275
} ;
2287
2276
let nested = match conditions {
@@ -2302,7 +2291,6 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2302
2291
2303
2292
debug ! ( "confirm_builtin_candidate: obligations={:?}" ,
2304
2293
obligations) ;
2305
-
2306
2294
VtableBuiltinData { nested : obligations }
2307
2295
}
2308
2296
@@ -2610,8 +2598,8 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
2610
2598
2611
2599
fn confirm_builtin_unsize_candidate ( & mut self ,
2612
2600
obligation : & TraitObligation < ' tcx > , )
2613
- -> Result < VtableBuiltinData < PredicateObligation < ' tcx > > , SelectionError < ' tcx > >
2614
- {
2601
+ -> Result < VtableBuiltinData < PredicateObligation < ' tcx > > ,
2602
+ SelectionError < ' tcx > > {
2615
2603
let tcx = self . tcx ( ) ;
2616
2604
2617
2605
// assemble_candidates_for_unsizing should ensure there are no late bound
0 commit comments