1
Fork 0

Document our sanity assertion around explicit promotion

This commit is contained in:
Oliver Scherer 2020-04-16 15:06:17 +02:00
parent 119c6365e4
commit 4cdc31b965

View file

@ -732,6 +732,10 @@ pub fn validate_candidates(
let is_promotable = validator.validate_candidate(candidate).is_ok();
// If we use explicit validation, we carry the risk of turning a legitimate run-time
// operation into a failing compile-time operation. Make sure that does not happen
// by asserting that there is no possible run-time behavior here in case promotion
// fails.
if validator.explicit && !is_promotable {
ccx.tcx.sess.delay_span_bug(
ccx.body.span,