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> {
236236 }
237237
238238 fn destructor ( self , tcx : TyCtxt < ' tcx > ) -> Option < AdtDestructorKind > {
239- Some ( match self . destructor ( tcx) ?. constness {
239+ Some ( match tcx . constness ( self . destructor ( tcx) ?. did ) {
240240 hir:: Constness :: Const => AdtDestructorKind :: Const ,
241241 hir:: Constness :: NotConst => AdtDestructorKind :: NotConst ,
242242 } )
Original file line number Diff line number Diff line change @@ -1119,8 +1119,6 @@ pub struct PseudoCanonicalInput<'tcx, T> {
11191119pub struct Destructor {
11201120 /// The `DefId` of the destructor method
11211121 pub did : DefId ,
1122- /// The constness of the destructor method
1123- pub constness : hir:: Constness ,
11241122}
11251123
11261124// 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> {
414414 continue ;
415415 } ;
416416
417- if let Some ( ( old_item_id, _ ) ) = dtor_candidate {
417+ if let Some ( old_item_id) = dtor_candidate {
418418 self . dcx ( )
419419 . struct_span_err ( self . def_span ( item_id) , "multiple drop impls found" )
420420 . with_span_note ( self . def_span ( old_item_id) , "other impl here" )
421421 . delay_as_bug ( ) ;
422422 }
423423
424- dtor_candidate = Some ( ( * item_id, self . impl_trait_header ( impl_did ) . unwrap ( ) . constness ) ) ;
424+ dtor_candidate = Some ( * item_id) ;
425425 }
426426
427- let ( did, constness ) = dtor_candidate?;
428- Some ( ty:: Destructor { did, constness } )
427+ let did = dtor_candidate?;
428+ Some ( ty:: Destructor { did } )
429429 }
430430
431431 /// 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>(
263263 . all_fields ( )
264264 . map ( |field| ty:: TraitRef :: new ( tcx, destruct_def_id, [ field. ty ( tcx, args) ] ) )
265265 . collect ( ) ;
266- match adt_def. destructor ( tcx) . map ( |dtor| dtor . constness ) {
266+ match adt_def. destructor ( tcx) . map ( |dtor| tcx . constness ( dtor . did ) ) {
267267 // `Drop` impl exists, but it's not const. Type cannot be `~const Destruct`.
268268 Some ( hir:: Constness :: NotConst ) => return Err ( EvaluationFailure :: NoSolution ) ,
269269 // `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