Add a test that tests typestate checking inside of fn exprs.
This commit is contained in:
parent
b732ec6f82
commit
4499ebe858
1 changed files with 11 additions and 0 deletions
11
src/test/compile-fail/fn-expr-type-state.rs
Normal file
11
src/test/compile-fail/fn-expr-type-state.rs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// error-pattern:Unsatisfied precondition
|
||||||
|
// xfail-stage0
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// Typestate should work even in a lambda. we should reject this program.
|
||||||
|
auto f = fn () -> int {
|
||||||
|
let int i;
|
||||||
|
ret i;
|
||||||
|
};
|
||||||
|
log_err f();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue