@@ -4,15 +4,14 @@ use rustc_index::interval::IntervalSet;
4
4
use rustc_infer:: infer:: canonical:: QueryRegionConstraints ;
5
5
use rustc_infer:: infer:: outlives:: for_liveness;
6
6
use rustc_middle:: mir:: { BasicBlock , Body , ConstraintCategory , HasLocalDecls , Local , Location } ;
7
- use rustc_middle:: span_bug;
8
7
use rustc_middle:: traits:: query:: DropckOutlivesResult ;
9
8
use rustc_middle:: ty:: relate:: Relate ;
10
9
use rustc_middle:: ty:: { Ty , TyCtxt , TypeVisitable , TypeVisitableExt } ;
11
10
use rustc_mir_dataflow:: ResultsCursor ;
12
11
use rustc_mir_dataflow:: impls:: MaybeInitializedPlaces ;
13
12
use rustc_mir_dataflow:: move_paths:: { HasMoveData , MoveData , MovePathIndex } ;
14
13
use rustc_mir_dataflow:: points:: { DenseLocationMap , PointIndex } ;
15
- use rustc_span:: { DUMMY_SP , Span } ;
14
+ use rustc_span:: { DUMMY_SP , ErrorGuaranteed , Span } ;
16
15
use rustc_trait_selection:: error_reporting:: InferCtxtErrorExt ;
17
16
use rustc_trait_selection:: traits:: ObligationCtxt ;
18
17
use rustc_trait_selection:: traits:: query:: dropck_outlives;
@@ -608,7 +607,7 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
608
607
Ok ( TypeOpOutput { output, constraints, .. } ) => {
609
608
DropData { dropck_result : output, region_constraint_data : constraints }
610
609
}
611
- Err ( _ ) => {
610
+ Err ( ErrorGuaranteed { .. } ) => {
612
611
// We don't run dropck on HIR, and dropck looks inside fields of
613
612
// types, so there's no guarantee that it succeeds. We also
614
613
// can't rely on the the `ErrorGuaranteed` from `fully_perform` here
@@ -631,10 +630,10 @@ impl<'tcx> LivenessContext<'_, '_, '_, 'tcx> {
631
630
}
632
631
} ;
633
632
633
+ // Could have no errors if a type lowering error, say, caused the query
634
+ // to fail.
634
635
if !errors. is_empty ( ) {
635
636
typeck. infcx . err_ctxt ( ) . report_fulfillment_errors ( errors) ;
636
- } else {
637
- span_bug ! ( span, "Rerunning drop data query produced no error." ) ;
638
637
}
639
638
} ) ;
640
639
DropData { dropck_result : Default :: default ( ) , region_constraint_data : None }
0 commit comments