Add a test that tests typestate checking inside of fn exprs.
This commit is contained in:
parent
b732ec6f82
commit
4499ebe858
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…
x
Reference in New Issue
Block a user