diff options
| author | Ryan Scott <ryan@zens.tokyo> | 2017-03-28 16:16:23 +0900 |
|---|---|---|
| committer | Ryan Scott <ryan@ryan-scott.me> | 2017-04-04 14:16:25 +0900 |
| commit | e753dfa9a945043c7c465fc3f1e9389585e096d0 (patch) | |
| tree | 0eb95732b619bec9c9ebbff583f2a5c4defc4da9 /src/test | |
| parent | 5309a3e31d88def1f3ea966162ed4f81f161d500 (diff) | |
| download | rust-e753dfa9a945043c7c465fc3f1e9389585e096d0.tar.gz rust-e753dfa9a945043c7c465fc3f1e9389585e096d0.zip | |
Fixed ICEs with pattern matching in const fn. Fixes #38199, fixes #31577, fixes #29093, and fixes #40012.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/const-match-pattern-arm.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/compile-fail/const-match-pattern-arm.rs b/src/test/compile-fail/const-match-pattern-arm.rs new file mode 100644 index 00000000000..452aa87d6ba --- /dev/null +++ b/src/test/compile-fail/const-match-pattern-arm.rs @@ -0,0 +1,25 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +const x: bool = match Some(true) { + Some(value) => true, + //~^ ERROR: constant contains unimplemented expression type [E0019] + _ => false +}; + +const y: bool = { + match Some(true) { + Some(value) => true, + //~^ ERROR: constant contains unimplemented expression type [E0019] + _ => false + } +}; + +fn main() {} |
