File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed 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
- refs/heads/master: 34b42eeb657dfe051ebaf0f95ba5a428441b04af
2
+ refs/heads/master: af418d97c093e4ab401e67826e20fdf6140c9ddd
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
+ //xfail-test
2
+
3
+ // Issue #2263.
4
+
5
+ // Should pass region checking.
6
+ fn ok ( f : fn @( x : & uint ) ) {
7
+ // Here, g is a function that can accept a uint pointer with
8
+ // lifetime r, and f is a function that can accept a uint pointer
9
+ // with any lifetime. The assignment g = f should be OK (i.e., f
10
+ // should be a subtype of g), because f can be used in any context
11
+ // that expects g's type. But this currently fails.
12
+ let mut g: fn @( y : & r. uint ) = fn @( x: & r. uint ) { } ;
13
+ g = f;
14
+ }
15
+
16
+ // This version is the same as above, except that here, g's type is
17
+ // inferred.
18
+ fn ok_inferred ( f : fn @( x : & uint ) ) {
19
+ let mut g = fn @( x: & r. uint ) { } ;
20
+ g = f;
21
+ }
22
+
23
+ fn main ( ) {
24
+ }
You can’t perform that action at this time.
0 commit comments