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