diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-08-05 15:27:23 -0700 |
|---|---|---|
| committer | Eric Holk <eholk@mozilla.com> | 2011-08-05 15:27:23 -0700 |
| commit | 244efa6331eab49fa1bf765bfd6974d512ed6719 (patch) | |
| tree | 880c3f8d01ec2d6652b78f2d65a60ce55d032cd3 /src/test | |
| parent | d65aaa933a205a694e5387d40fbea4c10cb168a8 (diff) | |
| parent | 1c786bcc82424b9218f1ca52fa99a12ce353e590 (diff) | |
| download | rust-244efa6331eab49fa1bf765bfd6974d512ed6719.tar.gz rust-244efa6331eab49fa1bf765bfd6974d512ed6719.zip | |
Merge branch 'master' of github.com:graydon/rust
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/alt-join.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/compile-fail/alt-join.rs b/src/test/compile-fail/alt-join.rs new file mode 100644 index 00000000000..bbd4ac5c73a --- /dev/null +++ b/src/test/compile-fail/alt-join.rs @@ -0,0 +1,17 @@ +// error-pattern:Unsatisfied precondition constraint +// a good test that we merge paths correctly in the presence of a +// variable that's used before it's declared +// should be rejected by typestate because we use x without initializing it + +fn my_fail() -> ! { fail; } + +fn main() { + + alt (true) { + false { my_fail(); } + true {} + } + + log x; + let x:int; +} \ No newline at end of file |
