This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
rustc_trait_selection/src/traits Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ impl<'tcx> rustc_type_ir::inherent::AdtDef<TyCtxt<'tcx>> for AdtDef<'tcx> {
236
236
}
237
237
238
238
fn destructor ( self , tcx : TyCtxt < ' tcx > ) -> Option < AdtDestructorKind > {
239
- Some ( match self . destructor ( tcx) ?. constness {
239
+ Some ( match tcx . constness ( self . destructor ( tcx) ?. did ) {
240
240
hir:: Constness :: Const => AdtDestructorKind :: Const ,
241
241
hir:: Constness :: NotConst => AdtDestructorKind :: NotConst ,
242
242
} )
Original file line number Diff line number Diff line change @@ -1119,8 +1119,6 @@ pub struct PseudoCanonicalInput<'tcx, T> {
1119
1119
pub struct Destructor {
1120
1120
/// The `DefId` of the destructor method
1121
1121
pub did : DefId ,
1122
- /// The constness of the destructor method
1123
- pub constness : hir:: Constness ,
1124
1122
}
1125
1123
1126
1124
// FIXME: consider combining this definition with regular `Destructor`
Original file line number Diff line number Diff line change @@ -414,18 +414,18 @@ impl<'tcx> TyCtxt<'tcx> {
414
414
continue ;
415
415
} ;
416
416
417
- if let Some ( ( old_item_id, _ ) ) = dtor_candidate {
417
+ if let Some ( old_item_id) = dtor_candidate {
418
418
self . dcx ( )
419
419
. struct_span_err ( self . def_span ( item_id) , "multiple drop impls found" )
420
420
. with_span_note ( self . def_span ( old_item_id) , "other impl here" )
421
421
. delay_as_bug ( ) ;
422
422
}
423
423
424
- dtor_candidate = Some ( ( * item_id, self . impl_trait_header ( impl_did ) . unwrap ( ) . constness ) ) ;
424
+ dtor_candidate = Some ( * item_id) ;
425
425
}
426
426
427
- let ( did, constness ) = dtor_candidate?;
428
- Some ( ty:: Destructor { did, constness } )
427
+ let did = dtor_candidate?;
428
+ Some ( ty:: Destructor { did } )
429
429
}
430
430
431
431
/// Calculate the async destructor of a given type.
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ fn evaluate_host_effect_for_destruct_goal<'tcx>(
263
263
. all_fields ( )
264
264
. map ( |field| ty:: TraitRef :: new ( tcx, destruct_def_id, [ field. ty ( tcx, args) ] ) )
265
265
. collect ( ) ;
266
- match adt_def. destructor ( tcx) . map ( |dtor| dtor . constness ) {
266
+ match adt_def. destructor ( tcx) . map ( |dtor| tcx . constness ( dtor . did ) ) {
267
267
// `Drop` impl exists, but it's not const. Type cannot be `~const Destruct`.
268
268
Some ( hir:: Constness :: NotConst ) => return Err ( EvaluationFailure :: NoSolution ) ,
269
269
// `Drop` impl exists, and it's const. Require `Ty: ~const Drop` to hold.
You can’t perform that action at this time.
0 commit comments