File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 9a89a7503d4451efe9f74a77bfa2125c5bc31d06
2
+ refs/heads/master: 43eb5f0a2e9fb52e154ac9a463061bb673431f19
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
+ // Issue #2263.
2
+
3
+ // Here, `f` is a function that takes a pointer `x` and a function
4
+ // `g`, where `g` requires its argument `y` to be in the same region
5
+ // that `x` is in.
6
+ fn has_same_region ( f : fn ( x : & a. int , g : fn ( y : & a. int ) ) ) {
7
+ // Somewhat counterintuitively, this fails because, in
8
+ // `wants_two_regions`, the `g` argument needs to be able to
9
+ // accept any region. That is, the type that `has_same_region`
10
+ // expects is *not* a subtype of the type that `wants_two_regions`
11
+ // expects.
12
+ wants_two_regions ( f) ; //! ERROR mismatched types
13
+ }
14
+
15
+ fn wants_two_regions ( _f : fn ( x : & int , g : fn ( y : & int ) ) ) {
16
+ }
17
+
18
+ fn main ( ) {
19
+ }
20
+
21
+
Original file line number Diff line number Diff line change
1
+ // xfail-test
2
+
3
+ // Issue #2263.
4
+
5
+ // Here, `f` is a function that takes a pointer `x` and a function
6
+ // `g`, where `g` requires its argument `y` to be in the same region
7
+ // that `x` is in.
8
+ fn has_same_region ( f : fn ( x : & a. int , g : fn ( y : & a. int ) ) ) {
9
+ // `f` should be the type that `wants_same_region` wants, but
10
+ // right now the compiler complains that it isn't.
11
+ wants_same_region ( f) ;
12
+ }
13
+
14
+ fn wants_same_region ( _f : fn ( x : & b. int , g : fn ( y : & b. int ) ) ) {
15
+ }
16
+
17
+ fn main ( ) {
18
+ }
19
+
20
+
You can’t perform that action at this time.
0 commit comments