Skip to content

Commit

Permalink
Explain that lack of short circuiting support in constants is temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 18, 2018
1 parent b678238 commit d815e2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,10 @@ impl MirPass for QualifyAndPromoteConstants {
for (span, kind) in mir.control_flow_destroyed.iter() {
error.span_note(
*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 {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/consts/const_short_circuit.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: new features like let bindings are not permitted in constants which also
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
|
LL | let mut x = true && false;
Expand All @@ -16,7 +16,7 @@ error: new features like let bindings are not permitted in constants which also
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
|
LL | let x = true && false;
Expand Down

0 comments on commit d815e2b

Please sign in to comment.