File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
trunk/src/test/compile-fail Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 6dc4bc517ad0283aa28c72a3f15d3b5611882987
2
+ refs/heads/master: 5b8abec92f6099fe0603d321a0fb5847bf283cbd
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change
1
+ // Test rules governing higher-order pure fns.
2
+
3
+ fn assign_to_pure ( x : pure fn( ) , y : fn ( ) , z : unsafe fn ( ) ) {
4
+ let a: pure fn( ) = x;
5
+ let b: pure fn( ) = y; //! ERROR expected pure fn but found impure fn
6
+ let c: pure fn( ) = z; //! ERROR expected pure fn but found unsafe fn
7
+ }
8
+
9
+ fn assign_to_impure ( x : pure fn( ) , y : fn ( ) , z : unsafe fn ( ) ) {
10
+ let h: fn ( ) = x;
11
+ let i: fn ( ) = y;
12
+ let j: fn ( ) = z; //! ERROR expected impure fn but found unsafe fn
13
+ }
14
+
15
+ fn assign_to_unsafe ( x : pure fn( ) , y : fn ( ) , z : unsafe fn ( ) ) {
16
+ let m: unsafe fn ( ) = x;
17
+ let n: unsafe fn ( ) = y;
18
+ let o: unsafe fn ( ) = z;
19
+ }
20
+
21
+ fn main ( ) {
22
+ }
You can’t perform that action at this time.
0 commit comments