diff options
| author | Marijn Haverbeke <[email protected]> | 2011-05-13 11:57:58 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <[email protected]> | 2011-05-13 12:44:05 +0200 |
| commit | 58ec5d1654f367d7f3459ebee2b5f4c89e0f3aa1 (patch) | |
| tree | 803ad4b840000f5af60041d6c565f210f12bf7a1 /src/test/compile-fail/bad-env-capture2.rs | |
| parent | Change resolve to use walk instead of fold (diff) | |
| download | rust-58ec5d1654f367d7f3459ebee2b5f4c89e0f3aa1.tar.xz rust-58ec5d1654f367d7f3459ebee2b5f4c89e0f3aa1.zip | |
Move capture checking into resolve.rs
Drops capture.rs. The new algorithm also checks for captures function
arguments and obj fields.
Diffstat (limited to 'src/test/compile-fail/bad-env-capture2.rs')
| -rw-r--r-- | src/test/compile-fail/bad-env-capture2.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/compile-fail/bad-env-capture2.rs b/src/test/compile-fail/bad-env-capture2.rs new file mode 100644 index 00000000..ccec3310 --- /dev/null +++ b/src/test/compile-fail/bad-env-capture2.rs @@ -0,0 +1,11 @@ +// xfail-stage0 +// xfail-stage1 +// error-pattern: attempted dynamic environment-capture +fn foo(int x) { + fn bar() { + log x; + } +} +fn main() { + foo(2); +}
\ No newline at end of file |