diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-18 09:42:46 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-18 09:42:46 +0100 |
| commit | d815e2b870793e8793900be0aeb8ccaf5e4c7291 (patch) | |
| tree | a588b9c696639719a037842fa84bffe5fb445a9e | |
| parent | b678238070cf43e97ab263788897eb64430ee4b4 (diff) | |
| download | rust-d815e2b870793e8793900be0aeb8ccaf5e4c7291.tar.gz rust-d815e2b870793e8793900be0aeb8ccaf5e4c7291.zip | |
Explain that lack of short circuiting support in constants is temporary
| -rw-r--r-- | src/librustc_mir/transform/qualify_consts.rs | 5 | ||||
| -rw-r--r-- | src/test/ui/consts/const_short_circuit.stderr | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 10d14c1e412..cd6a9e98e8d 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -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 { diff --git a/src/test/ui/consts/const_short_circuit.stderr b/src/test/ui/consts/const_short_circuit.stderr index 80713442706..a67bb0b1b6d 100644 --- a/src/test/ui/consts/const_short_circuit.stderr +++ b/src/test/ui/consts/const_short_circuit.stderr @@ -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; |
