diff --git a/src/test/compile-fail/block-must-not-have-result-do.rs b/src/test/compile-fail/block-must-not-have-result-do.rs new file mode 100644 index 000000000000..7a1a384e64b2 --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-do.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + do { + true + } while true; +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-for.rs b/src/test/compile-fail/block-must-not-have-result-for.rs new file mode 100644 index 000000000000..5b5e1fafca2e --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-for.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + for i in [0] { + true + } +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-res.rs b/src/test/compile-fail/block-must-not-have-result-res.rs new file mode 100644 index 000000000000..4e0a1a542324 --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-res.rs @@ -0,0 +1,8 @@ +// error-pattern:this block must not have a result + +resource r(i: int) { + true +} + +fn main() { +} \ No newline at end of file diff --git a/src/test/compile-fail/block-must-not-have-result-while.rs b/src/test/compile-fail/block-must-not-have-result-while.rs new file mode 100644 index 000000000000..d0417fc27eca --- /dev/null +++ b/src/test/compile-fail/block-must-not-have-result-while.rs @@ -0,0 +1,7 @@ +// error-pattern:this block must not have a result + +fn main() { + while true { + true + } +} \ No newline at end of file