Add tests for blocks that must not have results
This commit is contained in:
parent
16bdb85cb4
commit
413d97f8bd
7
src/test/compile-fail/block-must-not-have-result-do.rs
Normal file
7
src/test/compile-fail/block-must-not-have-result-do.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// error-pattern:this block must not have a result
|
||||
|
||||
fn main() {
|
||||
do {
|
||||
true
|
||||
} while true;
|
||||
}
|
7
src/test/compile-fail/block-must-not-have-result-for.rs
Normal file
7
src/test/compile-fail/block-must-not-have-result-for.rs
Normal file
@ -0,0 +1,7 @@
|
||||
// error-pattern:this block must not have a result
|
||||
|
||||
fn main() {
|
||||
for i in [0] {
|
||||
true
|
||||
}
|
||||
}
|
8
src/test/compile-fail/block-must-not-have-result-res.rs
Normal file
8
src/test/compile-fail/block-must-not-have-result-res.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// error-pattern:this block must not have a result
|
||||
|
||||
resource r(i: int) {
|
||||
true
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
// error-pattern:this block must not have a result
|
||||
|
||||
fn main() {
|
||||
while true {
|
||||
true
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user