// already checked by coherence, but compilation may
// not have been terminated.
let span = tcx.def_span(drop_impl_did);
- tcx.sess.delay_span_bug(
+ let reported = tcx.sess.delay_span_bug(
span,
&format!("should have been rejected by coherence check: {}", dtor_self_type),
);
- Err(ErrorGuaranteed)
+ Err(reported)
}
}
}
Err(_) => {
let item_span = tcx.def_span(self_type_did);
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did);
- struct_span_err!(
+ let reported = struct_span_err!(
tcx.sess,
drop_impl_span,
E0366,
),
)
.emit();
- return Err(ErrorGuaranteed);
+ return Err(reported);
}
}
let errors = fulfillment_cx.select_all_or_error(&infcx);
if !errors.is_empty() {
// this could be reached when we get lazy normalization
- infcx.report_fulfillment_errors(&errors, None, false);
- return Err(ErrorGuaranteed);
+ let reported = infcx.report_fulfillment_errors(&errors, None, false);
+ return Err(reported);
}
// NB. It seems a bit... suspicious to use an empty param-env
(
ty::PredicateKind::ConstEvaluatable(a),
ty::PredicateKind::ConstEvaluatable(b),
- ) => tcx.try_unify_abstract_consts((a, b)),
+ ) => tcx.try_unify_abstract_consts(self_param_env.and((a, b))),
(
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_a, lt_a)),
ty::PredicateKind::TypeOutlives(ty::OutlivesPredicate(ty_b, lt_b)),
if !assumptions_in_impl_context.iter().copied().any(predicate_matches_closure) {
let item_span = tcx.def_span(self_type_did);
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did.to_def_id());
- struct_span_err!(
+ let reported = struct_span_err!(
tcx.sess,
predicate_sp,
E0367,
)
.span_note(item_span, "the implementor must specify the same requirement")
.emit();
- result = Err(ErrorGuaranteed);
+ result = Err(reported);
}
}