Explain that lack of short circuiting support in constants is temporary
This commit is contained in:
parent
b678238070
commit
d815e2b870
@ -1348,7 +1348,10 @@ impl MirPass for QualifyAndPromoteConstants {
|
|||||||
for (span, kind) in mir.control_flow_destroyed.iter() {
|
for (span, kind) in mir.control_flow_destroyed.iter() {
|
||||||
error.span_note(
|
error.span_note(
|
||||||
*span,
|
*span,
|
||||||
&format!("use of {} here", kind),
|
&format!("use of {} 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.", kind),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
for local in locals {
|
for local in locals {
|
||||||
|
@ -4,7 +4,7 @@ error: new features like let bindings are not permitted in constants which also
|
|||||||
LL | let mut x = true && false;
|
LL | let mut x = true && false;
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
note: use of `&&` operator here
|
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.
|
||||||
--> $DIR/const_short_circuit.rs:6:22
|
--> $DIR/const_short_circuit.rs:6:22
|
||||||
|
|
|
|
||||||
LL | let mut x = true && false;
|
LL | let mut x = true && false;
|
||||||
@ -16,7 +16,7 @@ error: new features like let bindings are not permitted in constants which also
|
|||||||
LL | let x = true && false;
|
LL | let x = true && false;
|
||||||
| ^
|
| ^
|
||||||
|
|
|
|
||||||
note: use of `&&` operator here
|
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.
|
||||||
--> $DIR/const_short_circuit.rs:11:18
|
--> $DIR/const_short_circuit.rs:11:18
|
||||||
|
|
|
|
||||||
LL | let x = true && false;
|
LL | let x = true && false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user