]> git.lizzy.rs Git - rust.git/commitdiff
Explain that lack of short circuiting support in constants is temporary
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 18 Dec 2018 08:42:46 +0000 (09:42 +0100)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 18 Dec 2018 08:42:46 +0000 (09:42 +0100)
src/librustc_mir/transform/qualify_consts.rs
src/test/ui/consts/const_short_circuit.stderr

index 10d14c1e412a295657b5b08f621295d46c56767e..cd6a9e98e8dad816102337391bf819b22d608134 100644 (file)
@@ -1348,7 +1348,10 @@ fn run_pass<'a, 'tcx>(&self,
                     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 {
index 807134427061f4313326abd3336c4aa98b8493f4..a67bb0b1b6d98d3592ac65d4d9de4794e19017b5 100644 (file)
@@ -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;
@@ -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;