File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
branches/snap-stage3/src/test/compile-fail Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: fe7f528e5d537adab4c9c87dbbabbd0382869516
4
+ refs/heads/snap-stage3: 7ee329e97a24d259f76c1a6e910f32aa11e07862
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change
1
+ //xfail-test
2
+
3
+ // Creating a stack closure which references an owned pointer and then
4
+ // transferring ownership of the owned box before invoking the stack
5
+ // closure results in a crash.
6
+
7
+ fn twice ( x : ~uint ) -> uint
8
+ {
9
+ * x * 2
10
+ }
11
+
12
+ fn invoke ( f : & fn ( ) -> uint )
13
+ {
14
+ f ( ) ;
15
+ }
16
+
17
+ fn main ( )
18
+ {
19
+ let x : ~uint = ~9 ;
20
+ let sq : & fn ( ) -> uint = || { * x * * x } ;
21
+
22
+ twice ( x) ;
23
+ invoke ( sq) ;
24
+ }
You can’t perform that action at this time.
0 commit comments