We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 119c636 commit 4cdc31bCopy full SHA for 4cdc31b
src/librustc_mir/transform/promote_consts.rs
@@ -732,6 +732,10 @@ pub fn validate_candidates(
732
733
let is_promotable = validator.validate_candidate(candidate).is_ok();
734
735
+ // If we use explicit validation, we carry the risk of turning a legitimate run-time
736
+ // operation into a failing compile-time operation. Make sure that does not happen
737
+ // by asserting that there is no possible run-time behavior here in case promotion
738
+ // fails.
739
if validator.explicit && !is_promotable {
740
ccx.tcx.sess.delay_span_bug(
741
ccx.body.span,
0 commit comments