Skip to content

Commit d815e2b

Browse files
committed
Explain that lack of short circuiting support in constants is temporary
1 parent b678238 commit d815e2b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/librustc_mir/transform/qualify_consts.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,10 @@ impl MirPass for QualifyAndPromoteConstants {
13481348
for (span, kind) in mir.control_flow_destroyed.iter() {
13491349
error.span_note(
13501350
*span,
1351-
&format!("use of {} here", kind),
1351+
&format!("use of {} here does not actually short circuit due to \
1352+
the const evaluator presently not being able to do control flow. \
1353+
See https://github.com/rust-lang/rust/issues/49146 for more \
1354+
information.", kind),
13521355
);
13531356
}
13541357
for local in locals {

src/test/ui/consts/const_short_circuit.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: new features like let bindings are not permitted in constants which also
44
LL | let mut x = true && false;
55
| ^^^^^
66
|
7-
note: use of `&&` operator here
7+
note: use of `&&` operator here does not actually short circuit due to the const evaluator presently not being able to do control flow. See https://github.com/rust-lang/rust/issues/49146 for more information.
88
--> $DIR/const_short_circuit.rs:6:22
99
|
1010
LL | let mut x = true && false;
@@ -16,7 +16,7 @@ error: new features like let bindings are not permitted in constants which also
1616
LL | let x = true && false;
1717
| ^
1818
|
19-
note: use of `&&` operator here
19+
note: use of `&&` operator here does not actually short circuit due to the const evaluator presently not being able to do control flow. See https://github.com/rust-lang/rust/issues/49146 for more information.
2020
--> $DIR/const_short_circuit.rs:11:18
2121
|
2222
LL | let x = true && false;

0 commit comments

Comments
 (0)