@@ -284,32 +284,32 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
284
284
// structs and enums.
285
285
self . assemble_candidates_from_impls ( obligation, & mut candidates) ;
286
286
287
- // For other types, we'll use the builtin rules.
288
- let copy_conditions = self . copy_clone_conditions ( obligation) ;
289
- self . assemble_builtin_bound_candidates ( copy_conditions, & mut candidates) ;
290
- } else if lang_items. discriminant_kind_trait ( ) == Some ( def_id) {
291
- // `DiscriminantKind` is automatically implemented for every type.
292
- candidates. vec . push ( DiscriminantKindCandidate ) ;
293
- } else if lang_items. pointee_trait ( ) == Some ( def_id) {
294
- // `Pointee` is automatically implemented for every type.
295
- candidates. vec . push ( PointeeCandidate ) ;
296
- } else if lang_items. sized_trait ( ) == Some ( def_id) {
297
- // Sized is never implementable by end-users, it is
298
- // always automatically computed.
299
- let sized_conditions = self . sized_conditions ( obligation) ;
300
- self . assemble_builtin_bound_candidates ( sized_conditions, & mut candidates) ;
301
- } else if lang_items. unsize_trait ( ) == Some ( def_id) {
302
- self . assemble_candidates_for_unsizing ( obligation, & mut candidates) ;
303
- } else if lang_items. drop_trait ( ) == Some ( def_id)
304
- && obligation. predicate . skip_binder ( ) . constness == ty:: BoundConstness :: ConstIfConst
305
- {
306
- if self . is_in_const_context {
307
- self . assemble_const_drop_candidates ( obligation, stack, & mut candidates) ?;
308
- } else {
309
- debug ! ( "passing ~const Drop bound; in non-const context" ) ;
310
- // `~const Drop` when we are not in a const context has no effect.
311
- candidates. vec . push ( ConstDropCandidate )
312
- }
287
+ // For other types, we'll use the builtin rules.
288
+ let copy_conditions = self . copy_clone_conditions ( obligation) ;
289
+ self . assemble_builtin_bound_candidates ( copy_conditions, & mut candidates) ;
290
+ } else if lang_items. discriminant_kind_trait ( ) == Some ( def_id) {
291
+ // `DiscriminantKind` is automatically implemented for every type.
292
+ candidates. vec . push ( DiscriminantKindCandidate ) ;
293
+ } else if lang_items. pointee_trait ( ) == Some ( def_id) {
294
+ // `Pointee` is automatically implemented for every type.
295
+ candidates. vec . push ( PointeeCandidate ) ;
296
+ } else if lang_items. sized_trait ( ) == Some ( def_id) {
297
+ // Sized is never implementable by end-users, it is
298
+ // always automatically computed.
299
+ let sized_conditions = self . sized_conditions ( obligation) ;
300
+ self . assemble_builtin_bound_candidates ( sized_conditions, & mut candidates) ;
301
+ } else if lang_items. unsize_trait ( ) == Some ( def_id) {
302
+ self . assemble_candidates_for_unsizing ( obligation, & mut candidates) ;
303
+ } else if lang_items. drop_trait ( ) == Some ( def_id)
304
+ && obligation. predicate . skip_binder ( ) . constness == ty:: BoundConstness :: ConstIfConst
305
+ {
306
+ if self . is_in_const_context {
307
+ self . assemble_const_drop_candidates ( obligation, stack, & mut candidates) ?;
308
+ } else {
309
+ debug ! ( "passing ~const Drop bound; in non-const context" ) ;
310
+ // `~const Drop` when we are not in a const context has no effect.
311
+ candidates. vec . push ( ConstDropCandidate )
312
+ }
313
313
} else {
314
314
if lang_items. clone_trait ( ) == Some ( def_id) {
315
315
// Same builtin conditions as `Copy`, i.e., every type which has builtin support
@@ -947,6 +947,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
947
947
substs : self . tcx ( ) . mk_substs_trait ( ty, & [ ] ) ,
948
948
} ,
949
949
constness : ty:: BoundConstness :: ConstIfConst ,
950
+ polarity : ty:: ImplPolarity :: Positive ,
950
951
} ) ) ;
951
952
952
953
let const_drop_stack = self . push_stack ( obligation_stack. list ( ) , & const_drop_obligation) ;
0 commit comments