aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-04-14 16:50:48 -0700
committerGraydon Hoare <[email protected]>2011-04-14 16:50:59 -0700
commit232c4509574bd27605dfa93890670e1ae1366e31 (patch)
treefddaed0c44cb9b15355c20c37e00cec21d1d3df1 /src/test
parentrustc: Use the unified result for the type of assignment expressions (diff)
downloadrust-232c4509574bd27605dfa93890670e1ae1366e31.tar.xz
rust-232c4509574bd27605dfa93890670e1ae1366e31.zip
Work on destructors, not entirely functional yet (no tydesc integration).
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/obj-dtor-2.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/obj-dtor-2.rs b/src/test/run-pass/obj-dtor-2.rs
new file mode 100644
index 00000000..167b15fb
--- /dev/null
+++ b/src/test/run-pass/obj-dtor-2.rs
@@ -0,0 +1,18 @@
+// xfail-stage00
+
+obj foo(@mutable int x) {
+ drop {
+ log "running dtor";
+ *x = ((*x) + 1);
+ }
+}
+
+
+
+fn main() {
+ auto mbox = @mutable 10;
+ {
+ auto x = foo(mbox);
+ }
+ check ((*mbox) == 11);
+} \ No newline at end of file