@@ -4,15 +4,14 @@ use rustc_index::interval::IntervalSet;
44use rustc_infer:: infer:: canonical:: QueryRegionConstraints ;
55use rustc_infer:: infer:: outlives:: for_liveness;
66use rustc_middle:: mir:: { BasicBlock , Body , ConstraintCategory , HasLocalDecls , Local , Location } ;
7- use rustc_middle:: span_bug;
87use rustc_middle:: traits:: query:: DropckOutlivesResult ;
98use rustc_middle:: ty:: relate:: Relate ;
109use rustc_middle:: ty:: { Ty , TyCtxt , TypeVisitable , TypeVisitableExt } ;
1110use rustc_mir_dataflow:: ResultsCursor ;
1211use rustc_mir_dataflow:: impls:: MaybeInitializedPlaces ;
1312use rustc_mir_dataflow:: move_paths:: { HasMoveData , MoveData , MovePathIndex } ;
1413use rustc_mir_dataflow:: points:: { DenseLocationMap , PointIndex } ;
15- use rustc_span:: { DUMMY_SP , Span } ;
14+ use rustc_span:: { DUMMY_SP , ErrorGuaranteed , Span } ;
1615use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
1716use rustc_trait_selection:: traits:: ObligationCtxt ;
1817use rustc_trait_selection:: traits:: query:: dropck_outlives;
@@ -608,7 +607,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
608607 Ok ( TypeOpOutput { output, constraints, .. } ) => {
609608 DropData { dropck_result : output, region_constraint_data : constraints }
610609 }
611- Err ( _ ) => {
610+ Err ( ErrorGuaranteed { .. } ) => {
612611 // We don't run dropck on HIR, and dropck looks inside fields of
613612 // types, so there's no guarantee that it succeeds. We also
614613 // can't rely on the the `ErrorGuaranteed` from `fully_perform` here
@@ -631,10 +630,10 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
631630 }
632631 } ;
633632
633+ // Could have no errors if a type lowering error, say, caused the query
634+ // to fail.
634635 if !errors. is_empty ( ) {
635636 typeck. infcx . err_ctxt ( ) . report_fulfillment_errors ( errors) ;
636- } else {
637- span_bug ! ( span, "Rerunning drop data query produced no error." ) ;
638637 }
639638 } ) ;
640639 DropData { dropck_result : Default :: default ( ) , region_constraint_data : None }
0 commit comments